@import url("https://fonts.googleapis.com/css2?family=SF+Pro+Display:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap");
:root {
    /* Fonts */
    --font-apple: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
    /* Curves */
    --radius-bento: 28px;
    --radius-ios: 20px;
    --radius-pill: 99px;
    /* Apple UI HSL Palette */
    --apple-blue: #007aff;
    --apple-green: #34c759;
    --apple-orange: #ff9500;
    --apple-red: #ff3b30;
    --apple-purple: #af52de;
    --apple-pink: #ff2d55;
    --apple-teal: #5ac8fa;
    --apple-yellow: #ffcc00;
    --apple-indigo: #5856d6;
    /* Core Dark Mode Colors (Default) */
    --bg: #000000;
    --bg-secondary: #0b0c10;
    --card-bg: rgba(22, 24, 30, 0.65);
    --card-bg-solid: #151821;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #6b6b76;
    --glass-blur: blur(28px);
    --shadow-premium: 0 20px 50px -12px rgba(0, 0, 0, 0.8);
    --shadow-inset: inset 0 1px 1px rgba(255, 255, 255, 0.1);
    --sidebar-bg: rgba(10, 11, 14, 0.82);
}

[data-theme="light"] {
    /* Core Light Mode Colors */
    --bg: #f5f5f7;
    --bg-secondary: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.72);
    --card-bg-solid: #ffffff;
    --border: rgba(0, 0, 0, 0.06);
    --border-strong: rgba(0, 0, 0, 0.12);
    --text: #1d1d1f;
    --text-secondary: #86868b;
    --text-muted: #b5b5be;
    --glass-blur: blur(28px);
    --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.08);
    --shadow-inset: inset 0 1px 1px rgba(255, 255, 255, 0.5);
    --sidebar-bg: rgba(245, 245, 247, 0.82);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
}

body {
    background-color: var(--bg);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-apple);
    font-weight: 700;
    letter-spacing: -0.02em;
}


/* Custom Scrollbars */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 99px;
}


/* APP SHELL */

.app-shell {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
    background-image: radial-gradient(circle at 80% 20%, rgba(0, 122, 255, 0.07), transparent 45%), radial-gradient(circle at 20% 80%, rgba(175, 82, 222, 0.05), transparent 45%);
}


/* macOS Sidebar */

.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--sidebar-bg);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    height: var(--header-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-symbol {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--apple-blue), var(--apple-teal));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.logo-text {
    font-family: var(--font-apple);
    font-weight: 800;
    font-size: 18px;
    color: var(--text);
    line-height: 1;
}

.logo-text span {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    display: block;
    margin-top: 2px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding-left: 12px;
    margin-bottom: 6px;
}

.nav-links-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link:hover {
    background: var(--border);
    color: var(--text);
}

.nav-link.active {
    background: var(--border);
    color: var(--text);
    font-weight: 600;
}

.nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 25%;
    height: 50%;
    width: 3px;
    background: var(--apple-blue);
    border-radius: 0 4px 4px 0;
}

.nav-link svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    flex-shrink: 0;
}

.sidebar-footer-card {
    margin: 12px;
    padding: 12px;
    border-radius: var(--radius-ios);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    gap: 12px;
}


/* MAIN VIEWPORT */

.viewport-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}


/* Apple Header */

.top-header {
    height: var(--header-height);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    backdrop-filter: var(--glass-blur);
    z-index: 5;
}

.header-left {
    display: flex;
    flex-direction: column;
}

.header-school-name {
    font-family: var(--font-apple);
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
}

.header-breadcrumbs {
    font-size: 11px;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}


/* Dynamic Island Style Alert */

.dynamic-island-container {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    pointer-events: none;
}

.dynamic-island {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    min-width: 150px;
    justify-content: center;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: translateY(-20px) scale(0.8);
}

.dynamic-island.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.dynamic-island.expanded {
    border-radius: 24px;
    padding: 16px 24px;
    min-width: 320px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}


/* Bento Grid */

.bento-container {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
}

.bento-card {
    grid-column: span 4;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-bento);
    padding: 24px;
    box-shadow: var(--shadow-premium);
    backdrop-filter: var(--glass-blur);
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s ease;
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.7);
    border-color: var(--border-strong);
}


/* Bento Card Span Overrides */

.span-12 {
    grid-column: span 12;
}

.span-8 {
    grid-column: span 8;
}

.span-6 {
    grid-column: span 6;
}

.span-4 {
    grid-column: span 4;
}

.span-3 {
    grid-column: span 3;
}

.tall-2 {
    grid-row: span 2;
}

.tall-3 {
    grid-row: span 3;
}


/* Bento Hero card */

.bento-card.hero {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.15), rgba(90, 200, 250, 0.08)), var(--card-bg);
    border-color: rgba(0, 122, 255, 0.25);
}


/* iOS Bottom sheet slider */

.ios-sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.ios-sheet-backdrop.open {
    display: flex;
}

.ios-sheet {
    width: min(520px, 94vw);
    background: var(--card-bg-solid);
    border: 1px solid var(--border-strong);
    border-bottom: none;
    border-radius: var(--radius-bento) var(--radius-bento) 0 0;
    box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ios-sheet-backdrop.open .ios-sheet {
    transform: translateY(0);
}

.ios-sheet-drag-bar {
    width: 36px;
    height: 5px;
    background: var(--text-muted);
    border-radius: 10px;
    margin: 12px auto 4px;
    flex-shrink: 0;
}

.ios-sheet-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ios-sheet-title {
    font-family: var(--font-apple);
    font-size: 18px;
    font-weight: 700;
}

.ios-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}


/* Custom Controls */

.ios-switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ios-switch {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ios-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-strong);
    transition: .3s;
    border-radius: 34px;
}

.ios-switch-slider:before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

input:checked+.ios-switch-slider {
    background-color: var(--apple-green);
}

input:checked+.ios-switch-slider:before {
    transform: translateX(20px);
}


/* Floating AI Chat Assistant Ball */

.ai-orb-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 99px;
    background: linear-gradient(135deg, var(--apple-purple), var(--apple-blue));
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(175, 82, 222, 0.4);
    z-index: 90;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-orb-btn:hover {
    transform: scale(1.06) rotate(5deg);
    box-shadow: 0 10px 28px rgba(175, 82, 222, 0.5);
}


/* Timeline schedule */

.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-item {
    display: flex;
    gap: 16px;
    border-left: 3px solid var(--border-strong);
    padding-left: 14px;
    position: relative;
}

.timeline-item.active {
    border-left-color: var(--apple-blue);
}

.timeline-time {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-secondary);
    width: 70px;
    flex-shrink: 0;
}


/* MCQ Test */

.mcq-option {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.01);
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 8px;
    font-size: 13.5px;
    transition: all 0.15s ease;
}

.mcq-option:hover {
    background: var(--border);
}

.mcq-option.selected {
    border-color: var(--apple-blue);
    background: rgba(0, 122, 255, 0.08);
    font-weight: 600;
}


/* Responsive sidebars collapse */

@media (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }
    .sidebar .logo-text,
    .sidebar .sidebar-toggle,
    .sidebar .nav-section-title,
    .sidebar .nav-link span,
    .sidebar-footer-card {
        display: none;
    }
}

@media (max-width: 768px) {
    .app-shell {
        flex-direction: column;
    }
    .sidebar {
        width: 100vw;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .sidebar-nav {
        display: none;
    }
    .viewport-container {
        height: calc(100vh - 60px);
    }
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-card {
        grid-column: span 12 !important;
    }
}

/* 3D Hanging Coupon Widget Styles */
.hanging-coupon-wrap {
    position: fixed;
    top: 0;
    right: 40px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: top center;
    animation: swingThread 4.5s ease-in-out infinite alternate;
    pointer-events: auto;
    cursor: pointer;
}

@keyframes swingThread {
    0% { transform: rotate(-4deg); }
    50% { transform: rotate(4deg); }
    100% { transform: rotate(-4deg); }
}

.hanging-thread-line {
    width: 2px;
    height: 65px;
    background: linear-gradient(180deg, rgba(255, 204, 0, 0.9), rgba(255, 149, 0, 0.5));
    box-shadow: 0 0 8px rgba(255, 204, 0, 0.6);
    position: relative;
}

.hanging-thread-line::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--apple-yellow);
    box-shadow: 0 0 12px var(--apple-yellow);
}

.hanging-coupon-card {
    background: linear-gradient(135deg, rgba(255, 45, 85, 0.95), rgba(175, 82, 222, 0.95));
    border: 1.5px dashed rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 10px 16px;
    color: #ffffff;
    box-shadow: 0 15px 35px rgba(255, 45, 85, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hanging-coupon-card::before, .hanging-coupon-card::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    background: #030407;
    border-radius: 50%;
    transform: translateY(-50%);
}

.hanging-coupon-card::before { left: -5px; }
.hanging-coupon-card::after { right: -5px; }

.hanging-coupon-card:hover {
    transform: scale(1.05) translateY(2px);
    box-shadow: 0 20px 45px rgba(255, 45, 85, 0.7);
}

/* Thread Cutting & Ticket Falling Physics Animations */
@keyframes cutThreadTop {
    0% { height: 65px; opacity: 1; transform: scaleY(1); }
    30% { height: 25px; opacity: 0.7; transform: scaleY(0.3) rotate(25deg); }
    100% { height: 0px; opacity: 0; transform: scaleY(0); }
}

@keyframes dropTicketBottom {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    15% { transform: translateY(12px) rotate(-15deg); opacity: 1; }
    100% { transform: translateY(120vh) rotate(55deg) scale(0.8); opacity: 0; }
}

.hanging-coupon-wrap.snapped {
    animation: none !important;
}

.hanging-coupon-wrap.snapped .hanging-thread-line {
    animation: cutThreadTop 0.35s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards !important;
}

.hanging-coupon-wrap.snapped .hanging-coupon-card {
    animation: dropTicketBottom 0.85s cubic-bezier(0.55, 0.055, 0.675, 0.19) 0.08s forwards !important;
}