:root {
    --bg-dark: #000000;
    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    --accent-primary: #ffffff;
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.5);
    
    --ease-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    overflow-x: hidden;
    min-height: 100vh;
}

/* === Aurora Background === */
.aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: #050505;
}

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.b1 { width: 60vw; height: 60vw; background: #4f46e5; top: -10%; left: -10%; animation-delay: 0s; }
.b2 { width: 50vw; height: 50vw; background: #db2777; bottom: -10%; right: -10%; animation-delay: -5s; }
.b3 { width: 40vw; height: 40vw; background: #0891b2; top: 40%; left: 30%; animation-delay: -10s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* === Navigation === */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
}

.nav-github {
    color: var(--text-muted);
    transition: color 0.2s;
}
.nav-github:hover { color: var(--text-main); }

/* === Layout === */
.app-container {
    padding-top: 60px;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

/* Mobile First Layout (Default) */
.config-content {
    display: flex;
    flex-direction: column;
    padding: 24px;
    padding-bottom: 80px;
}

/* 1. Preview Zone (Mobile) */
.preview-zone {
    margin: 24px 0;
    display: flex;
    justify-content: center;
    /* In mobile HTML flow, it sits naturally between cards */
}

.preview-sticky-wrapper {
    /* No sticky on mobile by default */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.device-mockup {
    width: 220px;
    aspect-ratio: 1179/2556;
    background: #000;
    border-radius: 36px;
    border: 6px solid #1a1a1a;
    box-shadow: 
        0 0 0 1px #333,
        0 20px 40px -10px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.notch {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 20px;
    background: #000;
    border-radius: 14px;
    z-index: 10;
}

.screen-content {
    width: 100%;
    height: 100%;
    background: #050505;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen-content canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.empty-state {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.action-btn {
    background: var(--text-main);
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

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

/* 2. Config Zone */
.hero-text {
    margin-bottom: 32px;
    text-align: center;
}

.hero-text h1 {
    font-size: 2.5rem;
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(to right, #fff, rgba(255,255,255,0.5));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Cards */
.config-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(20px);
}

.card-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 600;
}

/* Mode Grid */
.mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.mode-item input { display: none; }

.mode-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-icon { font-size: 1.4rem; }
.mode-name { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); }

.mode-item input:checked + .mode-box {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}
.mode-item input:checked + .mode-box .mode-name { color: #fff; }

/* Inputs */
.input-group { margin-bottom: 16px; }
.input-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-main);
}
.sub-label { color: var(--text-muted); font-size: 0.8rem; }

.glass-input, .custom-select select {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    appearance: none;
    font-family: inherit;
}

.glass-input:focus, .custom-select select:focus {
    border-color: rgba(255, 255, 255, 0.3);
}

.custom-select { position: relative; }
.custom-select .chevron {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.5;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.hidden { display: none; }

/* Color Picker */
.color-picker-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.cp-wrapper {
    position: relative;
    height: 48px;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.cp-wrapper input {
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    opacity: 0;
    cursor: pointer;
}

.cp-preview {
    width: 100%; height: 100%;
    border-radius: 12px;
}

.presets-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.preset-pill {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.1);
    background: linear-gradient(135deg, var(--p-bg) 50%, var(--p-ac) 50%);
    cursor: pointer;
    transition: transform 0.2s;
}
.preset-pill:hover { transform: scale(1.1); }

/* Details/Guide */
.glass-details {
    background: var(--glass-bg);
    border-radius: 16px;
    overflow: hidden;
}

.glass-details summary {
    padding: 16px 24px;
    cursor: pointer;
    font-weight: 500;
    list-style: none;
    position: relative;
}
.glass-details summary::-webkit-details-marker { display: none; }
.glass-details summary::after {
    content: '+';
    position: absolute;
    right: 24px;
    opacity: 0.5;
}
.glass-details[open] summary::after { content: '-'; }

.guide-content {
    padding: 0 24px 24px;
    border-top: 1px solid var(--glass-border);
}

.guide-tabs {
    display: flex;
    gap: 12px;
    margin: 16px 0;
}

.guide-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}
.guide-tab.active {
    color: #fff;
    border-color: #fff;
}

.guide-body { display: none; font-size: 0.9rem; line-height: 1.6; color: rgba(255,255,255,0.8); }
.guide-body.active { display: block; }
.guide-body ol { padding-left: 20px; }
.guide-body li { margin-bottom: 8px; }

.simple-footer {
    margin-top: 48px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Resolution Tag */
.resolution-tag {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* === DESKTOP LAYOUT (Split View) === */
@media (min-width: 900px) {
    .config-content {
        padding: 40px;
        /* Push content to right side */
        margin-left: 50%;
        max-width: 50%;
    }

    .hero-text {
        text-align: left;
    }
    
    .hero-text h1 {
        font-size: 3.5rem;
    }

    /* Extract Preview to Left Column */
    .preview-zone {
        position: absolute;
        top: 60px; /* Below Nav */
        left: 0;
        width: 50%;
        height: calc(100vh - 60px);
        margin: 0;
        align-items: center;
    }

    .preview-sticky-wrapper {
        position: sticky;
        top: 40px; /* Relative to its container, but container is fixed height */
    }

    /* Larger Preview on Desktop */
    .device-mockup {
        width: 280px;
        border-width: 8px;
        border-radius: 44px;
    }
    
    .notch {
        width: 90px;
        height: 26px;
        top: 12px;
        border-radius: 20px;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .device-mockup { width: 180px; }
    .hero-text h1 { font-size: 2rem; }
}
