:root {
    --bg-color: #050507;
    --card-bg: rgba(30, 30, 40, 0.6);
    --primary: #3b82f6;
    --accent: #8b5cf6;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.08);
    --glow: 0 0 20px rgba(59, 130, 246, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --ece-color: #00f0ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 40%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(5, 5, 7, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
    transition: var(--transition);
}

header.scrolled {
    padding: 0.6rem 5%;
    background: rgba(5, 5, 7, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, var(--text-muted));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo span {
    color: var(--primary);
    -webkit-text-fill-color: initial;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links {
    display: none; /* Hide nav by default, toggle with hamburger */
    position: absolute;
    top: 100%;
    right: 5%;
    left: auto;
    width: 250px;
    background: rgba(15, 15, 20, 0.95);
    backdrop-filter: blur(15px);
    flex-direction: column;
    padding: 1rem;
    border: 1px solid var(--glass-border);
    border-top: none;
    border-radius: 0 0 16px 16px;
    gap: 5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.nav-links.active {
    display: flex;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    width: 100%;
    text-align: left;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .nav-links {
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .nav-links a:hover,
[data-theme="light"] .nav-links a.active {
    color: var(--primary);
    background: rgba(0, 0, 0, 0.05);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 10px;
}

/* Main Layout */
main {
    margin-top: 80px;
    padding: 2rem 5%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    min-height: calc(100vh - 140px);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0 6rem;
    position: relative;
    animation: fadeIn 0.8s ease-out;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero h1 .highlight {
    color: var(--ece-color);
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.hero p {
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Grid System */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.card:hover::before {
    transform: translateX(100%);
}

.card-icon {
    width: 50px;
    height: 50px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-size: 1.5rem;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.card .tags {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
}

/* Hub Layout */
.hub-hero {
    padding: 3rem 0 5rem;
}

.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hub-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hub-card:nth-child(1) { animation-delay: 0.05s; }
.hub-card:nth-child(2) { animation-delay: 0.1s; }
.hub-card:nth-child(3) { animation-delay: 0.15s; }
.hub-card:nth-child(4) { animation-delay: 0.2s; }
.hub-card:nth-child(5) { animation-delay: 0.25s; }
.hub-card:nth-child(6) { animation-delay: 0.3s; }
.hub-card:nth-child(7) { animation-delay: 0.35s; }
.hub-card:nth-child(8) { animation-delay: 0.4s; }

.hub-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.hub-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.hub-card-icon {
    width: 50px;
    height: 50px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
}

.hub-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.hub-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.4;
    flex-grow: 1;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
}

.status-badge.available {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-badge.upcoming {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

[data-theme="light"] .status-badge.available {
    background: #dcfce7;
    color: #166534;
}

[data-theme="light"] .status-badge.upcoming {
    background: #fef3c7;
    color: #92400e;
}

/* Coming Soon Pages */
.center-main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 250px);
}

.coming-soon-page {
    text-align: center;
    animation: fadeIn 0.8s ease-out;
    padding: 3rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    backdrop-filter: blur(10px);
    max-width: 600px;
    width: 100%;
}

.coming-soon-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.5));
    animation: float 3s ease-in-out infinite;
}

.coming-soon-page h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.coming-soon-page p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.btn-back:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px var(--accent);
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Viewer Modal/Section (Hidden by default) */
.resource-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
}

.resource-viewer.active {
    display: flex;
    opacity: 1;
}

.viewer-content {
    width: 90%;
    height: 90%;
    max-width: 1200px;
    background: #111;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.3s ease;
}

.viewer-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(20, 20, 30, 0.9);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.2s;
}

.close-btn:hover {
    color: #fff;
}

.viewer-tabs {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: 0.2s;
}

.tab-btn.active {
    background: var(--primary);
    color: #fff;
}

.drive-frame {
    flex: 1;
    width: 100%;
    border: none;
    background: #ffffff;
}

.drive-frame.inverted {
    filter: invert(1) hue-rotate(180deg);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Footer */
/* Footer */
footer {
    border-top: 1px solid var(--glass-border);
    background: rgba(5, 5, 7, 0.5); /* Semi-transparent dark for default */
    backdrop-filter: blur(10px);
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.footer-logo i {
    color: var(--primary);
    filter: drop-shadow(0 0 5px rgba(59, 130, 246, 0.5));
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.separator {
    width: 4px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 50%;
    opacity: 0.5;
}

.designer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.designer-link:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.designer-link i {
    font-size: 0.8em;
}

.footer-bottom {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    width: 100%;
    max-width: 600px;
}

/* Badge for user */
.user-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 240, 255, 0.1);
    color: var(--ece-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(0, 240, 255, 0.2);
}

/* Scroll to top button */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
    z-index: 999;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 15px 25px -5px rgba(139, 92, 246, 0.5);
}

/* Mobile Responsiveness */
/* Mobile menu styles moved to global scope */

@media (max-width: 768px) {
    header {
        padding: 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .subject-grid {
        grid-template-columns: 1fr;
    }

    .viewer-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
    }

    .viewer-header {
        padding: 1rem;
    }
    
    .viewer-header h2 {
        font-size: 1.2rem;
    }

    .viewer-tabs {
        padding: 0.5rem;
        flex-wrap: wrap; /* Allow wrapping to multiple lines */
        justify-content: center;
        overflow-x: visible; /* Remove horizontal scroll */
        gap: 0.5rem;
    }
    
    .viewer-tabs::-webkit-scrollbar {
        display: none; /* Hide scrollbar */
    }

    .tab-btn {
        flex: 1 1 calc(33% - 10px); /* 3 items per row approx, or auto wrap */
        min-width: 100px;
        text-align: center;
        white-space: normal; /* Allow text to wrap to 2 lines */
        line-height: 1.2;
        padding: 0.8rem 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        height: auto;
    }
}
/* Light Mode Override */
[data-theme="light"] {
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.9);
    --primary: #2563eb;
    --accent: #7c3aed;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --glass-border: rgba(0, 0, 0, 0.08); /* More subtle border */
    --glow: 0 0 20px rgba(37, 99, 235, 0.15);
    --ece-color: #0284c7;
}

/* Light mode specific adjustments */
[data-theme="light"] .logo span {
    text-shadow: none;
}

[data-theme="light"] header {
    background: rgba(255, 255, 255, 0.85); /* Light glass */
}

[data-theme="light"] .user-badge {
    background: rgba(2, 132, 199, 0.1);
    color: var(--ece-color);
    border: 1px solid rgba(2, 132, 199, 0.2);
}

[data-theme="light"] .card {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .viewer-content {
    background: #ffffff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .viewer-header {
    background: rgba(248, 250, 252, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .viewer-tabs {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .tag {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0,0,0,0.05);
}

[data-theme="light"] footer {
    background: rgba(255, 255, 255, 0.85);
}

/* The toggle button style */
.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 1rem;
}

.theme-toggle:hover {
    background: var(--primary);
    color: white;
    transform: rotate(15deg);
}

[data-theme="light"] .theme-toggle {
    background: rgba(0, 0, 0, 0.05);
}
