:root {
    --bg-main: #090a0f;
    --bg-surface: #12141c;
    --bg-surface-elevated: #1a1d29;
    --accent: #2f69ff;
    --accent-glow: rgba(47, 105, 255, 0.12);
    --text-primary: #f3f4f6;
    --text-muted: #878c9e;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.15);
    --radius-lg: 24px;
    --radius-md: 14px;
    --font-premium: 'Plus Jakarta Sans', sans-serif;
    --transition-theme: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease;
    --success: #10b981;
    --success-hover: #059669;
    --warning: #f59e0b;
}

[data-theme="light"] {
    --bg-main: #f6f8fa;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f3f7;
    --accent: #1565ff;
    --accent-glow: rgba(21, 101, 255, 0.08);
    --text-primary: #0f1115;
    --text-muted: #626775;
    --border-color: rgba(15, 17, 21, 0.08);
    --border-hover: rgba(15, 17, 21, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-premium);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: var(--transition-theme);
}

/* PREMIUM NAVBAR */
.navbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 4rem;
    height: 90px;
    background: rgba(255, 255, 255, 0.01);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition-theme);
}

.nav-left { grid-column: 1; }

.logo {
    grid-column: 2;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.logo span {
    color: var(--accent);
}

.nav-right {
    grid-column: 3;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--accent);
}

/* THEME TOGGLE */
.theme-toggle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), var(--transition-theme);
}

.theme-toggle:hover {
    transform: scale(1.05);
    border-color: var(--border-hover);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* APP CONTAINER */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 100px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 2.5rem;
    transition: var(--transition-theme);
}

.privacy-badge svg { color: var(--accent); }

/* LAYOUT FOR PROJECT 02 */
.tool-core {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    margin-bottom: 4rem;
}

@media (max-width: 768px) {
    .tool-core { grid-template-columns: 1fr; }
}

/* DROP ZONE */
.drop-zone {
    background-color: var(--bg-surface);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    position: relative;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: background-color 0.3s, border-color 0.3s, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.drop-zone:hover { border-color: var(--border-hover); }

.drop-zone.dragover {
    border-color: var(--accent);
    background-color: var(--accent-glow);
    transform: scale(0.99);
}

.zone-prompt { pointer-events: none; display: flex; flex-direction: column; align-items: center; }

.visual-anchor {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.zone-prompt h2 { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.3px; margin-bottom: 0.5rem; }
.zone-prompt p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; }

.formats-pill {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 0.4rem 1rem;
    border-radius: 100px;
}

/* BATCH GRID */
.preview-wrapper { display: none; width: 100%; height: 100%; align-items: center; justify-content: center; }
.batch-grid { display: grid; gap: 0.5rem; width: 100%; max-height: 320px; overflow-y: auto; padding-right: 0.5rem; }
.batch-grid.grid-1 { grid-template-columns: 1fr; height: 100%; }
.batch-grid.grid-2 { grid-template-columns: 1fr 1fr; align-items: center; }
.batch-grid.grid-many { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

.batch-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.batch-grid.grid-1 .batch-item { max-height: 300px; border: none; }
.batch-grid.grid-2 .batch-item { aspect-ratio: 1; }
.batch-grid.grid-many .batch-item { aspect-ratio: 1; }
.batch-item img { max-width: 100%; max-height: 100%; object-fit: contain; }

.clear-asset-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 50;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(9, 10, 15, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 0.85rem;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: background-color 0.2s, transform 0.2s;
}
.clear-asset-btn:hover { background: var(--danger); border-color: var(--danger); transform: scale(1.08); }

/* CONTROL PANEL */
.control-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: var(--transition-theme);
}

.control-header { margin-bottom: 0.75rem; display: flex; justify-content: space-between; align-items: center; }
.control-header label { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); }

.premium-dropdown {
    width: 100%;
    padding: 1rem;
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition-theme);
}
.premium-dropdown:focus { border-color: var(--accent); }

.metrics-badge {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-surface-elevated);
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.slider-container { display: flex; align-items: center; width: 100%; }
input[type="range"] { -webkit-appearance: none; width: 100%; height: 6px; border-radius: 100px; background: var(--bg-surface-elevated); outline: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--text-primary); border: 2px solid var(--accent); box-shadow: 0 0 15px rgba(47, 105, 255, 0.3); }

/* RESULTS DASHBOARD */
.results-dashboard {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
}
.metric-card { display: flex; flex-direction: column; gap: 0.2rem; }
.metric-lbl { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600; }
.metric-val { font-size: 0.95rem; font-weight: 700; }
.metric-arrow { color: var(--text-muted); font-weight: 500; }
.metric-card.highlight .metric-val { color: var(--accent); }

.savings-pill { font-size: 0.8rem; font-weight: 700; background: var(--success); color: white; padding: 0.4rem 0.8rem; border-radius: 6px; }
.savings-pill.expanded { background-color: var(--warning); }

/* BUTTONS */
.action-row { display: flex; flex-direction: column; gap: 0.75rem; margin-top: auto; }
.btn-primary, .btn-secondary, .btn-success {
    width: 100%;
    font-family: var(--font-premium);
    font-size: 0.95rem;
    font-weight: 600;
    height: 54px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover:not(:disabled) { background: #447aff; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: var(--success-hover); }

.btn-secondary { background: var(--bg-surface-elevated); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.02); border-color: var(--border-hover); }

/* INFO DECK */
.info-deck { width: 100%; max-width: 900px; margin-top: 2rem; }
.deck-divider { border: none; height: 1px; background: var(--border-color); margin-bottom: 4rem; }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; text-align: left; }
.info-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 2.5rem; display: flex; flex-direction: column; gap: 1rem; transition: var(--transition-theme); }
.info-card.wide { grid-column: span 2; }
.info-card.highlight-box { border-color: var(--accent); background: linear-gradient(180deg, var(--bg-surface) 0%, var(--accent-glow) 100%); }

.info-badge { align-self: flex-start; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--accent); background: var(--accent-glow); padding: 0.3rem 0.8rem; border-radius: 6px; }
.info-card h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.4px; }
.info-card p { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; }

/* FOOTER */
footer { padding: 3rem 2rem; border-top: 1px solid var(--border-color); margin-top: 5rem; text-align: center; transition: var(--transition-theme); width: 100%; }
footer p { font-size: 0.8rem; color: var(--text-muted); }

/* GLOBAL DRAG OVERLAY */
.global-drag-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(9, 10, 15, 0.85); backdrop-filter: blur(12px); z-index: 5000; display: none; align-items: center; justify-content: center; pointer-events: none; animation: fadeIn 0.2s ease forwards; }
[data-theme="light"] .global-drag-overlay { background: rgba(246, 248, 250, 0.85); }
.global-drag-overlay.active { display: flex; }
.overlay-message { border: 2px dashed var(--accent); padding: 3rem 5rem; border-radius: var(--radius-lg); background: var(--bg-surface); box-shadow: 0 20px 50px rgba(0,0,0,0.3); }
.overlay-message h2 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* MOBILE RESPONSIVE SIZING */
@media (max-width: 600px) {
    .navbar { padding: 0 2rem; }
    .nav-link { display: none; }
    .info-grid { grid-template-columns: 1fr; }
    .info-card.wide { grid-column: span 1; }
    
    .action-row { gap: 1rem; }
    .btn-primary, .btn-secondary, .btn-success { height: auto; padding: 1.25rem 1rem; font-size: 1.1rem; min-height: 56px; }
    input[type="range"]::-webkit-slider-thumb { transform: scale(1.3); }
    
    .results-dashboard { padding: 0.75rem; gap: 0.25rem; }
    .metric-val { font-size: 0.85rem; }
    .metric-lbl { font-size: 0.65rem; }
    .savings-pill { font-size: 0.75rem; padding: 0.3rem 0.5rem; text-align: center; line-height: 1.2; }
}
/* ADD THIS TO THE BOTTOM OF YOUR PROJECT 02 CSS */

/* WebAssembly Engine Loading Screen */
.engine-loader { text-align: center; padding: 4rem; background: var(--bg-surface); border-radius: var(--radius-lg); border: 1px solid var(--border-color); width: 100%; max-width: 600px; margin: 4rem auto; }
.engine-loader h2 { color: var(--accent); margin-bottom: 0.5rem; }
.engine-loader p { color: var(--text-muted); font-size: 0.9rem; }

/* FFmpeg Processing Progress Bar */
.progress-container { display: flex; flex-direction: column; gap: 0.5rem; }
.progress-bar-bg { width: 100%; height: 8px; background: var(--bg-surface-elevated); border-radius: 100px; overflow: hidden; }
.progress-bar-fill { height: 100%; width: 0%; background: var(--accent); transition: width 0.2s linear; box-shadow: 0 0 10px var(--accent-glow); }