/* ========== Run Mode - Full-screen Presentation View ========== */

:root {
    --run-bg: #1A1A2E;
    --run-bg-secondary: #222240;
    --run-sidebar-bg: #16162A;
    --run-text: #E8E8F0;
    --run-text-secondary: #9898B0;
    --run-accent: #4A90D9;
    --run-accent-glow: rgba(74, 144, 217, 0.2);
    --run-success: #4CAF50;
    --run-warning: #FF9800;
    --run-danger: #E54D4D;
    --run-border: rgba(255, 255, 255, 0.08);
}

/* ========== Layout ========== */

.run-mode {
    position: fixed;
    inset: 0;
    display: flex;
    background: var(--run-bg);
    color: var(--run-text);
    font-family: var(--planner-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    z-index: 9999;
}

.run-mode.hidden {
    display: none;
}

/* ========== Sidebar ========== */

.run-sidebar {
    width: 280px;
    background: var(--run-sidebar-bg);
    border-right: 1px solid var(--run-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.run-sidebar__header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--run-border);
}

.run-sidebar__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--run-text);
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.run-sidebar__meta {
    font-size: 12px;
    color: var(--run-text-secondary);
}

.run-sidebar__list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.run-sidebar__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 13px;
}

.run-sidebar__item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.run-sidebar__item.active {
    background: var(--run-accent-glow);
    border-left: 3px solid var(--run-accent);
    padding-left: 17px;
}

.run-sidebar__item.completed {
    color: var(--run-text-secondary);
}

.run-sidebar__item-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--run-border);
}

.run-sidebar__item.active .run-sidebar__item-indicator {
    background: var(--run-accent);
    box-shadow: 0 0 6px var(--run-accent);
}

.run-sidebar__item.completed .run-sidebar__item-indicator {
    background: var(--run-success);
}

.run-sidebar__item-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.run-sidebar__item-duration {
    font-size: 11px;
    color: var(--run-text-secondary);
    flex-shrink: 0;
}

.run-sidebar__footer {
    padding: 16px 20px;
    border-top: 1px solid var(--run-border);
    font-size: 12px;
    color: var(--run-text-secondary);
}

.run-sidebar__progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.run-sidebar__progress-bar {
    height: 4px;
    background: var(--run-border);
    border-radius: 2px;
    overflow: hidden;
}

.run-sidebar__progress-fill {
    height: 100%;
    background: var(--run-accent);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ========== Main Content ========== */

.run-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ========== Top Bar ========== */

.run-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid var(--run-border);
    flex-shrink: 0;
}

.run-topbar__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.run-topbar__back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--run-text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.run-topbar__back:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--run-text);
}

.run-topbar__back .icon {
    width: 20px;
    height: 20px;
}

.run-topbar__name {
    font-size: 15px;
    font-weight: 600;
}

.run-topbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.run-topbar__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--run-border);
    border-radius: 6px;
    background: transparent;
    color: var(--run-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.run-topbar__btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.run-topbar__btn .icon {
    width: 16px;
    height: 16px;
}

.run-topbar__btn--close {
    color: var(--run-text-secondary);
    border: none;
    padding: 6px;
}

/* ========== Current Item ========== */

.run-current {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow-y: auto;
}

.run-current__type {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--run-accent);
    margin-bottom: 12px;
}

.run-current__name {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 8px;
    line-height: 1.2;
}

.run-current__description {
    font-size: 15px;
    color: var(--run-text-secondary);
    text-align: center;
    max-width: 600px;
    line-height: 1.6;
    margin-bottom: 32px;
}

/* ========== Timer ========== */

.run-timer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.run-timer__display {
    font-size: 64px;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    color: var(--run-text);
}

.run-timer__display.overtime {
    color: var(--run-danger);
}

.run-timer__bar {
    width: 320px;
    height: 6px;
    background: var(--run-border);
    border-radius: 3px;
    overflow: hidden;
}

.run-timer__fill {
    height: 100%;
    background: var(--run-accent);
    border-radius: 3px;
    transition: width 1s linear;
}

.run-timer__fill.warning {
    background: var(--run-warning);
}

.run-timer__fill.overtime {
    background: var(--run-danger);
}

.run-timer__label {
    font-size: 13px;
    color: var(--run-text-secondary);
}

.run-timer__controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.run-timer__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--run-text);
    cursor: pointer;
    transition: background 0.15s;
}

.run-timer__btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.run-timer__btn .icon {
    width: 20px;
    height: 20px;
}

.run-timer__btn--play {
    width: 48px;
    height: 48px;
    background: var(--run-accent);
}

.run-timer__btn--play:hover {
    background: #3A80C9;
}

/* ========== Notes ========== */

.run-notes {
    width: 100%;
    max-width: 600px;
    background: var(--run-bg-secondary);
    border: 1px solid var(--run-border);
    border-radius: 10px;
    padding: 20px 24px;
}

.run-notes__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--run-text-secondary);
    margin-bottom: 12px;
}

.run-notes__header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.run-notes__header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.run-notes__header .icon {
    width: 14px;
    height: 14px;
}

.run-notes__header-left .icon-mask {
    display: inline-block;
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    flex-shrink: 0;
}

.run-notes__category {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--run-border);
    color: var(--run-text-secondary);
}

.run-notes__category--exercise { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.run-notes__category--icebreaker { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.run-notes__category--break { background: rgba(107, 114, 128, 0.12); color: #6b7280; }

.run-notes__goto,
.run-notes__delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: var(--run-text-secondary);
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.15s, background 0.15s;
}

.run-notes__goto:hover,
.run-notes__delete:hover {
    opacity: 1;
    background: var(--run-border);
}

.run-notes__delete:hover {
    color: #ef4444;
}

.run-notes__goto .icon-mask,
.run-notes__delete .icon-mask {
    display: inline-block;
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.run-notes__content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--run-text);
    white-space: pre-wrap;
}

.run-notes:empty,
.run-notes--empty {
    display: none;
}

/* ========== Navigation Footer ========== */

.run-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--run-border);
    flex-shrink: 0;
}

.run-nav__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--run-border);
    border-radius: 8px;
    background: transparent;
    color: var(--run-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.run-nav__btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.run-nav__btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.run-nav__btn .icon {
    width: 18px;
    height: 18px;
}

.run-nav__btn--next {
    background: var(--run-accent);
    border-color: var(--run-accent);
}

.run-nav__btn--next:hover {
    background: #3A80C9;
}

.run-nav__counter {
    font-size: 13px;
    color: var(--run-text-secondary);
}

/* ========== Completed Screen ========== */

.run-complete {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.run-complete.visible {
    display: flex;
    flex: 1;
}

.run-complete__icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.run-complete__title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
}

.run-complete__subtitle {
    font-size: 15px;
    color: var(--run-text-secondary);
    margin-bottom: 32px;
}

.run-complete__stats {
    display: flex;
    gap: 32px;
    margin-bottom: 32px;
}

.run-complete__stat {
    text-align: center;
}

.run-complete__stat-value {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 4px;
}

.run-complete__stat-label {
    font-size: 12px;
    color: var(--run-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.run-complete__timings {
    width: 100%;
    max-width: 500px;
    margin-bottom: 32px;
}

.run-complete__timing-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--run-border);
    font-size: 13px;
}

.run-complete__timing-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 16px;
}

.run-complete__timing-planned {
    color: var(--run-text-secondary);
    margin-right: 16px;
    min-width: 60px;
    text-align: right;
}

.run-complete__timing-actual {
    min-width: 60px;
    text-align: right;
    font-weight: 500;
}

.run-complete__timing-actual.over {
    color: var(--run-danger);
}

.run-complete__timing-actual.under {
    color: var(--run-success);
}

/* ========== Responsive ========== */

@media (max-width: 768px) {
    .run-sidebar {
        display: none;
    }

    .run-current__name {
        font-size: 24px;
    }

    .run-timer__display {
        font-size: 48px;
    }

    .run-timer__bar {
        width: 240px;
    }

    .run-current {
        padding: 24px;
    }

    .run-workshop-btn span {
        display: none;
    }
}

/* ========== Run Workshop Button (in planner progress header) ========== */

.run-workshop-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--planner-interactive, #4A90D9);
    border-radius: var(--planner-radius-sm, 6px);
    background: var(--planner-interactive, #4A90D9);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.run-workshop-btn:hover {
    background: #3A80C9;
    border-color: #3A80C9;
    box-shadow: 0 2px 8px rgba(74, 144, 217, 0.3);
}

.run-workshop-btn .icon {
    width: 16px;
    height: 16px;
}
