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

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

body {
    background: #0a0a0a;
    font-family: 'Inter', sans-serif;
    color: #ffffff;
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
}

.canvas-container {
    flex: 1;
    position: relative;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
}

#scene-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#camera {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 160px;
    height: 120px;
    border-radius: 8px;
    border: 2px solid #00ff88;
    opacity: 0.8;
    z-index: 100;
}

#output_canvas {
    display: none;
}

#fps-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: #00ff88;
    z-index: 100;
}

#status-indicator {
    position: absolute;
    top: 50px;
    right: 10px;
    font-size: 20px;
    z-index: 100;
}

.status-good { color: #00ff88; }
.status-warning { color: #ffaa00; }
.status-error { color: #ff0044; }

.control-panel {
    width: 350px;
    background: rgba(10, 10, 20, 0.9);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #00ff88 transparent;
}

.control-panel::-webkit-scrollbar {
    width: 6px;
}

.control-panel::-webkit-scrollbar-track {
    background: transparent;
}

.control-panel::-webkit-scrollbar-thumb {
    background: #00ff88;
    border-radius: 3px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    border-bottom: 2px solid #00ff88;
    padding-bottom: 15px;
}

.panel-header h1 {
    font-family: 'Orbitron', monospace;
    font-size: 24px;
    font-weight: 700;
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.header-controls {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: rgba(0, 255, 136, 0.2);
    border: 1px solid #00ff88;
    color: #00ff88;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(0, 255, 136, 0.4);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.control-section {
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    font-weight: 600;
    background: rgba(0, 255, 136, 0.1);
    transition: all 0.3s ease;
}

.section-header:hover {
    background: rgba(0, 255, 136, 0.2);
}

.section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 15px;
}

.control-section.active .section-content {
    max-height: 500px;
    padding: 15px;
}

.arrow {
    color: #00ff88;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #cccccc;
}

.control-group input[type="range"] {
    width: 70%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    margin-right: 10px;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #00ff88;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #00ff88;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.control-group .value {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: #00ff88;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    min-width: 40px;
    text-align: center;
}

.color-mode-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 15px;
}

.color-mode {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.color-mode:hover {
    background: rgba(255, 255, 255, 0.2);
}

.color-mode.active {
    background: #00ff88;
    color: #000000;
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.preset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.preset-btn {
    background: linear-gradient(135deg, #ff0066, #00aaff);
    border: none;
    color: #ffffff;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preset-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.3);
}

.preset-btn[data-preset="aurora"] {
    background: linear-gradient(135deg, #00ff88, #00aaff);
}

.preset-btn[data-preset="fire"] {
    background: linear-gradient(135deg, #ff4444, #ffaa00);
}

.preset-btn[data-preset="cosmic"] {
    background: linear-gradient(135deg, #aa00ff, #0066ff);
}

.preset-btn[data-preset="fairy"] {
    background: linear-gradient(135deg, #ffaaff, #aaffff);
}

.checkbox-group {
    margin-bottom: 15px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #cccccc;
}

.checkbox-group input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #00ff88;
    border-radius: 3px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-group input[type="checkbox"]:checked + .checkmark {
    background: #00ff88;
}

.checkbox-group input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000000;
    font-weight: bold;
    font-size: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    #app {
        flex-direction: column;
    }
    
    .control-panel {
        width: 100%;
        height: 40vh;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .canvas-container {
        height: 60vh;
    }
    
    #camera {
        width: 120px;
        height: 90px;
    }
    
    .color-mode-buttons,
    .preset-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}

/* Glow animations */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.3); }
    50% { box-shadow: 0 0 20px rgba(0, 255, 136, 0.6); }
}

.action-btn:active,
.preset-btn:active,
.color-mode.active {
    animation: glow 0.5s ease-in-out;
}

/* Scrolling improvements */
.control-panel {
    scroll-behavior: smooth;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #00ff88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}