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

:root, [data-theme="dark"] {
    --bg-darkest: #050505;
    --bg-dark: #0a0a0a;
    --bg-stage: #0f0f11;
    --text-main: #f5f5f5;
    --text-muted: #888888;
    --accent: #e2e2e2;
    --accent-hover: #ffffff;
    --border-subtle: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.02);
    
    --transition: 0s;
}

[data-theme="light"] {
    --bg-darkest: #f5f2ee;
    --bg-dark: #ede9e4;
    --bg-stage: #ffffff;
    --text-main: #1c1917;
    --text-muted: #78736d;
    --accent: #111111;
    --accent-hover: #000000;
    --border-subtle: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-darkest);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    margin: 0;
    transition: none;
}

.studio-body {
    height: 100vh;
    overflow: hidden; /* No scrolling for the app itself */
}

.split-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}
.sidebar {
    width: 400px;
    background-color: var(--bg-dark);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-subtle);
    z-index: 10;
}

.sidebar-header {
    padding: 2rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tool-nav {
    display: flex;
    flex-direction: column;
    padding: 0 1.5rem 1rem;
    gap: 2px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 0.5rem;
}

.tool-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.tool-nav-item:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text-main);
}

.tool-nav-item.active {
    background: rgba(255,255,255,0.06);
    color: var(--text-main);
    font-weight: 500;
}


.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.logo svg {
    color: var(--text-main);
}

.controls-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.controls-content::-webkit-scrollbar {
    width: 4px;
}
.controls-content::-webkit-scrollbar-thumb {
    background-color: var(--border-subtle);
}

.page-title {
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
    color: var(--text-main);
}
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-group label, .color-item label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 500;
}

.minimal-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 300;
    padding: 0.5rem 0;
    width: 100%;
    transition: var(--transition);
}

.minimal-input:focus {
    outline: none;
    border-bottom-color: var(--accent);
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "↓";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.9rem;
}

.minimal-select {
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 300;
    padding: 0.5rem 1.5rem 0.5rem 0;
    width: 100%;
    cursor: pointer;
    transition: var(--transition);
}

.minimal-select:focus {
    outline: none;
    border-bottom-color: var(--accent);
}

.minimal-select option {
    background-color: var(--bg-dark);
    color: var(--text-main);
}

.color-split {
    display: flex;
    gap: 2rem;
}

.color-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.color-trigger-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.minimal-color {
    appearance: none;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    padding: 0;
    background: none;
    cursor: pointer;
}
.minimal-color::-webkit-color-swatch-wrapper {
    padding: 0;
}
.minimal-color::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

.color-hash {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}
.stage-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 380px;
    margin-top: 1rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: none;
}

.stage-actions.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.stage-actions-buttons {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.btn-clean {
    flex: 1;
    padding: 1rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 4px;
}

.primary-clean {
    background: var(--text-main);
    color: var(--bg-darkest);
    border: 1px solid var(--text-main);
}

.primary-clean:hover {
    background: transparent;
    color: var(--text-main);
}

.secondary-clean {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
}

.secondary-clean:hover {
    border-color: var(--text-main);
}
.stage {
    flex: 1;
    background-color: var(--bg-stage);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.stage-ambient {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vh;
    height: 60vh;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none;
}

.stage-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    z-index: 2;
}

.glass-qr-wrapper {
    background-color: var(--text-main); /* White canvas underlying the QR */
    padding: 20px;
    border-radius: 20px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: none;
}

.glass-qr-wrapper:hover {
    transform: translateY(-5px) scale(1.02);
}

.glass-qr-wrapper canvas {
    width: 100%;
    max-width: 340px; /* Slightly larger presentation size */
    height: auto;
    display: block;
    mix-blend-mode: normal; /* In case the aesthetic needs adjusting */
}

.stage-caption {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    font-weight: 300;
}

.drop-zone {
    width: 100%;
    max-width: 480px;
    min-height: 280px;
    border: 1.5px dashed var(--border-subtle);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 2rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

.drop-zone.has-files {
    min-height: auto;
    flex-direction: row;
    padding: 0.85rem 1.5rem;
    gap: 0.75rem;
    border-radius: 12px;
    justify-content: center;
}

.drop-zone.has-files .drop-icon {
    width: 18px;
    height: 18px;
}

.drop-zone.has-files p {
    font-size: 0.85rem;
    margin: 0;
}

.drop-zone.has-files span {
    display: none;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.02);
}

.drop-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    transition: var(--transition);
}

.drop-zone:hover .drop-icon,
.drop-zone.drag-over .drop-icon {
    color: var(--text-main);
    transform: translateY(-3px);
}

.drop-zone p {
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-muted);
}

.drop-zone span {
    font-size: 0.8rem;
    color: rgba(136,136,136,0.6);
}

.image-preview-wrapper {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    z-index: 2;
    width: 100%;
    max-width: 420px;
}

.image-preview-wrapper img {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.08);
    display: block;
    transition: none;
}

.image-preview-wrapper img:hover {
    transform: translateY(-4px) scale(1.01);
}

.image-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 300;
}

.quality-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: var(--transition);
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quality-slider {
    flex: 1;
    appearance: none;
    height: 2px;
    background: var(--border-subtle);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.quality-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.quality-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.quality-display {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
    min-width: 36px;
    text-align: right;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    max-width: 480px;
    max-height: 340px;
    overflow-y: auto;
    z-index: 2;
    padding-right: 4px;
}

.file-list::-webkit-scrollbar {
    width: 3px;
}

.file-list::-webkit-scrollbar-thumb {
    background-color: var(--border-subtle);
    border-radius: 2px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.file-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.file-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.file-item-name {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-size {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 300;
}

.file-item-remove,
.file-item-dl {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
    flex-shrink: 0;
}

.file-item-remove:hover,
.file-item-dl:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
}

.count-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 300;
}


@media (max-width: 900px) {
    .studio-body {
        overflow: auto;
        height: auto;
        min-height: 100vh;
    }
    .split-layout {
        flex-direction: column;
        display: flex;
        height: auto;
        min-height: 100vh;
    }
    .sidebar {
        display: contents;
    }
    .sidebar-header {
        order: 1;
        background-color: var(--bg-darkest);
        padding: 1.5rem 5%;
        border-bottom: 1px solid var(--border-subtle);
    }
    .tool-nav {
        order: 2;
        padding: 1rem 5%;
    }
    .stage {
        order: 3;
        position: relative;
        z-index: 10;
        padding: 2rem 5%;
        min-height: auto;
        background: var(--bg-stage);
        border-bottom: 1px solid var(--border-subtle);
    }
    .controls-content {
        order: 4;
        background-color: var(--bg-darkest);
        padding: 2rem 5% 4rem;
        overflow: visible;
        flex: 1;
    }
    .color-split {
        flex-direction: column;
        gap: 1.5rem;
    }
    .stage-actions {
        position: relative;
        transform: translateY(0);
        opacity: 0; /* Hidden until file/upload ready */
        pointer-events: none;
        width: 100%;
        max-width: 100%;
        margin-top: 2rem;
    }
    .stage-actions.visible {
        opacity: 1;
        pointer-events: auto;
    }
    .drop-zone {
        max-width: 100%;
    }
    .image-preview-wrapper {
        max-width: 100%;
    }
}
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.5rem 5%; border-bottom: 1px solid var(--border-subtle);
}
.navbar nav { display: flex; gap: 1.5rem; }
.navbar nav a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem;}
.navbar nav a:hover { color: var(--text-main); }
.hero { padding: 8rem 5% 4rem; text-align: center; }
.hero-content h1 { font-size: 4rem; font-weight: 300; letter-spacing: -1.5px; margin-bottom: 1rem;}
.hero-content h1 span { font-weight: 600; }
.hero-content p { color: var(--text-muted); font-size: 1.25rem; max-width: 600px; margin: 0 auto 3rem; font-weight: 300; }
.btn { display: inline-flex; padding: 1rem 2rem; border-radius: 4px; text-decoration: none; letter-spacing: 0.5px; font-weight: 500; font-size:0.9rem; text-transform: uppercase;}
.btn.primary { background: white; color: black; transition: var(--transition);}
.btn.primary:hover { opacity: 0.8;}
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1px; background: var(--border-subtle); border: 1px solid var(--border-subtle); max-width: 1000px; margin: 4rem auto; }
.tool-card { background: var(--bg-darkest); padding: 3rem 2rem; text-decoration: none; color: white; display: flex; flex-direction: column; gap: 1.5rem; transition: var(--transition);}
.tool-card:hover { background: var(--bg-dark); }
.tool-icon { color: white; }
.tool-icon svg { width: 32px; height: 32px; stroke-width: 1.5; }
.tool-card h3 { font-weight: 400; font-size: 1.25rem; }
.tool-card p { color: var(--text-muted); font-weight: 300; line-height: 1.8;}
.tool-card.disabled { opacity: 0.4; pointer-events: none;}
