/* Sipsala Online Classes — student page.
   Palette inherited from /sipsala/assets/sipsala.css :root variables.
   Every animation is disabled under prefers-reduced-motion (see bottom). */

* { box-sizing: border-box; }

body.oc {
    display: block;
    place-items: unset;
    min-height: 100dvh;
    margin: 0;
    padding: 8px 0 48px;
    font-family: "Manrope", "Noto Sans Sinhala", "Segoe UI", system-ui, sans-serif;
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 170, 190, 0.28) 0 90px, transparent 91px),
        radial-gradient(circle at 92% 4%, rgba(120, 210, 255, 0.30) 0 110px, transparent 111px),
        linear-gradient(180deg, #f4f9ff 0%, #eef4ff 42%, #f7fbff 100%);
    background-attachment: fixed;
    color: var(--navy, #2a3a75);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

.oc-wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* ================================================================ header
   Compact logo + grade card — matches the Flutter app chrome instead of
   a hanging "Sipsala Online Classes" ribbon that fights the app bar. */

.oc-hero {
    max-width: 860px;
    margin: 0 auto;
    padding: 6px 16px 2px;
    animation: ocRise .5s cubic-bezier(.22, 1, .36, 1) both;
}

.oc-hero-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, .90);
    border: 1px solid rgba(255, 255, 255, .95);
    border-radius: 26px;
    box-shadow: 0 10px 28px rgba(42, 58, 117, .10);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.oc-logo {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    object-fit: contain;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(42, 58, 117, .10);
}

.oc-hero-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    text-align: left;
}
.oc-kicker {
    margin: 0;
    font-family: "Manrope", "Noto Sans Sinhala", sans-serif;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1.2;
    color: var(--navy-soft, #6b7aaa);
}
.oc-hero h1 {
    margin: 0;
    font-family: "Sora", "Noto Sans Sinhala", sans-serif;
    font-size: 1.32rem;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.15;
    color: var(--navy, #2a3a75);
}

/* Inside the Flutter WebView the app bar already says Online Class,
   so keep the identity chip smaller and quieter. */
body.oc[data-in-app="1"] { padding-top: 4px; }
body.oc[data-in-app="1"] .oc-hero { padding-top: 2px; }
body.oc[data-in-app="1"] .oc-hero-card { padding: 14px 18px; gap: 14px; }
body.oc[data-in-app="1"] .oc-logo { width: 52px; height: 52px; flex-basis: 52px; border-radius: 15px; }
body.oc[data-in-app="1"] .oc-hero h1 { font-size: 1.22rem; }

/* leftover hanging-tab markup must never reappear */
.oc-header, .oc-grade-badge, .oc-sub { display: none !important; }

@keyframes ocRise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
@keyframes ocPop {
    from { opacity: 0; transform: scale(.82); }
    to   { opacity: 1; transform: scale(1); }
}

.oc-grades { display: none !important; }

/* =============================================================== sections */

.oc-section { margin-top: 30px; animation: ocRise .5s cubic-bezier(.22, 1, .36, 1) both; }
.oc-section h2 {
    display: flex; align-items: center; gap: 9px;
    margin: 0 0 14px;
    font-size: 1.18rem;
    font-weight: 800;
}
.oc-section h2 .oc-ico {
    display: inline-grid; place-items: center;
    width: 34px; height: 34px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 5px 14px rgba(52, 78, 140, .13);
    font-size: 1rem;
}
.oc-section h2 .oc-count {
    font-size: .74rem; font-weight: 800;
    background: #fff; color: var(--navy-soft, #6b7aaa);
    padding: 3px 10px; border-radius: 999px;
    box-shadow: 0 3px 10px rgba(52, 78, 140, .09);
}

/* ================================================================== cards */

.oc-card {
    position: relative;
    background: rgba(255, 255, 255, .93);
    backdrop-filter: blur(8px);
    border-radius: 22px;
    padding: 15px 17px;
    margin-bottom: 13px;
    box-shadow: 0 10px 26px rgba(52, 78, 140, .10);
    border: 1.5px solid rgba(255, 255, 255, .9);
    /* staggered entrance; --i is set per card by grade.php */
    animation: ocCardIn .5s cubic-bezier(.22, 1, .36, 1) both;
    animation-delay: calc(var(--i, 0) * 70ms);
    transition: transform .22s ease, box-shadow .22s ease;
}
.oc-card:active { transform: scale(.987); }

@keyframes ocCardIn {
    from { opacity: 0; transform: translateY(18px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

/* live card: warm border plus a slow breathing glow */
.oc-card.is-live {
    border-color: rgba(232, 93, 76, .55);
    box-shadow: 0 10px 26px rgba(232, 93, 76, .20);
    animation: ocCardIn .5s cubic-bezier(.22, 1, .36, 1) both,
               ocLiveGlow 2.8s ease-in-out 1s infinite;
}
@keyframes ocLiveGlow {
    0%, 100% { box-shadow: 0 10px 26px rgba(232, 93, 76, .18); }
    50%      { box-shadow: 0 12px 34px rgba(232, 93, 76, .38); }
}

.oc-card.is-cancelled { opacity: .62; }
.oc-card.is-cancelled h3 { text-decoration: line-through; }

.oc-card-top { display: flex; gap: 13px; align-items: flex-start; }

.oc-thumb {
    width: 66px; height: 66px; flex: 0 0 66px;
    border-radius: 18px; object-fit: cover;
    background: var(--field, #f4f9ff);
    box-shadow: 0 4px 12px rgba(52, 78, 140, .12);
}
.oc-card-main { flex: 1 1 auto; min-width: 0; }
.oc-card h3 {
    margin: 0 0 5px;
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.32;
}

.oc-meta { font-size: .86rem; color: var(--navy-soft, #6b7aaa); line-height: 1.7; }
.oc-meta strong { color: var(--navy, #2a3a75); font-weight: 700; }

/* time row gets a little emphasis — it is what parents look for */
.oc-time {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 5px; padding: 4px 11px;
    border-radius: 10px;
    background: var(--field, #f4f9ff);
    font-size: .87rem; font-weight: 700;
    color: var(--navy, #2a3a75);
}

.oc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.oc-chip {
    font-size: .74rem; font-weight: 700;
    padding: 4px 11px; border-radius: 999px;
    background: var(--field, #f4f9ff); color: var(--navy, #2a3a75);
}
.oc-chip.subject { background: #ecf6ff; color: #33629b; }

/* ================================================================= badges */

.oc-badge {
    display: inline-block;
    font-size: .71rem; font-weight: 800;
    padding: 4px 11px; border-radius: 999px;
    color: #fff; letter-spacing: .4px;
}
.oc-badge.live      { background: linear-gradient(135deg, #f4715f, #e0402c); }
.oc-badge.scheduled { background: var(--blue-deep, #39a6db); }
.oc-badge.completed { background: var(--green-deep, #5fb653); }
.oc-badge.cancelled { background: #9aa4bf; }
.oc-badge.premium   { background: linear-gradient(135deg, #ffc061, #ef9140); }
.oc-badge.today     { background: linear-gradient(135deg, #8f7ce8, #6f5bd6); }

/* pulsing dot with an expanding ring */
.oc-live-dot {
    position: relative;
    display: inline-block;
    width: 8px; height: 8px; border-radius: 50%;
    background: #fff; margin-right: 7px;
}
.oc-live-dot::after {
    content: '';
    position: absolute; inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .85);
    animation: ocRing 1.6s ease-out infinite;
}
@keyframes ocRing {
    0%   { transform: scale(.6); opacity: 1; }
    100% { transform: scale(2.1); opacity: 0; }
}

/* ================================================================ buttons */

.oc-actions { margin-top: 13px; }
.oc-btn {
    position: relative;
    display: block; width: 100%;
    padding: 14px 16px;
    border: none; border-radius: 16px;
    font-size: 1rem; font-weight: 800;
    font-family: inherit;
    text-align: center; text-decoration: none;
    letter-spacing: .3px;
    cursor: pointer;
    color: #fff;
    background: var(--blue-deep, #39a6db);
    overflow: hidden;
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.oc-btn:active { transform: scale(.972); }

.oc-btn.join {
    background: linear-gradient(135deg, #f8836f, #e0402c);
    box-shadow: 0 8px 20px rgba(224, 64, 44, .34);
    animation: ocBtnBreathe 2.6s ease-in-out infinite;
}
@keyframes ocBtnBreathe {
    0%, 100% { box-shadow: 0 8px 20px rgba(224, 64, 44, .30); }
    50%      { box-shadow: 0 10px 28px rgba(224, 64, 44, .50); }
}

.oc-btn.watch {
    background: linear-gradient(135deg, #86d878, #4da542);
    box-shadow: 0 8px 20px rgba(77, 165, 66, .30);
}
.oc-btn.locked  { background: #cfd7e8; color: #5f6c8e; cursor: default; }
.oc-btn.pending { background: var(--field, #f4f9ff); color: var(--navy-soft, #6b7aaa); cursor: default; }

/* light sweep on the primary action buttons */
.oc-btn.join::before,
.oc-btn.watch::before {
    content: '';
    position: absolute; top: 0; left: -70%;
    width: 45%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .40), transparent);
    transform: skewX(-20deg);
    animation: ocBtnSheen 3.4s ease-in-out infinite;
}
@keyframes ocBtnSheen {
    0%, 62%, 100% { left: -70%; opacity: 0; }
    70%           { opacity: 1; }
    88%           { left: 130%; opacity: 0; }
}

/* ============================================================ empty state */

.oc-empty {
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(6px);
    border-radius: 20px;
    padding: 26px 18px; text-align: center;
    color: var(--navy-soft, #6b7aaa); font-size: .93rem;
    box-shadow: 0 8px 22px rgba(52, 78, 140, .08);
    border: 1.5px dashed rgba(107, 122, 170, .28);
    animation: ocCardIn .5s cubic-bezier(.22, 1, .36, 1) both;
}
.oc-empty .oc-emoji {
    font-size: 2.1rem; display: block; margin-bottom: 8px;
    animation: ocFloat 3.4s ease-in-out infinite;
}
@keyframes ocFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}

.oc-foot {
    margin-top: 32px; text-align: center;
    font-size: .78rem; color: var(--navy-soft, #6b7aaa);
}

/* ============================================================== materials */

.oc-materials { margin-top: 12px; }
.oc-materials-title {
    font-size: .78rem; font-weight: 800;
    color: var(--navy-soft, #6b7aaa);
    text-transform: uppercase; letter-spacing: .5px;
    margin-bottom: 6px;
}
.oc-file {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; margin-bottom: 6px;
    border-radius: 13px;
    background: var(--field, #f4f9ff);
    text-decoration: none;
    color: var(--navy, #2a3a75);
    font-size: .87rem; font-weight: 700;
    transition: transform .16s ease, background .16s ease;
}
.oc-file:active { transform: scale(.985); background: #e8f2ff; }
.oc-file .oc-file-ico { font-size: 1.15rem; }
.oc-file .oc-file-size {
    margin-left: auto;
    font-size: .74rem; font-weight: 600;
    color: var(--navy-soft, #6b7aaa);
}
.oc-file.is-locked { opacity: .65; cursor: default; }
.oc-btn.tute {
    background: linear-gradient(135deg, #7f8fe0, #5b6fd6);
    box-shadow: 0 8px 20px rgba(91, 111, 214, .28);
    margin-top: 8px;
}

/* ============================================================ small phones */

@media (max-width: 420px) {
    .oc-hero h1 { font-size: 1.22rem; }
    .oc-logo { width: 52px; height: 52px; flex-basis: 52px; }
    .oc-thumb { width: 56px; height: 56px; flex-basis: 56px; }
    .oc-card { padding: 13px 14px; border-radius: 19px; }
    .oc-section h2 { font-size: 1.08rem; }
}

/* ==================================================== accessibility opt-out */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}
