:root {
    /* Senior Designer Palette: Strictly Monochrome + Sophisticated Accent */
    --primary: #000000;
    /* Apple/Tesla Core */
    --primary-soft: rgba(0, 0, 0, 0.05);
    /* --- APPLE DESIGN SYSTEM --- */
    --system-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --system-blue: #007AFF;
    --system-red: #FF3B30;
    --system-green: #34C759;
    --system-gray: #8E8E93;
    --system-gray2: #AEAEB2;
    --system-gray3: #C7C7CC;
    --system-gray4: #D1D1D6;
    --system-gray5: #E5E5EA;
    --system-gray6: #F2F2F7;

    --bg-body-grouped: #F2F2F7;
    /* iOS Grouped background color */

    --bg-body: #FFFFFF;
    --bg-card: #FFFFFF;
    --text-primary: #000000;
    --text-secondary: #8E8E93;
    --border-color: #C6C6C8;

    --radius-s: 10px;
    --radius-m: 12px;
    --radius-l: 18px;
    --accent: #000000;
    /* Unified with primary for consistency */
    --background: #FFFFFF;
    --surface: rgba(255, 255, 255, 0.8);
    --surface-solid: #f5f5f7;
    --text: #1d1d1f;
    --text-muted: #86868b;
    --border: rgba(0, 0, 0, 0.06);
    --danger: #ff3b30;
    --success: #34c759;

    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition: cubic-bezier(0.2, 0.8, 0.2, 1);

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body.dark-mode {
    --bg-body: #000000;
    --bg-card: #1C1C1E;
    --text-primary: #FFFFFF;
    --text-secondary: #8E8E93;
    --border-color: #38383A;
    --system-gray6: #1C1C1E;
    /* Grouped background in dark mode */
}

.hidden {
    display: none !important;
}

/* REFINED VISIBLE DEV BUTTON */
.nav-controls #dev-login-trigger {
    background: transparent !important;
    border: none !important;
    color: var(--text-secondary) !important;
    opacity: 0.5;
    /* Clearly visible but still discrete */
    transition: all 0.2s ease;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    cursor: pointer !important;
}

.nav-controls #dev-login-trigger:hover {
    opacity: 1;
    color: var(--system-blue) !important;
    background: rgba(0, 122, 255, 0.1) !important;
    border-radius: 10px !important;
}

.nav-controls #dev-login-trigger i {
    width: 20px;
    height: 20px;
}

body {
    font-family: var(--system-font);
    background-color: var(--bg-body);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.022em;
    padding-bottom: 90px;
    /* Space for floating nav */
}

.ios-header {
    padding: 1rem 1.2rem;
    background: var(--bg-body);
    position: sticky;
    top: 0;
    z-index: 100;
}

.ios-large-title {
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.ios-list {
    margin: 1.5rem 1rem;
    border-radius: var(--radius-l);
    background: var(--bg-card);
    overflow: hidden;
}

.ios-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 0.5px solid var(--border-color);
    background: var(--bg-card);
    transition: background 0.2s;
}

.ios-list-item:last-child {
    border-bottom: none;
}

.ios-list-item:active {
    background: var(--system-gray5);
}

.dark-mode .ios-list-item:active {
    background: #2C2C2E;
}

.ios-search-bar {
    background: var(--system-gray5);
    border-radius: 10px;
    padding: 0.8rem;
    border: none;
    width: 100%;
    font-size: 17px;
    color: var(--text-primary);
    margin: 0.5rem 1rem;
    width: calc(100% - 2rem);
}

.dark-mode .ios-search-bar {
    background: #1C1C1E;
}

[data-theme="dark"],
.dark-mode {
    --background: #000000;
    --surface: rgba(28, 28, 30, 0.6);
    --surface-solid: #1c1c1e;
    --text: #f5f5f7;
    --text-muted: #86868b;
    --primary: #ffffff;
    --accent: #ffffff;
    --primary-soft: rgba(255, 255, 255, 0.1);
    --border: rgba(255, 255, 255, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg-body);
    /* Use solid variable */
    color: var(--text-primary);
    font-family: var(--system-font);
    line-height: 1.5;
    font-weight: 400;
    -webkit-tap-highlight-color: transparent;
    padding-top: var(--safe-top);
    padding-bottom: calc(100px + var(--safe-bottom));
    min-height: 100vh;
    transition: background 0.4s var(--transition);
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

main#app-root {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Global Background - Pure Neutral */
body::before {
    display: none;
    /* Removed for solid background */
}

/* NAVBAR - Apple Style */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    height: calc(60px + var(--safe-top));
    padding-top: var(--safe-top);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.dark-mode .navbar {
    background: rgba(0, 0, 0, 0.8);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text);
    cursor: pointer;
    transition: opacity 0.3s;
}

.logo:hover {
    opacity: 0.8;
}

.logo-img {
    height: 32px;
    width: 32px;
    object-fit: contain;
    transition: all 0.4s ease;
    mix-blend-mode: multiply;
}

.dark-mode .logo-img {
    filter: invert(1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
    mix-blend-mode: normal;
}

/* --- LANDING REDESIGN --- */
.landing-branding {
    text-align: center;
    margin-bottom: 4rem;
}

.landing-branding h1 {
    font-size: clamp(3rem, 12vw, 4.5rem);
    background: linear-gradient(180deg, var(--text) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.school-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.school-card {
    background: var(--surface);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.school-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary);
    background: var(--surface-solid);
}

.school-card:active {
    transform: scale(0.98);
}

.school-card h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
}

.school-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.immersive-bg-glow {
    display: none;
}

.auth-view .navbar,
.auth-view #student-nav,
.auth-view #admin-nav {
    display: none !important;
}

.logo-img {
    height: 48px;
    /* Increased from 32px */
    width: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: all 0.3s ease;
}

.dark-mode .logo-img {
    filter: invert(1);
    mix-blend-mode: screen;
    /* Changed from normal to screen to hide black background */
}

.logo span {
    letter-spacing: -0.02em;
    font-size: 1.2rem;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* BUTTONS - Tesla Style Minimal */
.btn-primary,
.btn-secondary,
.btn-icon {
    border: none;
    padding: 0.8rem 1.4rem;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s var(--transition);
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    outline: none;
    min-height: 48px;
}

.btn-primary {
    background: var(--text);
    color: var(--background);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.btn-primary:active {
    transform: scale(0.96);
}

/* HEADER BUTTONS - Ultra Minimalist */
.nav-controls .btn-secondary,
.nav-controls .btn-icon {
    background: transparent;
    border: none;
    padding: 0.2rem 0.5rem;
    height: 28px;
    min-height: 28px;
    font-size: 0.75rem;
    color: var(--text);
    border-radius: 6px;
    font-weight: 500;
    opacity: 0.6;
}

.nav-controls .btn-secondary:hover,
.nav-controls .btn-icon:hover {
    background: var(--surface-solid);
    opacity: 1;
}

.btn-icon {
    width: 28px;
    padding: 0;
}

/* CARDS - High Precision */
.card {
    background: var(--surface);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.2rem;
    transition: transform 0.3s var(--transition), border-color 0.3s;
}

.card:active {
    border-color: var(--primary);
}

/* TYPOGRAPHY */
h1 {
    font-size: clamp(2rem, 8vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 0.8rem;
    color: var(--text);
    line-height: 1.1;
}

.text-muted {
    color: var(--text-muted);
}

.container {
    padding: 1.5rem 1.2rem;
    max-width: 800px;
    /* Slightly wider for admin screens */
    margin: 0 auto;
}

/* AUTH RADIUS & INPUTS */
.glass-input {
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 1.2rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    width: 100%;
    outline: none;
    transition: border 0.3s;
}

.glass-input:focus {
    border-color: var(--accent);
}

/* PREMIUM DROPDOWNS */
.ios-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.ios-select-wrapper::after {
    content: "";
    position: absolute;
    right: 12px;
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.5;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.ios-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--system-gray6);
    border: none;
    border-radius: 12px;
    padding: 8px 30px 8px 12px;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    font-family: var(--system-font);
    transition: all 0.2s ease;
}

.ios-select:focus {
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.dark-mode .ios-select {
    background: #1C1C1E;
}

/* Fix for standard select inside card/list */
select option {
    background-color: var(--bg-body);
    color: var(--text-primary);
}

.dark-mode select option {
    background-color: #1C1C1E;
    color: #FFFFFF;
}

/* BOTTOM NAV - Minimal Floating */
.bottom-nav {
    position: fixed;
    bottom: 4.5rem;
    /* Highly elevated for float effect */
    bottom: calc(4.5rem + var(--safe-bottom));
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: max-content;
    max-width: 92vw;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 40px;
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    z-index: 9999;
    box-shadow:
        0 20px 45px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(0, 0, 0, 0.02);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.dark-mode .bottom-nav {
    background: rgba(20, 20, 22, 0.8);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 600;
    font-size: 10px;
    min-width: 70px;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(255, 59, 48, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
    }
}

.nav-badge {
    position: absolute;
    top: 10px;
    right: 28%;
    width: 8px;
    height: 8px;
    background: var(--system-red);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--bg-card);
    /* Cutout effect */
    animation: pulse-red 2s infinite;
    z-index: 10;
}

.dark-mode .nav-badge {
    border-color: #1C1C1E;
    /* Match dark nav background */
}

@media (max-width: 768px) {
    .nav-item span {
        display: none;
    }

    .nav-item {
        padding: 0.8rem;
        min-width: 50px;
    }

    .bottom-nav {
        padding: 0.3rem 0.6rem;
        gap: 0.2rem;
        border-radius: 20px;
    }
}

.nav-item i {
    width: 22px;
    height: 22px;
}

.nav-item.active {
    color: #FFFFFF;
    background: #000000;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.dark-mode .nav-item.active {
    color: #000000;
    background: #FFFFFF;
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.15);
}

/* QR VIEW */
.qr-outer {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    display: inline-block;
    border: 1px solid #e5e5e7;
    margin: 2rem 0;
}

/* SEGMENT CONTROL */
.segment-control {
    display: flex;
    background: var(--border);
    padding: 0.3rem;
    border-radius: 40px;
    margin-bottom: 2rem;
    gap: 0.2rem;
}

/* AUTH SCREEN - High Contrast & Depth */
.auth-page-container {
    background: transparent;
    flex: 1;
    /* Allow content to grow/shrink */
    padding: 4rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

@media (max-width: 600px) {
    .auth-page-container {
        padding: 2rem 1.5rem;
    }
}

/* DESKTOP SPLIT LAYOUT */
@media (min-width: 1024px) {
    .landing-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        max-width: 1200px;
        margin: 0 auto;
        width: 100%;
        align-items: center;
        gap: 4rem;
        height: 100%;
        padding: 4rem 0;
    }

    .hero-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .auth-logo-container {
        margin-bottom: 2rem;
    }

    .auth-logo {
        width: 270px;
        /* 180 * 1.5 */
    }

    .auth-title {
        font-size: 5rem;
        margin-bottom: 1.5rem;
    }

    .auth-subtitle {
        font-size: 1.5rem;
        margin-bottom: 0;
    }

    .auth-card-container {
        display: flex;
        justify-content: center;
    }
}

/* MOBILE STACK LAYOUT */
@media (max-width: 1023px) {
    .landing-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .hero-section {
        display: contents;
    }

    .auth-card-container {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

.auth-logo-container {
    margin-bottom: 3.5rem;
    z-index: 1;
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
}

@media (max-width: 600px) {
    .auth-logo-container {
        display: none !important;
    }
}

/* Transparent Logo Magic */
.auth-logo {
    width: 210px;
    /* 140 * 1.5 */
    height: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
    animation: floatingLogo 6s ease-in-out infinite;
    /* Avoid white box by ensuring no background */
    background: transparent !important;
}

@media (max-width: 600px) {
    .auth-logo {
        width: 120px;
        /* 80 * 1.5 */
    }
}

.dark-mode .auth-logo {
    filter: invert(1);
    mix-blend-mode: screen;
    /* Improved for transparency in dark mode */
}

@keyframes floatingLogo {

    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    50% {
        transform: translateY(-12px) rotate(2deg);
    }
}

.auth-title {
    font-size: clamp(2.5rem, 10vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
    line-height: 1;
    color: var(--text);
}

.auth-subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 4rem;
    text-transform: uppercase;
}

@media (max-width: 600px) {
    .auth-subtitle {
        margin-bottom: 2rem;
    }
}

.auth-card {
    background: var(--surface);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    z-index: 1;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
}

.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.minimal-input {
    background: var(--surface-solid);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text);
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.minimal-input:focus {
    outline: none;
    background: var(--background);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
    transform: none;
}

.auth-actions {
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.btn-auth-primary {
    background: var(--text);
    color: var(--background);
    border-radius: 22px;
    padding: 1.2rem;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.btn-auth-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.btn-auth-primary:active {
    transform: scale(0.97) translateY(0);
}

.segment-item {
    flex: 1;
    border: none;
    padding: 0.6rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    background: none;
    color: var(--text-muted);
    transition: all 0.2s var(--transition);
}

.segment-item.active {
    background: var(--surface-solid);
    color: var(--text);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.weekly-day-group {
    margin-bottom: 2rem;
}

.weekly-day-header {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 0.1em;
    padding-left: 0.5rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.weekly-day-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.weekly-class-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.6rem;
    border: 1px solid var(--border);
}

.weekly-time {
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 60px;
    color: var(--text);
}

.weekly-info {
    flex: 1;
}

.weekly-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.1rem;
}

.weekly-tag {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
}

/* ANIMATIONS */
.slide-in {
    animation: fadeIn 0.8s var(--transition);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* UTILS */
.hidden {
    display: none !important;
}

.mt-4 {
    margin-top: 1rem;
}

.text-center {
    text-align: center;
}

.w-full {
    width: 100%;
}

/* WEEKLY GRID - Native Mobile Feel */
.weekly-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-top: 1rem;
}

.day-tile {
    background: var(--surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: transform 0.2s ease;
}

.day-tile:active {
    transform: scale(0.97);
}

.day-tile-header {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.4rem;
}

.tile-class-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.tile-class-time {
    font-size: 0.6rem;
    font-weight: 700;
    opacity: 0.6;
}

.tile-class-level {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text);
    text-transform: uppercase;
}

.tile-class-desc {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.8;
    line-height: 1.1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* SCHEDULE TABLE - Mobile Optimized */
.table-container {
    width: 100%;
    overflow-x: auto;
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid var(--border);
    margin-top: 1rem;
    -webkit-overflow-scrolling: touch;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    table-layout: fixed;
}

.schedule-table th {
    background: var(--surface-solid);
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
    text-align: left;
}

.schedule-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.table-class-box {
    margin-bottom: 0.5rem;
    padding: 0.6rem;
    background: var(--background);
    border-radius: 12px;
    border-left: 3px solid var(--primary);
}

.table-class-time {
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
}

.table-class-name {
    line-height: 1.2;
}

/* ADMIN LOGIN POLISH - Minimalist */
.admin-trigger-container {
    margin-top: 6rem;
    padding: 2rem 0;
    text-align: center;
}

#admin-show-btn {
    opacity: 0.4;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 40px;
    background: transparent;
    color: var(--text-muted);
}

.admin-login-card {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 28px;
    max-width: 340px;
    margin: 2rem auto;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* --- APPLE COMPONENTS --- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-l);
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.dark-mode .card {
    background: #1C1C1E;
    border: none;
    box-shadow: none;
}

/* Glassmorphic Tab Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(249, 249, 249, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 0.5px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(50px + env(safe-area-inset-bottom));
    z-index: 1000;
}

.dark-mode .bottom-nav {
    background: rgba(28, 28, 30, 0.85);
    border-top: 0.5px solid #38383A;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--system-gray);
    font-size: 10px;
    gap: 4px;
    width: 100%;
    height: 100%;
    min-width: 0;
    /* Allow shrinking */
    padding: 0 2px;
}

.nav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.nav-item.active {
    color: var(--system-blue);
}

.nav-item i {
    width: 24px;
    height: 24px;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item.active i {
    transform: translateY(-2px);
}

/* Hide labels on small screens, especially for the crowded admin menu */
@media (max-width: 480px) {
    .nav-item span {
        display: none;
    }

    .nav-item i {
        width: 28px;
        height: 28px;
        /* Slightly larger icon when text is hidden */
    }

    .nav-item.active i {
        transform: translateY(0);
        /* Reset transform since no text */
    }
}

/* MODAL */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s var(--transition);
}

.modal-content {
    background: var(--surface-solid);
    padding: 2.5rem;
    border-radius: 30px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
}

#reader {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: black;
}

/* RESPONSIVENESS */
@media (max-width: 600px) {
    h1 {
        font-size: 2.2rem;
    }

    .container {
        padding: 2rem 1rem;
    }

    .bottom-nav {
        width: auto;
        min-width: 280px;
    }
}

/* FOOTER - Ultra Minimal */
.site-footer {
    padding: 0.05rem 0;
    border-top: none;
    opacity: 0.25;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.footer-logo {
    font-size: 0.45rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0;
}

.footer-tagline {
    display: none;
}

.footer-links {
    display: flex;
    gap: 0.6rem;
    font-size: 8px;
    margin: 0;
}

.footer-copyright {
    font-size: 6px;
    margin: 0;
}

/* --- PREMIUM CUSTOM DROPDOWN --- */
.custom-dropdown-container {
    position: relative;
    width: 100%;
}

.custom-dropdown-trigger {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.custom-dropdown-trigger i {
    position: absolute;
    right: 16px;
    opacity: 0.5;
    transition: transform 0.3s ease;
}

.dark-mode .custom-dropdown-trigger {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 4px 20px rgba(0, 0, 0, 0.4);
}

.custom-dropdown-trigger:hover {
    background: var(--system-gray5);
    transform: translateY(-1px);
}

.dark-mode .custom-dropdown-trigger:hover {
    background: #0A0A0A;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 6px 25px rgba(0, 0, 0, 0.5);
}

.custom-dropdown-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #FFFFFF;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    padding: 6px;
    display: none;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    z-index: 2000;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.dark-mode .custom-dropdown-list {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.15);
    /* More visible border for pure black bg */
}

.custom-dropdown-list.open {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.dropdown-item {
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.dropdown-item:hover {
    background: var(--system-blue);
    color: white !important;
}

.dropdown-item.selected {
    color: var(--system-blue);
    font-weight: 700;
}

.dropdown-item.selected i {
    color: var(--system-blue);
}

.dropdown-item:hover i {
    color: white !important;
}