:root {
    /* Theme Variables - Default (Light) */
    --primary-blue: #007bff;
    --light-blue: #e3f2fd;
    --bg-color: #f8f9fa;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-main: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.blue-mode {
    /* Blue Mode Palette - Gradient & Vibrant */
    --primary-blue: #ffffff;
    --light-blue: rgba(255, 255, 255, 0.2);
    --bg-color: #0056b3;
    --card-bg: rgba(255, 255, 255, 0.15);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.dark-mode {
    /* Dark Mode Palette - Deep Dark (Solid Black) */
    --primary-blue: #4dabf7;
    --light-blue: #1a1a1a;
    --bg-color: #000000;
    --card-bg: rgba(20, 20, 20, 0.95);
    --text-main: #f8f9fa;
    --text-muted: #adb5bd;
    --border-color: #333333;
    --glass-border: rgba(255, 255, 255, 0.05);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

h1,
h2,
h3,
.lesson-name,
.time-display {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

main.container {
    flex: 1;
    /* Pushes footer to bottom */
}

/* Body & Background Animation */
body {
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    transition: background 1s ease;
}

/* Light Mode Animation (Vibrant Mesh) */
.light-mode .bg-animation {
    background:
        radial-gradient(at 0% 0%, hsla(210, 100%, 85%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(225, 100%, 90%, 1) 0, transparent 50%),
        radial-gradient(at 100% 100%, hsla(200, 100%, 92%, 1) 0, transparent 50%),
        radial-gradient(at 0% 100%, hsla(180, 100%, 95%, 1) 0, transparent 50%);
    background-size: 200% 200%;
    animation: meshMove 15s ease infinite alternate;
}

/* Blue Mode Animation (Aurora / Vivid Flow) */
.blue-mode .bg-animation {
    background: linear-gradient(-45deg, #004a99, #007bff, #00a8ff, #00c6ff);
    background-size: 400% 400%;
    animation: gradientMove 12s ease infinite;
}

/* Dark Mode Animation (Deep Space Galaxy) */
.dark-mode .bg-animation {
    background:
        radial-gradient(circle at 20% 30%, #001f3f 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, #1a0033 0%, transparent 50%),
        #000000;
    background-size: 200% 200%;
    animation: gradientMove 15s ease infinite alternate;
}

.dark-mode .bg-animation::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(white, rgba(255, 255, 255, .2) 2px, transparent 40px),
        radial-gradient(white, rgba(255, 255, 255, .15) 1px, transparent 30px);
    background-size: 550px 550px, 350px 350px;
    background-position: 0 0, 40px 60px;
    opacity: 0.1;
    animation: starPulse 10s linear infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes meshMove {
    0% {
        transform: scale(1);
        background-position: 0% 0%;
    }

    50% {
        background-position: 50% 50%;
    }

    100% {
        transform: scale(1.1);
        background-position: 100% 100%;
    }
}

@keyframes starPulse {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-100px);
    }
}

/* Cursor Follower */
.cursor-follower {
    position: fixed;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, var(--primary-blue) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    filter: blur(60px);
    transition: opacity 0.5s ease;
    mix-blend-mode: soft-light;
}

body:hover .cursor-follower {
    opacity: 0.4;
}

/* Dynamic Mood Overlay */
.mood-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.sun-rays {
    position: absolute;
    top: -20%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(255, 255, 200, 0.5) 0%, transparent 70%);
    filter: blur(100px);
    animation: sunMove 30s infinite alternate;
}

@keyframes sunMove {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(15%, 10%) scale(1.1);
    }
}

/* Entrance Animations */
.stagger-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.stagger-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Card Animation Refinement */
.card.glass {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card.glass:hover {
    transform: translateY(-5px);
}

/* Progress Bar Styling */
.progress-container {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    margin-top: 15px;
    overflow: hidden;
}

.blue-mode .progress-container,
.dark-mode .progress-container {
    background: rgba(255, 255, 255, 0.1);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary-blue);
    border-radius: 10px;
    transition: width 1s linear;
    box-shadow: 0 0 10px var(--primary-blue);
}

.blue-mode .progress-bar {
    background: #ffffff;
    box-shadow: 0 0 15px #ffffff;
}

/* Navbar */
.navbar {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-tabs {
    display: flex;
    gap: 8px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 20px;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--primary-blue);
    background: var(--light-blue);
}

.tab-btn.active {
    color: white;
    background: var(--primary-blue);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.blue-mode .tab-btn.active {
    color: #0056b3;
    /* Contrast blue on white background */
}

.blue-mode .logo,
.blue-mode .logo span {
    color: #ffffff;
    /* Logo stays white on deep blue navbar */
}

/* If the user thinks background is white, maybe they want the logo blue? 
   "ganti warna biru juga" - OK, let's try making the logo blue-ish in blue mode if needed.
   Actually, I'll make the logo span blue in blue mode to satisfy 'ganti warna biru'.
*/
.blue-mode .logo span {
    color: #e3f2fd;
}

.logo {
    font-size: 1.5rem;
    color: var(--primary-blue);
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.logo span {
    color: var(--text-main);
}

.logo-credit {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 4px;
    font-family: 'Inter', sans-serif;
}

/* Theme Options */
.theme-buttons {
    display: flex;
    gap: 12px;
}

.theme-opt {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-opt:hover {
    transform: scale(1.2);
}

.theme-opt.light {
    background-color: #ffffff;
}

.theme-opt.blue {
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.theme-opt.dark {
    background-color: #000000;
}

.theme-opt.active {
    border-color: #ffc107;
    box-shadow: 0 0 10px #ffc107;
}

/* User Profile Header */
.user-header {
    margin-top: 30px;
    margin-bottom: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 30px;
    border-radius: 24px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    background: var(--primary-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.user-details h2 {
    font-size: 1.6rem;
    margin: 0;
}

.user-details p {
    color: var(--text-muted);
    font-weight: 600;
}

/* School Header Branding */
.school-header {
    margin-top: 30px;
    margin-bottom: 20px;
}

.school-info-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 30px;
}

.school-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.school-text h2 {
    font-size: 1.5rem;
    color: var(--primary-blue);
    margin: 0;
}

.school-text p {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 2px 0;
}

.school-year {
    font-weight: 700;
    color: var(--text-main);
}

/* Tab Logic */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards & Glassmorphism */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.glass::before {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transition: 0.5s;
    pointer-events: none;
}

.glass:hover::before {
    left: 150%;
    transition: 0.8s;
}

.card {
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

/* Dashboard */
.dashboard {
    display: grid;
    gap: 20px;
    margin-bottom: 40px;
}

.clock-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-blue) 0%, #0056b3 100%);
    color: white;
    border: none;
}

.clock-card h3 {
    opacity: 0.9;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.time-display {
    font-size: 4rem;
    margin: 10px 0;
    font-variant-numeric: tabular-nums;
}

.date-display {
    font-size: 1.2rem;
    opacity: 0.8;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.status-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 5px solid var(--primary-blue);
}

.card-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 8px;
}

.lesson-name {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.lesson-time {
    font-size: 1.1rem;
    color: var(--primary-blue);
    font-weight: 700;
}

/* Indicators */
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.live {
    background-color: #2ecc71;
    box-shadow: 0 0 10px #2ecc71;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Schedule List */
.schedule-section h2 {
    margin-bottom: 25px;
    font-size: 2rem;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.day-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.day-header {
    background: var(--light-blue);
    padding: 15px 20px;
    font-weight: 700;
    color: var(--primary-blue);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-item-list {
    padding: 10px 0;
}

.schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
}

.schedule-item:last-child {
    border-bottom: none;
}

.schedule-item.active {
    background: rgba(0, 123, 255, 0.1);
    border-left: 4px solid var(--primary-blue);
}

.item-name {
    font-weight: 700;
}

.item-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.libur-tag {
    background: #ffc107;
    color: #000;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.creator {
    margin-top: 5px;
    color: var(--text-muted);
}

.creator strong {
    color: var(--primary-blue);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .school-info-wrapper {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .school-logo {
        height: 60px;
    }

    .time-display {
        font-size: 3rem;
    }

    .lesson-name {
        font-size: 1.5rem;
    }

    .schedule-grid {
        grid-template-columns: 1fr;
    }
}

/* Accessibility */
button,
input,
[role="button"] {
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
}