:root {
    --bg-main: #1e3a8a; /* Deep blue background from screenshot */
    --canvas-bg: #000000;
    --panel-bg: rgba(255, 255, 255, 0.15); /* Glassmorphism */
    --panel-border: rgba(255, 255, 255, 0.2);
    
    --text-main: #ffffff;
    --text-muted: #9ca3af;
    
    --color-blue: #2563eb;
    --color-blue-hover: #1d4ed8;
    --color-red: #ef4444;
    --color-red-hover: #dc2626;
    --color-green: #10b981;
    --color-green-hover: #059669;
    
    --radius-lg: 16px;
    --radius-md: 8px;
    --radius-sm: 6px;
}

body.theme-dark {
    /* If they toggle theme, make background darker */
    --bg-main: #0f172a;
    --panel-bg: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
}

svg {
    width: 20px;
    height: 20px;
}

.app-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 100dvh;
    padding-bottom: 80px; /* Space for filmstrip */
}

/* Canvas Area */
.viewer-container {
    background-color: var(--canvas-bg);
    border-radius: var(--radius-lg);
    aspect-ratio: 1; /* Make it square-ish like the screenshot */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

#empty-state {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 500;
}

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

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--color-blue);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    padding: 1rem;
    z-index: 10;
}
.nav-arrow.left { left: 0; }
.nav-arrow.right { right: 0; }

/* Controls Panel */
.controls-container {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.btn-upload {
    background-color: var(--color-blue);
    color: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.5);
    transition: background-color 0.2s;
}
.btn-upload:active {
    background-color: var(--color-blue-hover);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
}
.group-header .label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Inputs */
.custom-input {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 1rem;
    outline: none;
}
.custom-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}
.custom-input:focus {
    border-color: var(--color-blue);
}

/* Custom Sliders */
.custom-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    outline: none;
}
.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-blue);
    cursor: pointer;
    border: 2px solid white;
}

/* Buttons */
.btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.btn {
    border: none;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    color: white;
    transition: opacity 0.2s;
}
.btn:active { opacity: 0.8; }
.btn-red { background-color: var(--color-red); }
.btn-green { background-color: var(--color-green); }
.btn-blue { background-color: var(--color-blue); }

.btn-outline {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-outline.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
}

.w-100 { width: 100%; }
.mt-2 { margin-top: 0.5rem; }

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.red-dot { background-color: var(--color-red); }

/* Filmstrip Gallery */
.filmstrip {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    overflow-x: auto;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 100;
}

.filmstrip-item {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 2px solid transparent;
    cursor: pointer;
    overflow: hidden;
}
.filmstrip-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.filmstrip-item.active {
    border-color: var(--color-blue);
}

/* Floating Action Button */
.fab-theme {
    position: fixed;
    right: 1.5rem;
    bottom: calc(70px + 1.5rem);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--color-blue);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 50;
}
