﻿/* ============================================================
   Public schedule calendar — ik- design system extension
   View: Views/Home/Schedule.cshtml
   Prefix: ik-sch-
   ============================================================ */

.ik-sch-in { max-width: 1180px; margin: 0 auto; }

/* type colors, one source of truth for pills / badges / dots */
:root {
    --sch-course: var(--ik-blue-deep);
    --sch-course-bg: #e0f4fe;
    --sch-camp: var(--ik-green-deep);
    --sch-camp-bg: var(--ik-mint-bg);
    --sch-event: #8a5a12;
    --sch-event-solid: var(--ik-gold);
    --sch-event-bg: var(--ik-tan-bg);
    --sch-holiday: var(--ik-red);
    --sch-holiday-bg: var(--ik-pink-bg);
    /* after-school: purple family, distinct from the four originals */
    --sch-afterschool: var(--ik-purple);
    --sch-afterschool-bg: var(--ik-lavender-bg);
}

/* ---------- controls card ---------- */
.ik-sch-controls {
    background: #fff;
    border: 1px solid var(--ik-border-soft);
    border-radius: 22px;
    box-shadow: 0 16px 36px -28px rgba(80, 55, 20, .55);
    padding: clamp(16px, 3vw, 26px);
    margin-bottom: 22px;
}
.ik-sch-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(14px, 3vw, 28px);
    margin-bottom: 16px;
}
.ik-sch-nav-btn {
    flex: none;
    width: 44px; height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff;
    border: 2px solid var(--ik-blue-deep);
    color: var(--ik-blue-deep);
    text-decoration: none;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.ik-sch-nav-btn:hover { background: var(--ik-green-deep); border-color: var(--ik-green-deep); color: #fff; transform: scale(1.05); }
.ik-sch-month {
    font-family: var(--ik-display);
    font-weight: 600;
    font-size: clamp(19px, 2.6vw, 26px);
    color: var(--ik-ink);
    margin: 0;
    min-width: 0;
    text-align: center;
}
.ik-sch-view-toggles {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.ik-sch-toggle {
    display: inline-flex;
    min-width: 44px;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1.5px solid var(--ik-border);
    background: #fff;
    font-family: var(--ik-display);
    font-weight: 600;
    font-size: 13.5px;
    color: var(--ik-muted);
    text-decoration: none;
    transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}
.ik-sch-toggle:hover { transform: translateY(-2px); border-color: var(--ik-green); }
/* green-deep, not green: white on --ik-green is only 2.9:1. */
.ik-sch-toggle.is-active { color: #fff; background: var(--ik-green-deep); border-color: var(--ik-green-deep); }

/* ---------- desktop grid (>=992px) ---------- */
.ik-sch-grid-wrap { display: none; }
.ik-sch-grid {
    background: #fff;
    border: 1px solid var(--ik-border-soft);
    border-radius: 22px;
    box-shadow: 0 16px 36px -28px rgba(80, 55, 20, .55);
    overflow: hidden;
}
.ik-sch-grid-head, .ik-sch-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.ik-sch-dow {
    padding: 14px 6px;
    text-align: center;
    font-family: var(--ik-display);
    font-weight: 600;
    font-size: 13.5px;
    color: var(--ik-muted);
    background: var(--ik-cream-2);
    border-bottom: 2px solid var(--ik-border-soft);
}
.ik-sch-grid-head .ik-sch-dow:first-child { border-left: none; }
.ik-sch-day {
    min-height: 120px;
    padding: 8px;
    border: 1px solid var(--ik-border-soft);
    border-top: none;
    border-left: none;
    position: relative;
    cursor: pointer;
    transition: background-color .18s ease;
}
.ik-sch-week .ik-sch-day:first-child { border-left: 1px solid var(--ik-border-soft); }
.ik-sch-day:hover { background: var(--ik-cream-2); }
.ik-sch-day.is-other-month { background: #fafafa; color: var(--ik-gray); }
.ik-sch-day.is-today { background: var(--ik-tan-bg); }
.ik-sch-day.is-weekend:not(.is-other-month) { background: #fbfaf6; }
.ik-sch-day-num {
    display: block;
    font-family: var(--ik-display);
    font-weight: 600;
    font-size: 15px;
    color: var(--ik-ink);
    margin-bottom: 6px;
}
.ik-sch-day.is-other-month .ik-sch-day-num { color: var(--ik-gray); }

.ik-sch-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    font-family: var(--ik-body);
    font-weight: 700;
    font-size: 11px;
    /* A month grid can't give every pill 44px of height without becoming a scroll
       marathon, so the compact row keeps its look and buys height with padding —
       28px on desktop, and the 44px floor on coarse pointers below. */
    padding: 6px;
    margin-bottom: 3px;
    border-radius: 6px;
    text-decoration: none;
    transition: transform .16s ease;
}
.ik-sch-pill svg { flex: none; width: 11px; height: 11px; }
.ik-sch-pill span {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ik-sch-pill:hover { transform: translateX(2px); }
.ik-sch-pill--course { background: var(--sch-course); color: #fff; }
.ik-sch-pill--camp { background: var(--sch-camp); color: #fff; }
.ik-sch-pill--event { background: var(--sch-event-solid); color: var(--ik-ink); }
.ik-sch-pill--holiday { background: var(--sch-holiday); color: #fff; }
.ik-sch-pill--afterschool { background: var(--sch-afterschool); color: #fff; }

.ik-sch-more {
    display: block;
    font-family: var(--ik-body);
    font-weight: 700;
    font-size: 11px;
    color: var(--ik-muted);
    text-align: center;
    padding: 2px;
}
.ik-sch-more:hover { text-decoration: underline; text-underline-offset: 2px; }

@media (min-width: 992px) {
    .ik-sch-grid-wrap { display: block; margin-bottom: 22px; }
    .ik-sch-mobile { display: none; }
}

/* ---------- mobile view (<992px) ---------- */
.ik-sch-mobile {
    background: #fff;
    border: 1px solid var(--ik-border-soft);
    border-radius: 22px;
    box-shadow: 0 16px 36px -28px rgba(80, 55, 20, .55);
    overflow: hidden;
    margin-bottom: 22px;
}
.ik-sch-mini-cal { padding: 16px; border-bottom: 1px solid var(--ik-border-soft); }
.ik-sch-mini-head {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 6px;
}
.ik-sch-mini-dayname {
    font-family: var(--ik-body);
    font-weight: 700;
    font-size: 12px;
    color: var(--ik-gray);
    padding: 4px 0;
}
.ik-sch-mini-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.ik-sch-mini-day {
    aspect-ratio: 1;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: none;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    padding: 4px;
    font: inherit;
    transition: background .16s ease;
}
.ik-sch-mini-day:hover { background: var(--ik-cream-2); }
.ik-sch-mini-day.is-other-month { opacity: .35; }
.ik-sch-mini-day.is-today { background: var(--ik-green-deep); }
.ik-sch-mini-day.is-today .ik-sch-mini-num { color: #fff; }
.ik-sch-mini-day.is-selected { box-shadow: inset 0 0 0 2px var(--ik-green-deep); }
.ik-sch-mini-day.is-today.is-selected { box-shadow: inset 0 0 0 2px #fff; }
.ik-sch-mini-day.is-weekend:not(.is-today) .ik-sch-mini-num { color: var(--ik-red); }
.ik-sch-mini-num {
    font-family: var(--ik-body);
    font-weight: 700;
    font-size: 13.5px;
    color: var(--ik-ink);
    line-height: 1;
}
.ik-sch-mini-dots { display: flex; gap: 2px; }
.ik-sch-mini-dot { width: 4px; height: 4px; border-radius: 50%; }
.ik-sch-mini-dot--course { background: var(--sch-course); }
.ik-sch-mini-dot--camp { background: var(--sch-camp); }
.ik-sch-mini-dot--event { background: var(--sch-event-solid); }
.ik-sch-mini-dot--holiday { background: var(--sch-holiday); }
.ik-sch-mini-dot--afterschool { background: var(--sch-afterschool); }
.ik-sch-mini-day.is-today .ik-sch-mini-dot { background: rgba(255,255,255,.85); }

.ik-sch-date-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    background: var(--ik-cream-2);
    border-bottom: 1px solid var(--ik-border-soft);
}
.ik-sch-date-label {
    display: block;
    font-family: var(--ik-display);
    font-weight: 700;
    font-size: 11.5px;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--ik-green-deep);
}
.ik-sch-date-full {
    display: block;
    font-family: var(--ik-display);
    font-weight: 600;
    font-size: 16px;
    color: var(--ik-ink);
}
.ik-sch-count-badge {
    flex: none;
    font-family: var(--ik-body);
    font-weight: 700;
    font-size: 12px;
    color: var(--ik-green-deep);
    background: var(--ik-mint-bg);
    padding: 5px 11px;
    border-radius: 999px;
    white-space: nowrap;
}

.ik-sch-agenda { padding: 10px; min-height: 160px; max-height: 56vh; overflow-y: auto; }
.ik-sch-agenda-item {
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid var(--ik-border-soft);
    border-left: 4px solid transparent;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: transform .16s ease, box-shadow .16s ease;
}
.ik-sch-agenda-item:last-child { margin-bottom: 0; }
.ik-sch-agenda-item:hover { transform: translateX(3px); box-shadow: 0 8px 20px -16px rgba(30, 58, 95, .5); }
.ik-sch-agenda-item.is-course { border-left-color: var(--sch-course); }
.ik-sch-agenda-item.is-camp { border-left-color: var(--sch-camp); }
.ik-sch-agenda-item.is-event { border-left-color: var(--sch-event-solid); }
.ik-sch-agenda-item.is-holiday { border-left-color: var(--sch-holiday); }
.ik-sch-agenda-item.is-afterschool { border-left-color: var(--sch-afterschool); }
.ik-sch-agenda-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    padding-right: 12px;
    border-right: 1px solid var(--ik-border-soft);
}
.ik-sch-agenda-time-start { font-family: var(--ik-display); font-weight: 700; font-size: 14.5px; color: var(--ik-ink); }
.ik-sch-agenda-time-end { font-family: var(--ik-body); font-weight: 600; font-size: 11.5px; color: var(--ik-gray); }
.ik-sch-agenda-body { flex: 1; min-width: 0; }
.ik-sch-agenda-title {
    font-family: var(--ik-display);
    font-weight: 600;
    font-size: 15px;
    color: var(--ik-ink);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ik-sch-agenda-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--ik-body); font-weight: 600; font-size: 12.5px; color: var(--ik-muted); }
.ik-sch-agenda-meta svg { vertical-align: -2px; margin-right: 3px; }
.ik-sch-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-family: var(--ik-body);
    font-weight: 700;
    font-size: 10.5px;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.ik-sch-type-badge.is-course { color: var(--sch-course); background: var(--sch-course-bg); }
.ik-sch-type-badge.is-camp { color: var(--sch-camp); background: var(--sch-camp-bg); }
.ik-sch-type-badge.is-event { color: var(--sch-event); background: var(--sch-event-bg); }
.ik-sch-type-badge.is-holiday { color: var(--sch-holiday); background: var(--sch-holiday-bg); }
.ik-sch-type-badge.is-afterschool { color: var(--sch-afterschool); background: var(--sch-afterschool-bg); }
.ik-sch-agenda-arrow { flex: none; display: flex; align-items: center; color: #cbd5e0; }

.ik-sch-agenda-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    color: var(--ik-gray);
    text-align: center;
}
.ik-sch-agenda-empty svg { opacity: .6; }
.ik-sch-agenda-empty span { font-family: var(--ik-body); font-weight: 600; font-size: 15px; }

/* ---------- legend ---------- */
.ik-sch-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 22px;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--ik-border-soft);
    border-radius: 18px;
}
.ik-sch-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--ik-body);
    font-weight: 700;
    font-size: 13.5px;
    color: var(--ik-muted);
}
.ik-sch-dot { width: 15px; height: 15px; border-radius: 5px; flex: none; }
.ik-sch-dot--course { background: var(--sch-course); }
.ik-sch-dot--camp { background: var(--sch-camp); }
.ik-sch-dot--event { background: var(--sch-event-solid); }
.ik-sch-dot--holiday { background: var(--sch-holiday); }
.ik-sch-dot--afterschool { background: var(--sch-afterschool); }

/* ============================================================
   Day-details modal content (rendered inside window.ikModal.open)
   ============================================================ */
.ik-sch-modal-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
}
.ik-sch-modal-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--ik-border);
    background: #fff;
    font-family: var(--ik-display);
    font-weight: 600;
    font-size: 13px;
    color: var(--ik-muted);
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.ik-sch-modal-filter:hover { border-color: var(--ik-green); }
.ik-sch-modal-filter.is-active { color: #fff; background: var(--ik-green); border-color: var(--ik-green); }

.ik-sch-modal-list { display: flex; flex-direction: column; gap: 12px; }
.ik-sch-modal-item {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1.5px solid var(--ik-border-soft);
    border-left: 6px solid transparent;
    border-radius: 16px;
    padding: 16px 18px;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.ik-sch-modal-item:hover { transform: translateX(3px); box-shadow: 0 10px 24px -20px rgba(30, 58, 95, .6); }
.ik-sch-modal-item.is-course { border-left-color: var(--sch-course); }
.ik-sch-modal-item.is-camp { border-left-color: var(--sch-camp); }
.ik-sch-modal-item.is-event { border-left-color: var(--sch-event-solid); }
.ik-sch-modal-item.is-holiday { border-left-color: var(--sch-holiday); }
.ik-sch-modal-item.is-afterschool { border-left-color: var(--sch-afterschool); }
.ik-sch-modal-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.ik-sch-modal-time { font-family: var(--ik-display); font-weight: 700; font-size: 15px; color: var(--ik-ink); white-space: nowrap; }
.ik-sch-modal-duration { font-family: var(--ik-body); font-weight: 600; font-size: 11.5px; color: var(--ik-gray); }
.ik-sch-modal-name { font-family: var(--ik-display); font-weight: 600; font-size: 16.5px; color: var(--ik-ink); margin: 0 0 6px; }
.ik-sch-modal-meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ik-sch-modal-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--ik-body);
    font-weight: 600;
    font-size: 12px;
    color: var(--ik-muted);
    background: var(--ik-cream-2);
    padding: 4px 10px;
    border-radius: 999px;
}
.ik-sch-modal-teacher { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.ik-sch-modal-teacher img, .ik-sch-modal-teacher-ph {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
}
.ik-sch-modal-teacher-ph { display: grid; place-items: center; background: var(--ik-green-deep); color: #fff; }
.ik-sch-modal-teacher-label { font-family: var(--ik-body); font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--ik-gray); }
.ik-sch-modal-teacher-name { font-family: var(--ik-display); font-weight: 600; font-size: 14px; color: var(--ik-ink); }
.ik-sch-modal-students { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ik-sch-modal-student-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--ik-cream-2);
    border-radius: 999px;
    font-family: var(--ik-body);
    font-weight: 700;
    font-size: 12px;
    color: var(--ik-ink);
}
.ik-sch-modal-desc {
    font-family: var(--ik-body);
    font-weight: 500;
    font-style: italic;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--ik-muted);
    margin: 0;
}
.ik-sch-modal-empty { text-align: center; padding: 32px 12px; color: var(--ik-gray); }
.ik-sch-modal-empty svg { margin-bottom: 10px; opacity: .6; }
.ik-sch-modal-empty p { margin: 0; font-family: var(--ik-body); font-weight: 600; font-size: 15px; }
.ik-sch-modal-count {
    display: inline-flex;
    align-items: center;
    font-family: var(--ik-body);
    font-weight: 700;
    font-size: 12px;
    color: var(--ik-muted);
    background: var(--ik-cream-2);
    padding: 4px 10px;
    border-radius: 999px;
    margin: 0 auto 14px;
}
.ik-sch-count-wrap { text-align: center; }

@media (max-width: 480px) {
    .ik-sch-nav { gap: 12px; }
    .ik-sch-view-toggles { gap: 6px; }
    .ik-sch-toggle { font-size: 12.5px; padding: 8px 12px; }
}

/* Touch: the calendar's tap targets have to clear 44px (WCAG 2.5.5). Day cells and
   activity pills were the two that fell short. Coarse pointer or narrow viewport. */
@media (pointer: coarse), (max-width: 900px) {
    .ik-sch-pill { min-height: 44px; padding: 8px 6px; }
    .ik-sch-day-link,
    .ik-sch-month-grid a[href] { min-height: 44px; min-width: 44px; }
}
