:root {
    --bg-color: #0a0a0f;
    --panel-bg: rgba(20, 20, 25, 0.6);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --accent: #4d00ff;
    --accent-hover: #661aff;
    --radius: 16px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#workspace {
    position: absolute;
    top: 0;
    left: 0;
    right: 388px; /* Leave space for the UI panel */
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

#canvas-wrapper {
    position: relative;
    background: #000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    overflow: hidden;
    /* aspect-ratio will be set dynamically via JS */
}

#canvas-wrapper canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Glassmorphism Panel */
#ui-container {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 340px;
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    padding: 24px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

#ui-container::-webkit-scrollbar {
    width: 6px;
}
#ui-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.header p {
    font-size: 13px;
    color: var(--text-secondary);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.control-group label span {
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

select, input[type="number"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

select:focus, input[type="number"]:focus {
    border-color: var(--accent);
}

select option {
    background: #1a1a24;
    color: white;
}

/* Colors Container */
.colors-container {
    display: flex;
    gap: 12px;
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
    padding: 0;
    overflow: hidden;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

/* Range Sliders */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Buttons */
.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent), #ff0080);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    width: 100%;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(77, 0, 255, 0.4);
}

.primary-btn:hover {
    opacity: 0.9;
}

.primary-btn:active {
    transform: scale(0.98);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #333;
    box-shadow: none;
}

/* Progress */
.hidden {
    display: none !important;
}

#progress-container {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#progress-text {
    font-size: 13px;
    color: var(--text-primary);
    text-align: center;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

#progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ffcc, #4d00ff);
    transition: width 0.1s ease;
}
