: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;
}

[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;
    -webkit-user-select: none;
    user-select: none;
}

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);
}

/* 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);
}

.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; }
}

/* NAVBAR */
.navbar {
    display: flex;
    align-items: center;
    justify-content: 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);
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.logo span {
    color: var(--accent);
}

/* THEME TOGGLE BUTTON */
.theme-toggle {
    position: fixed;
    top: 22px;
    right: 2rem;
    z-index: 2000;
    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 LAYOUT HOLDER */
.app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.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);
}

.tool-core {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 5rem;
}

/* ADAPTIVE WORKSPACE BOX */
.drop-zone {
    width: 100%;
    min-height: 380px;
    background: var(--bg-surface);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: background-color 0.3s, border-color 0.3s, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.drop-zone.populated {
    cursor: default;
}

.drop-zone:not(.populated):hover {
    border-color: var(--border-hover);
}

.drop-zone.drag-over {
    border-color: var(--accent);
    background-color: var(--accent-glow);
    transform: scale(0.99);
}

/* FLOATING REMOVE ASSET BUTTON */
.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;
    font-weight: 700;
    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: #ef4444;
    border-color: #ef4444;
    transform: scale(1.08);
}

.zone-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem;
    pointer-events: none;
}

.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;
}

.preview-wrapper {
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
}

#previewImage {
    width: 100%;
    height: auto;
    max-height: 70vh;
    display: block;
    object-fit: contain;
}

/* CONTROL TERMINAL INTERFACE */
.control-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: var(--transition-theme);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.control-header label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.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 {
    position: relative;
    display: flex;
    align-items: center;
}

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);
}

/* METRICS PERFORMANCE OUTPUT MODULE */
.results-dashboard {
    display: none;
    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: 1.05rem;
    font-weight: 700;
}

.metric-arrow {
    color: var(--text-muted);
    font-weight: 500;
}

.savings-pill {
    font-size: 0.8rem;
    font-weight: 700;
    background: #10b981;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

/* BUTTONS */
.action-row {
    display: flex;
    gap: 1rem;
}

button, .btn-secondary {
    flex: 1;
    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 {
    background: #447aff;
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    display: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--border-hover);
}

/* PREMIUM INFO SECTION 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-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;
}

.info-card.highlight-box {
    border-color: var(--accent);
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--accent-glow) 100%);
}

/* FIXED PRESET SHORTCUT BUTTON - COMPACT SIZING */
.suggestion-tag-btn {
    margin-top: 1.5rem; /* Pushes to bottom cleanly */
    align-self: flex-start; /* Stops it from stretching the entire width */
    font-family: var(--font-premium);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-surface-elevated);
    padding: 0.65rem 1.25rem;
    border-radius: 100px; /* Gives it a sleek pill look */
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, transform 0.15s;
}

.suggestion-tag-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.suggestion-tag-btn:active {
    transform: translateY(1px);
}

/* FOOTER */
footer {
    padding: 3rem 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: 5rem;
    text-align: center;
    transition: var(--transition-theme);
}

footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

@media(max-width: 768px) {
    .navbar { padding: 0 2rem; }
    .theme-toggle { right: 1rem; }
    .action-row { flex-direction: column; }
    .info-grid { grid-template-columns: 1fr; }
    .info-card.wide { grid-column: span 1; }
}