/* ── Program at a Glance ── timetable schedule view ── */

.glance-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 0 3rem;
}

/* ── Day tabs ── */
.glance-day-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 0 0 2rem;
    padding: 0.45rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 28px -22px rgba(13, 30, 22, 0.45);
}

.glance-day-tab {
    flex: 1;
    display: block;
    padding: 0.9rem 1.2rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    background: #f8faf8;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.glance-day-tab:hover {
    background: #eef4ef;
    color: var(--text);
    border-color: #c9d8cd;
}

.glance-day-tab.is-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 8px 18px -14px rgba(22, 49, 37, 0.8);
}

.glance-day-tab + .glance-day-tab {
    margin-left: 0;
}

/* ── Notice line ── */
.glance-notice {
    text-align: right;
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

/* ── Timetable wrapper ── */
.glance-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Main timetable ── */
.glance-table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.72rem;
    line-height: 1.45;
}

/* Column widths */
.glance-table colgroup .col-time { width: 8%; }
.glance-table colgroup .col-room { width: 21%; }

/* ── Header row ── */
.glance-table thead th {
    padding: 0.55rem 0.4rem;
    font-weight: 700;
    font-size: 0.7rem;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    letter-spacing: 0.01em;
}

.glance-table thead th.col-th-time {
    background: #6b7280;
    color: #fff;
}

.glance-table thead th.col-th-room-a { background: #4a5a8a; }
.glance-table thead th.col-th-room-b { background: #5d8a9a; }
.glance-table thead th.col-th-room-c { background: #7a6f8a; }
.glance-table thead th.col-th-room-d { background: #4a8a6a; }

.glance-table thead th strong {
    display: block;
    font-size: 0.75rem;
}

.glance-table thead th span {
    display: block;
    font-weight: 400;
    font-size: 0.66rem;
    opacity: 0.9;
}

/* ── Body cells ── */
.glance-table tbody td,
.glance-table tbody th {
    padding: 0.6rem 0.5rem;
    text-align: center;
    vertical-align: middle;
    border: 1px solid var(--line);
}

.glance-table tbody th.cell-time {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--text);
    white-space: nowrap;
    width: 8%;
}

/* ── Session cell styles ── */
.glance-cell {
    padding: 0.5rem 0.3rem;
}

.glance-cell__title {
    font-weight: 700;
    font-size: 0.74rem;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.glance-cell__desc {
    font-size: 0.66rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.glance-cell__time {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-top: 0.15rem;
}

/* Room-based cell backgrounds */
.cell-room-a { background: #eef1f8; }
.cell-room-b { background: #edf5f8; }
.cell-room-c { background: #f3f0f8; }
.cell-room-d { background: #edf8f0; }

.cell-room-a .glance-cell__time { background: rgba(74, 90, 138, 0.2); color: #4a5a8a; }
.cell-room-b .glance-cell__time { background: rgba(93, 138, 154, 0.2); color: #5d8a9a; }
.cell-room-c .glance-cell__time { background: rgba(122, 111, 138, 0.2); color: #7a6f8a; }
.cell-room-d .glance-cell__time { background: rgba(74, 138, 106, 0.2); color: #4a8a6a; }

/* Break / special */
.cell-break {
    background: #f0f0f0;
    color: var(--muted);
    font-weight: 500;
}

.cell-break .glance-cell__time {
    background: rgba(0,0,0,0.1);
    color: #555;
}

.cell-special {
    background: #fef9e6;
}

.cell-special .glance-cell__time {
    background: rgba(180,140,40,0.2);
    color: #8a6f2a;
}

.cell-luncheon {
    background: #fff9f0;
}

.cell-luncheon .glance-cell__time {
    background: rgba(180,120,60,0.18);
    color: #8a5a2a;
}

.cell-empty {
    background: #fafafa;
}

/* ── Timetable day panel (show/hide) ── */
.glance-day-panel {
    display: none;
}

.glance-day-panel.is-active {
    display: block;
}

/* ── Responsive ── */
@media (max-width: 720px) {
    .glance-page {
        padding-top: 1.3rem;
    }

    .glance-day-tabs {
        flex-direction: column;
        gap: 0.35rem;
        padding: 0.4rem;
        margin-bottom: 1.35rem;
        border-radius: 12px;
    }

    .glance-day-tab {
        border-radius: 9px;
        font-size: 0.78rem;
        padding: 0.72rem 1rem;
    }

    .glance-day-tab.is-active {
        border-color: var(--accent);
    }

    .glance-day-tab + .glance-day-tab {
        margin-left: 0;
    }

    /* 테이블 전체를 block 으로 전환 */
    .glance-table-wrap {
        overflow-x: visible;
    }

    .glance-table {
        display: block;
        min-width: 0;
        font-size: 0.72rem;
    }

    .glance-table colgroup {
        display: none;
    }

    .glance-table thead {
        display: none;
    }

    .glance-table tbody {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    /* 시간대 카드 - padding 제거, overflow hidden 으로 내부 구분선 edge 까지 */
    .glance-table tbody tr {
        display: flex;
        flex-direction: column;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #fff;
        overflow: hidden;
        padding: 0;
    }

    /* 시간 헤더 - 회색 배경 스트립 */
    .glance-table tbody th.cell-time {
        width: 100%;
        text-align: left;
        padding: 0.55rem 1rem;
        border: none;
        border-bottom: 1px solid var(--line);
        background: #f3f5f8;
        font-size: 0.75rem;
        font-weight: 700;
        color: #556070;
        letter-spacing: 0.04em;
        white-space: nowrap;
    }

    /* 마지막 시간 칼럼 숨김 (우측 중복) */
    .glance-table tbody tr th.cell-time:last-child {
        display: none;
    }

    /* 세션 셀 공통 */
    .glance-table tbody td {
        padding: 0.7rem 1rem;
        text-align: left;
        border: none;
        border-top: 1px solid var(--line);
        display: flex;
        flex-direction: column;
    }

    /* 시간 헤더 바로 아래 첫 td 는 구분선 없음 */
    .glance-table tbody th.cell-time + td {
        border-top: none;
    }

    /* Room 셀 - 좌측 색상 accent border */
    .cell-room-a {
        border-left: 3px solid #4a5a8a;
        background: transparent;
        padding-left: 0.9rem;
    }

    .cell-room-b {
        border-left: 3px solid #5d8a9a;
        background: transparent;
        padding-left: 0.9rem;
    }

    .cell-room-c {
        border-left: 3px solid #7a6f8a;
        background: transparent;
        padding-left: 0.9rem;
    }

    .cell-room-d {
        border-left: 3px solid #4a8a6a;
        background: transparent;
        padding-left: 0.9rem;
    }

    /* Room 라벨 via ::before */
    .cell-room-a::before,
    .cell-room-b::before,
    .cell-room-c::before,
    .cell-room-d::before {
        display: block;
        font-weight: 700;
        font-size: 0.64rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        margin-bottom: 0.3rem;
    }

    .cell-room-a::before {
        content: 'ROOM A';
        color: #4a5a8a;
    }

    .cell-room-b::before {
        content: 'ROOM B';
        color: #5d8a9a;
    }

    .cell-room-c::before {
        content: 'ROOM C';
        color: #7a6f8a;
    }

    .cell-room-d::before {
        content: 'ROOM D';
        color: #4a8a6a;
    }

    /* 특수 셀 (개회식, 환영 만찬 등) */
    .cell-special {
        padding: 0.85rem 1rem;
        border-top: none;
    }

    /* 휴식 */
    .cell-break {
        padding: 0.75rem 1rem;
        border-top: none;
    }

    /* 점심 세미나 */
    .cell-luncheon {
        padding: 0.75rem 1rem;
    }

    /* cell-empty 숨김: .glance-table tbody td 보다 명시도를 높여야 함 */
    .glance-table tbody td.cell-empty {
        display: none;
    }

    .glance-cell {
        padding: 0;
    }

    .glance-cell__title {
        font-size: 0.82rem;
        font-weight: 700;
        color: var(--text);
        margin-bottom: 0.2rem;
    }

    .glance-cell__desc {
        font-size: 0.68rem;
        color: var(--muted);
        line-height: 1.45;
    }

    .glance-cell__time {
        display: none;
    }
}
