:root {
    --bg-color: #dfd1a1;
    --bg-dark: #b8a879;
    --text-primary: #1a1a1a;
    --text-secondary: #3b3b3b;
    --accent: #2c2c2c;
    --danger: #8a1f1f;
    --glass-bg: rgba(223, 209, 161, 0.4);
    --glass-border: rgba(26, 26, 26, 0.15);
    --font-main: 'Inter', sans-serif;
    --font-mono: 'Special Elite', monospace;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    padding: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
}

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.05) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 4px, 6px 100%;
    z-index: 999;
    pointer-events: none;
    opacity: 0.8;
}

.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, transparent 50%, rgba(30, 25, 0, 0.4) 120%);
    z-index: 998;
    pointer-events: none;
}

.container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
    margin-bottom: 1rem;
}

.glitch {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -2px;
    text-transform: uppercase;
    position: relative;
    text-shadow: 0.05em 0 0 rgba(255,0,0,0.75), -0.025em -0.05em 0 rgba(0,255,0,0.75), 0.025em 0.05em 0 rgba(0,0,255,0.75);
    animation: glitch 2s infinite;
}

@keyframes glitch {
    0% { text-shadow: 0.05em 0 0 rgba(255,0,0,0.75), -0.05em -0.025em 0 rgba(0,255,0,0.75), -0.025em 0.05em 0 rgba(0,0,255,0.75); }
    14% { text-shadow: 0.05em 0 0 rgba(255,0,0,0.75), -0.05em -0.025em 0 rgba(0,255,0,0.75), -0.025em 0.05em 0 rgba(0,0,255,0.75); }
    15% { text-shadow: -0.05em -0.025em 0 rgba(255,0,0,0.75), 0.025em 0.025em 0 rgba(0,255,0,0.75), -0.05em -0.05em 0 rgba(0,0,255,0.75); }
    49% { text-shadow: -0.05em -0.025em 0 rgba(255,0,0,0.75), 0.025em 0.025em 0 rgba(0,255,0,0.75), -0.05em -0.05em 0 rgba(0,0,255,0.75); }
    50% { text-shadow: 0.025em 0.05em 0 rgba(255,0,0,0.75), 0.05em 0 0 rgba(0,255,0,0.75), 0 -0.05em 0 rgba(0,0,255,0.75); }
    99% { text-shadow: 0.025em 0.05em 0 rgba(255,0,0,0.75), 0.05em 0 0 rgba(0,255,0,0.75), 0 -0.05em 0 rgba(0,0,255,0.75); }
    100% { text-shadow: -0.025em 0 0 rgba(255,0,0,0.75), -0.025em -0.025em 0 rgba(0,255,0,0.75), -0.025em -0.05em 0 rgba(0,0,255,0.75); }
}

.subtitle {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Panels */
.generator-panel, .workspace-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    animation: fadeIn 0.5s ease;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.workspace-panel {
    max-width: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none !important;
}

/* Upload Panel Styles */
.drop-zone {
    border: 2px dashed var(--text-secondary);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.1);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--text-primary);
    background: rgba(255,255,255,0.2);
}

.drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    pointer-events: none;
}

.drop-content h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.drop-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--glass-border);
}

.divider span {
    padding: 0 1rem;
}

.url-input-group {
    display: flex;
    gap: 1rem;
}

input[type="url"] {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    font-family: var(--font-main);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.3s ease;
}

input[type="url"]:focus {
    border-color: var(--text-primary);
}

/* Buttons */
.btn-primary {
    background: var(--text-primary);
    color: var(--bg-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-main);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    background: var(--accent);
    box-shadow: 0 0 15px rgba(26,26,26,0.3);
}

.btn-large {
    padding: 1rem 3rem;
    font-size: 1.1rem;
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-main);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-secondary:hover {
    background: rgba(26,26,26,0.1);
}

.btn-text {
    background: none;
    border: none;
    color: var(--danger);
    font-family: var(--font-mono);
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9rem;
}
.btn-text:hover {
    color: #a82a2a;
}

/* Workspace Styles */
.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    flex-wrap: wrap;
    gap: 1.5rem;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
}

.file-info .label {
    font-weight: 600;
    color: var(--text-secondary);
}

.file-info .value {
    font-family: var(--font-mono);
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 300px;
}

.control-group label {
    font-weight: 600;
    font-size: 0.95rem;
}

#intensity-val {
    font-family: var(--font-mono);
    color: var(--danger);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(26,26,26,0.2);
    border-radius: 3px;
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.side-by-side-layout {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 800px) {
    .side-by-side-layout {
        flex-direction: column;
    }
}

.canvas-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.canvas-wrapper h3 {
    font-family: var(--font-mono);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.canvas-box {
    width: 100%;
    aspect-ratio: 4/3;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Initially, Still Life Canvas might be empty, let's just make it look like a void */
#still-life-canvas {
    background: #111;
}

.workspace-footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--bg-color);
    font-family: var(--font-mono);
    gap: 1rem;
    z-index: 20;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(223, 209, 161, 0.3);
    border-top-color: var(--bg-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.canvas-caption {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--danger);
    text-align: center;
    margin-top: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.8;
}
