/* frontend/src/styles/components/calendar-layout.css
   Calendar shell layout, section structure, responsive, and utility */

/* ── Shell layout ───────────────────────────────────────────────── */
.cal-shell {
    display: grid;
    grid-template-columns: 340px 1fr;
    height: 100%;
    overflow: hidden;
    background: var(--surface);
}

.cal-left {
    background: var(--surface-container-lowest);
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Scrollable section below the fixed calendar grid */
.cal-left-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Right workspace: white surface — contrast against left via tone alone */
.cal-right {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    background: var(--surface-container-lowest);
}

/* ── Section structure ──────────────────────────────────────────── */
.cal-section {
    padding: 10px 12px;
    flex-shrink: 0;
}

.cal-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* Data labels — Manrope 800, uppercase, editorial */
.cal-section-label {
    font-family: var(--font-headline);
    font-size: 0.5625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--on-surface-variant);
}

/* Back link is interactive → ghost-border mandatory */
.cal-back-link {
    font-family: var(--font-headline);
    font-size: 0.625rem;
    font-weight: 700;
    background: none;
    border: var(--ghost-border);
    border-radius: 4px;
    color: var(--primary);
    cursor: pointer;
    padding: 3px 10px 3px 6px;
    text-align: left;
    letter-spacing: 0.01em;
}
.cal-back-link:hover {
    background: var(--surface-container);
}

/* + Add button — Trust Blues text, ghost-border, Manrope */
.cal-add-btn {
    font-family: var(--font-headline);
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--primary);
    background: none;
    border: var(--ghost-border);
    border-radius: 4px;
    padding: 3px 9px;
    cursor: pointer;
    text-transform: uppercase;
}
.cal-add-btn:hover {
    background: var(--secondary-container);
    border-color: rgba(0, 91, 193, 0.2);
}

/* ── Drawer handle (mobile only) ────────────────────────────────── */
.cal-drawer-handle {
    display: none;
    height: 40px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.cal-drawer-handle-pill {
    width: 40px;
    height: 4px;
    border-radius: 9999px;
    background: var(--border-default);
    transition: background var(--transition-fast), width var(--transition-fast);
}
.cal-drawer-handle:hover .cal-drawer-handle-pill,
.cal-drawer-handle:active .cal-drawer-handle-pill {
    background: var(--on-surface-variant);
    width: 48px;
}

/* ── Responsive: ≤1024px (mobile + small tablet) ────────────────── */
@media (max-width: 1024px) {
    .cal-shell {
        grid-template-columns: 1fr;
        height: 100%;
    }

    /* Workspace fills full screen */
    .cal-right {
        width: 100%;
        padding-bottom: 48px; /* clear the collapsed handle strip */
    }

    /* Bottom drawer */
    .cal-left {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 60vh;
        max-height: 60vh;
        border-right: none;
        border-top: 1px solid var(--border-default);
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.14), 0 -2px 8px rgba(15, 23, 42, 0.06);
        transform: translateY(calc(100% - 40px));
        transition: transform 360ms cubic-bezier(.32, .72, 0, 1);
        z-index: 30;
        overflow-x: hidden;
        overflow-y: auto; /* drawer itself is the scroll container */
    }
    .cal-left--open {
        transform: translateY(0);
    }

    /* .cal-left-scroll becomes a plain flow block; parent scrolls */
    .cal-left-scroll {
        flex: unset;
        overflow-y: visible;
        min-height: unset;
    }

    /* Handle strip: only visible on mobile, stays pinned at top while content scrolls */
    .cal-drawer-handle {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 1;
        background: var(--surface-container-lowest);
    }

    .cal-card-area { flex-direction: column; overflow-x: hidden; overflow-y: auto; }
    .cal-card-container { width: 100%; min-width: 0; }
    .cal-workspace-empty { flex-direction: column; }
}

/* ── Utility ────────────────────────────────────────────────────── */
.cal-loading { font-size: 0.6875rem; color: var(--on-surface-variant); padding: 8px 0; font-style: italic; }
.cal-empty   { font-size: 0.6875rem; color: var(--on-surface-variant); padding: 8px 0; }
.cal-error   { font-size: 0.6875rem; color: var(--error); padding: 4px 0; }

/* ── Exception card tint ────────────────────────────────────────── */
.cal-classroom-card--exception {
  border-left: 4px solid var(--color-warning);
}
.cal-classroom-card--exception .exception-label {
  color: var(--color-warning);
  font-weight: var(--weight-semibold);
}
.cal-classroom-card--exception .exception-subtitle {
  font-size: var(--text-xs);
  color: var(--fg-tertiary);
}
