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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a1a;
    color: #ffffff;
    line-height: 1.6;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 1rem 2rem;
    border-bottom: 2px solid #333;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.app-title {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, #8B5CF6, #06B6D4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #cccccc;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.nav-tabs {
    display: flex;
    gap: 1rem;
}

.nav-tab {
    background: transparent;
    border: 2px solid #444;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-tab:hover {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.1);
}

.nav-tab.active {
    background: #8B5CF6;
    border-color: #8B5CF6;
}

.main-content {
    display: flex;
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    gap: 2rem;
    padding: 2rem;
}

.sidebar {
    width: 250px;
    background: #2d2d2d;
    border-radius: 12px;
    padding: 1.5rem;
    height: fit-content;
    border: 1px solid #444;
}

.control-group {
    margin-bottom: 2rem;
}

.control-group h3 {
    color: #8B5CF6;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.control-item {
    margin-bottom: 1rem;
}

.control-item label {
    display: block;
    margin-bottom: 0.5rem;
    color: #cccccc;
    font-size: 0.9rem;
}

.control-item select, .control-item input[type="range"] {
    width: 100%;
    padding: 0.5rem;
    background: #1a1a1a;
    border: 1px solid #555;
    border-radius: 6px;
    color: #ffffff;
}

.control-item input[type="range"] {
    height: 6px;
    background: #444;
    outline: none;
    -webkit-appearance: none;
}

.control-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #8B5CF6;
    border-radius: 50%;
    cursor: pointer;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(45deg, #8B5CF6, #06B6D4);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.canvas-controls {
    display: flex;
    gap: 1rem;
}

.control-btn {
    padding: 0.5rem 1rem;
    background: #2d2d2d;
    border: 1px solid #555;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.control-btn:hover {
    background: #3d3d3d;
}

#canvas {
    border: 3px solid #444;
    border-radius: 12px;
    background: #000;
    max-width: 100%;
    height: auto;
}

.warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 0.5rem;
    color: #ffc107;
    font-size: 0.9rem;
    text-align: center;
    max-width: 600px;
}

.info-panel {
    width: 250px;
    background: #2d2d2d;
    border-radius: 12px;
    padding: 1.5rem;
    height: fit-content;
    border: 1px solid #444;
}

.info-panel h3, .info-panel h4 {
    color: #06B6D4;
    margin-bottom: 1rem;
}

.effect-description, .science-corner {
    margin-bottom: 2rem;
}

.effect-description p, .science-corner p, .about-section p {
    color: #cccccc;
    font-size: 0.9rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.gallery-item {
    cursor: pointer;
    text-align: center;
    padding: 1rem;
    border: 1px solid #555;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.1);
}

.gallery-preview {
    width: 60px;
    height: 60px;
    margin: 0 auto 0.5rem;
    border-radius: 6px;
    background: linear-gradient(45deg, #ff6b6b, #8b0000);
}

.scintillating-preview {
    background: 
        radial-gradient(circle at 20% 20%, white 2px, transparent 2px),
        linear-gradient(45deg, #ff6b6b 25%, #8b0000 25%);
    background-size: 15px 15px;
}

.peripheral-preview {
    background: 
        conic-gradient(from 0deg, #ff6b6b, #8b0000, #ff6b6b);
}

.rotating-preview {
    background: 
        linear-gradient(45deg, #ff6b6b 50%, #8b0000 50%);
    background-size: 10px 10px;
}

.motion-preview {
    background: 
        linear-gradient(90deg, #ff6b6b, #8b0000, #ff6b6b, #8b0000);
    background-size: 20px 100%;
}

.gallery-item span {
    font-size: 0.8rem;
    color: #cccccc;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar, .info-panel {
        width: 100%;
    }
    
    .app-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
        gap: 1rem;
    }
    
    .header {
        padding: 1rem;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
    }
    
    .canvas-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Fullscreen styles */
canvas:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    object-fit: contain;
}

/* Animation for controls */
.control-item input:focus,
.control-item select:focus {
    border-color: #8B5CF6;
    outline: none;
}

/* Smooth transitions */
* {
    transition: border-color 0.3s ease;
}