﻿
/* =========================
   course list (clickable)
   ========================= */
.course-list {
    width: min(980px, 100%);
    margin: 18px auto 60px;
    display: grid;
    gap: 12px;
}

.course-item {
    width: 100%;
    text-align: left;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 16px;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}

    .course-item:hover {
        border-color: #d1d5db;
        box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
    }

    .course-item:active {
        transform: translateY(1px);
    }

.course-name {
    font-size: 16px;
    font-weight: 750;
    color: #0f172a;
}

.course-desc {
    margin-top: 6px;
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.5;
}

.course-meta {
    margin-top: 10px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #475569;
}

.course-price {
    font-weight: 700;
}

/* =========================
   modal
   ========================= */
.cm-root {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
}

.cm-hidden {
    display: none;
}

.cm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
}

.cm-panel {
    position: relative;
    width: min(720px, calc(100vw - 24px));
    max-height: min(80vh, 720px);
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.65);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}

.cm-head {
    padding: 14px 16px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cm-title {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.cm-close {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.cm-subtitle {
    padding: 0 16px 12px;
    font-size: 13px;
    color: #64748b;
    border-bottom: 1px solid #eef2f7;
}

.cm-body {
    padding: 12px 14px 14px;
    overflow: auto;
    max-height: calc(80vh - 92px);
}

.cm-list {
    display: grid;
    gap: 10px;
}

.cm-item {
    display: flex;
    gap: 12px;
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.cm-date {
    min-width: 110px;
    font-weight: 750;
}

.cm-info {
    display: grid;
    gap: 2px;
}

.cm-time {
    font-size: 14px;
    font-weight: 650;
}

.cm-loc {
    font-size: 13px;
    color: #64748b;
}

/* ✅ 兩種形態：過去灰字 / 未來正常字 */
.cm-item.is-past {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
}

    .cm-item.is-past .cm-loc,
    .cm-item.is-past .cm-time {
        color: #94a3b8;
    }

.cm-item.is-future {
    background: #fff;
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 10px 26px rgba(16, 185, 129, 0.10);
}

/* empty */
.cm-empty {
    padding: 18px 10px;
    color: #64748b;
    text-align: center;
}

/* lock scroll when modal open */
.cm-lock {
    overflow: hidden;
}

.cm-date {
    min-width: 120px;
    font-weight: 750;
    line-height: 1.2;
}

.cm-date-main {
    font-weight: 800;
}

.cm-date-sub {
    margin-top: 6px;
    font-size: 12.5px;
    font-weight: 650;
    color: #64748b;
}

.cm-item.is-past .cm-date-sub {
    color: #94a3b8;
}
