/* ===== Base Variables & Reset ===== */
:root {
    /* LIGHT MODE (Default) */
    --bg-main: #f8fafc;
    --bg-panel: rgba(255, 255, 255, 0.7);
    --bg-panel-hover: rgba(255, 255, 255, 1);
    --glass-border: rgba(0, 0, 0, 0.1);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    
    --primary: #7c3aed;
    --primary-glow: rgba(124, 58, 237, 0.3);
    --secondary: #2563eb;
    --accent: #db2777;

    --nav-bg: rgba(248, 250, 252, 0.8);
    --code-bg: rgba(0, 0, 0, 0.05);
    --input-bg: rgba(255, 255, 255, 0.8);
    --form-bg: rgba(255, 255, 255, 0.6);
    --ai-caption-bg: rgba(255, 255, 255, 0.8);
    --ai-node-bg: rgba(0, 0, 0, 0.05);
    --hero-badge-bg: rgba(124, 58, 237, 0.1);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
    /* DARK MODE */
    --bg-main: #0a0a0f;
    --bg-panel: rgba(255, 255, 255, 0.03);
    --bg-panel-hover: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.5);
    --secondary: #3b82f6;
    --accent: #ec4899;

    --nav-bg: rgba(10, 10, 15, 0.8);
    --code-bg: rgba(0, 0, 0, 0.3);
    --input-bg: rgba(255, 255, 255, 0.05);
    --form-bg: rgba(20, 20, 25, 0.7);
    --ai-caption-bg: rgba(0, 0, 0, 0.5);
    --ai-node-bg: rgba(255, 255, 255, 0.05);
    --hero-badge-bg: rgba(139, 92, 246, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--secondary), var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-center { text-align: center; }
.mb-4 { margin-bottom: 2rem; }

/* ===== Layout & Utilities ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem auto;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 4rem;
    align-items: center;
}

/* ===== Background Effects ===== */
.background-effects {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s infinite alternate ease-in-out;
}

.orb-1 {
    top: -10%; left: -10%;
    width: 50vw; height: 50vw;
    background: var(--primary);
}

.orb-2 {
    bottom: -10%; right: -10%;
    width: 60vw; height: 60vw;
    background: var(--secondary);
    animation-delay: -5s;
}

.orb-3 {
    top: 40%; left: 60%;
    width: 30vw; height: 30vw;
    background: var(--accent);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    padding: 1.5rem 0;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
    transition: background-color 0.3s ease;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
}

.icon-primary {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    color: var(--text-primary);
    background: var(--bg-panel);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding-top: 6rem;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--hero-badge-bg);
    color: var(--primary);
    border: 1px solid var(--hero-badge-bg);
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary);
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 30px var(--primary-glow);
}

/* ===== Code Block / Glass Card ===== */
.glass-card, .glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    backdrop-filter: blur(12px);
    padding: 2rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.main-card {
    padding: 0;
    overflow: hidden;
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform 0.5s ease;
}

.main-card:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.code-header {
    background: var(--code-bg);
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.dot {
    width: 12px; height: 12px; border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #eab308; }
.dot-green { background: #22c55e; }

pre {
    padding: 2rem;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    overflow-x: auto;
}

.keyword { color: #c678dd; }
.function { color: #61afef; }
.comment { color: #5c6370; font-style: italic; }

/* ===== Features Section ===== */
.feature-card {
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: var(--bg-panel-hover);
    transform: translateY(-5px);
    border-color: rgba(124, 58, 237, 0.4);
}

.icon-wrapper {
    width: 50px; height: 50px;
    border-radius: 0.75rem;
    background: rgba(124, 58, 237, 0.1);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

/* ===== Timeline / Studi Kasus ===== */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.timeline-item {
    position: relative;
    transition: transform 0.3s ease;
}

.timeline-item:hover {
    transform: translateX(10px);
    border-color: rgba(37, 99, 235, 0.4);
}

.inline-icon {
    vertical-align: middle;
    margin-right: 0.5rem;
    color: var(--secondary);
}

/* ===== AI Section ===== */
.styled-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.styled-list li {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.styled-list i {
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.styled-list strong {
    display: block;
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

/* AI Animation Vis */
.ai-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
}

.ai-animation {
    position: relative;
    width: 100%;
    height: 150px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    margin-bottom: 2rem;
}

.node {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: var(--ai-node-bg);
    border: 2px solid var(--glass-border);
    display: flex; align-items: center; justify-content: center;
    z-index: 2;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.center-node {
    width: 80px; height: 80px;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
    animation: pulse 2s infinite;
}

.line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    z-index: 1;
}

.line-1 { left: 50px; width: calc(50% - 50px); top: 50%; }
.line-2 { right: 50px; width: calc(50% - 50px); top: 50%; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(124, 58, 237, 0); }
    100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); }
}

.ai-caption {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: var(--ai-caption-bg);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
}

/* ===== Footer ===== */
footer {
    padding: 3rem 0;
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
}

/* ===== Form & LKPD Styles ===== */
.lkpd-form-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--form-bg);
}

.lkpd-identity {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    padding: 1rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.2);
}

textarea.form-control {
    resize: vertical;
}

.divider {
    border: none;
    border-top: 1px dashed var(--glass-border);
    margin: 2rem 0;
}

.mt-4 { margin-top: 2rem; }
.task-desc { color: var(--text-secondary); margin-bottom: 1rem; font-size: 0.95rem; }

@media print {
    body {
        background: white !important;
        color: black !important;
    }
    .background-effects, .navbar, .btn { display: none !important; }
    .glass-panel { 
        background: transparent !important; border: none !important; padding: 0 !important; box-shadow: none !important;
        color: black !important;
    }
    .form-control { border: 1px solid #ccc !important; color: black !important; background: white !important; }
    * { -webkit-print-color-adjust: exact !important; color-adjust: exact !important; }
    .text-gradient { background: none !important; color: black !important; -webkit-text-fill-color: black !important; }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 8rem;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .nav-links {
        display: none;
    }
    
    .lkpd-identity {
        grid-template-columns: 1fr;
    }
}
