/* 
    Design System: MGMP Fisika Kota Serang 
    Theme: Quantum Professionalism
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@400;600;700;800&display=swap');

:root {
    --container: 1200px;
    /* Light Mode (Default) */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --glass: rgba(255, 255, 255, 0.8);
    --ticker-bg: #1e293b;
    --ticker-text: #ffffff;
    --auth-backdrop: rgba(2, 6, 23, 0.65);
    --auth-surface: rgba(255, 255, 255, 0.92);
    --auth-border: rgba(148, 163, 184, 0.35);
    --auth-text: var(--text-main);
    --auth-muted: var(--text-muted);
    --auth-input-bg: rgba(255, 255, 255, 0.85);
    --auth-input-border: rgba(148, 163, 184, 0.45);
}

[data-theme="dark"] {
    --bg-body: #020617;
    --bg-surface: #0f172a;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #1e293b;
    --glass: rgba(15, 23, 42, 0.8);
    --secondary: #ffffff;
    --auth-backdrop: rgba(2, 6, 23, 0.75);
    --auth-surface: linear-gradient(160deg, #0b1120, #0f172a 55%, #1e293b);
    --auth-border: rgba(148, 163, 184, 0.25);
    --auth-text: #e2e8f0;
    --auth-muted: #94a3b8;
    --auth-input-bg: rgba(15, 23, 42, 0.65);
    --auth-input-border: rgba(148, 163, 184, 0.3);
    --hero-bg-1: rgba(37, 99, 235, 0.15);
    --hero-bg-2: rgba(14, 165, 233, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100vw;
}

h1, h2, h3, h4, .font-heading {
    font-family: 'Outfit', sans-serif;
    color: var(--secondary);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

/* Utilities */
.text-center { text-align: center; }
.section-padding { padding: 5rem 0; }
.flex { display: flex; }
.grid { display: grid; }
.gap-1 { gap: 1rem; }
.gap-2 { gap: 2rem; }

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.theme-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* Running Ticker */
.ticker-wrap {
    width: 100%;
    background: var(--ticker-bg);
    color: var(--ticker-text);
    padding: 0.5rem 0;
    overflow: hidden;
    position: fixed;
    top: 80px;
    z-index: 999;
    font-size: 0.85rem;
    font-weight: 500;
}

.ticker-content {
    display: flex;
    white-space: nowrap;
    animation: ticker 30s linear infinite;
}

.ticker-item {
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ticker-item::after {
    content: "|";
    margin-left: 2rem;
    color: var(--accent);
}

@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Science Animation Canvas */
#physics-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.5;
    pointer-events: none;
}
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--secondary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

/* Hero Section */
.hero {
    padding-top: 160px;
    padding-bottom: 100px;
    background: radial-gradient(circle at top right, var(--hero-bg-1, #e0f2fe), transparent),
                radial-gradient(circle at bottom left, var(--hero-bg-2, #eff6ff), transparent);
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    text-align: center;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(to bottom right, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
        line-height: 1.1;
    }
    .hero p {
        font-size: 1rem;
    }
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-auth {
    background: linear-gradient(135deg, #1d4ed8, #06b6d4);
    color: #fff;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.btn-admin {
    background: linear-gradient(135deg, #0f172a, #2563eb);
    color: #fff;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
    display: none;
}

.btn-admin:hover {
    filter: brightness(1.05);
}

.auth-modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--auth-backdrop);
    backdrop-filter: blur(6px);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 180ms ease;
}

.auth-modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.auth-modal {
    width: 100%;
    max-width: 420px;
    background: var(--auth-surface);
    color: var(--auth-text);
    border: 1px solid var(--auth-border);
    border-radius: 1rem;
    padding: 1.5rem;
    position: relative;
    box-shadow: 0 20px 50px rgba(2, 6, 23, 0.45);
    transform: translateY(10px) scale(0.985);
    opacity: 0;
    transition: transform 200ms ease, opacity 200ms ease;
}

.auth-modal-backdrop.active .auth-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.auth-header {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.auth-title {
    font-size: 1.35rem;
    margin-bottom: 0.35rem;
}

.auth-atom {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(14, 165, 233, 0.14);
    color: #7dd3fc;
    font-size: 1.2rem;
}

.auth-subtitle {
    color: var(--auth-muted);
    font-size: 0.9rem;
}

.auth-modal .form-group {
    margin-bottom: 0.9rem;
}

.auth-modal label {
    color: var(--auth-text);
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.9;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrap > i {
    position: absolute;
    left: 0.85rem;
    color: var(--auth-muted);
    font-size: 0.95rem;
    pointer-events: none;
    opacity: 0.85;
}

.auth-input-wrap input {
    width: 100%;
    padding: 0.8rem 2.75rem 0.8rem 2.6rem;
    border-radius: 0.85rem;
    border: 1px solid var(--auth-input-border);
    background: var(--auth-input-bg);
    color: var(--auth-text);
    font-size: 16px; /* Prevents auto-zoom on mobile */
    outline: none;
    transition: box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.auth-input-wrap input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.22);
}

.auth-toggle {
    position: absolute;
    right: 0.6rem;
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 0.75rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--auth-muted);
    transition: background 160ms ease, color 160ms ease;
    opacity: 0.9;
}

.auth-toggle:hover {
    background: rgba(37, 99, 235, 0.14);
    color: var(--primary);
}

.auth-modal .auth-submit {
    width: 100%;
    margin-top: 0.2rem;
    border-radius: 0.9rem;
    padding: 0.85rem 1.25rem;
}

.auth-modal .auth-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.auth-close {
    position: absolute;
    right: 10px;
    top: 10px;
    border: none;
    background: transparent;
    color: var(--auth-muted);
    font-size: 1.1rem;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 0.85rem;
    display: grid;
    place-items: center;
    transition: background 160ms ease, color 160ms ease;
}

.auth-close:hover {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
}

.auth-switch {
    margin-top: 0.9rem;
    font-size: 0.85rem;
    color: var(--auth-muted);
}

.auth-switch span {
    color: #7dd3fc;
    cursor: pointer;
}

.auth-error {
    min-height: 18px;
    margin-top: 0.6rem;
    color: #fca5a5;
    font-size: 0.82rem;
}

/* Card Styles */
.card {
    background: var(--bg-surface);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    transition: 0.3s ease;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

/* Blog/Article Grid */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.article-card img {
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    height: 200px;
    width: 100%;
    object-fit: cover;
}

.article-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: block;
}

.article-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.article-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer */
footer {
    background: #0b1120;
    color: white;
    padding: 5rem 0 2rem;
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-about p {
    color: var(--text-light);
    margin-top: 1rem;
    font-size: 0.9rem;
}

.footer-title {
    font-family: 'Outfit';
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.footer-links a {
    display: block;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .hero {
        padding-top: 120px;
        padding-bottom: 60px;
    }

    .section-padding {
        padding: 3rem 0;
    }

    .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    .mobile-menu-btn {
        display: block !important;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--secondary);
        z-index: 1001;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: white;
        padding: 2rem;
        border-bottom: 1px solid var(--border);
        gap: 1.5rem;
        box-shadow: var(--shadow-lg);
        animation: slideDown 0.3s ease forwards;
    }

    @keyframes slideDown {
        from { transform: translateY(-20px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }

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

    .hero .btn, .section-padding .btn {
        width: 100%;
        text-align: center;
        margin-left: 0 !important;
        margin-bottom: 0.5rem;
    }

    .btn-auth {
        padding: 0.4rem 0.7rem;
        font-size: 0.75rem;
    }

    .nav-content > div {
        gap: 0.5rem !important;
    }

    .logo {
        font-size: 1.1rem;
        gap: 0.4rem;
    }

    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    .article-grid { grid-template-columns: 1fr; }
}

/* Animations */
[data-aos] {
    transition-duration: 800ms !important;
}
