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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #fef7f0 0%, #f3e7f0 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Confetti Animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #ff6b9d;
    animation: confetti-fall 3s linear infinite;
    z-index: -1;
}

.confetti:nth-child(1) { left: 10%; background: #ff6b9d; animation-delay: 0s; }
.confetti:nth-child(2) { left: 30%; background: #4ecdc4; animation-delay: 0.5s; }
.confetti:nth-child(3) { left: 50%; background: #45b7d1; animation-delay: 1s; }
.confetti:nth-child(4) { left: 70%; background: #f9ca24; animation-delay: 1.5s; }
.confetti:nth-child(5) { left: 90%; background: #6c5ce7; animation-delay: 2s; }

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Header */
.header {
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.title {
    font-family: 'Quicksand', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #ff6b9d, #4ecdc4, #45b7d1);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-gradient 3s ease-in-out infinite;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-top: 0.5rem;
}

@keyframes rainbow-gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Canvas Section */
.canvas-section {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 107, 157, 0.2);
}

#canvas {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.canvas-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Editor Section */
.editor-section {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(78, 205, 196, 0.2);
}

.editor-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.preset-select {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    background: white;
}

.editor-container {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    font-family: 'Fira Code', monospace;
    background: #1e1e1e;
    display: flex;
}

.line-numbers {
    background: #2d2d2d;
    color: #858585;
    padding: 1rem 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: right;
    user-select: none;
    white-space: pre;
    min-width: 40px;
}

.shader-editor {
    flex: 1;
    background: #1e1e1e;
    color: #d4d4d4;
    border: none;
    padding: 1rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    resize: none;
    height: 300px;
    outline: none;
}

.error-display {
    background: #ffebee;
    color: #c62828;
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    display: none;
}

/* Controls Panel */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-section {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(69, 183, 209, 0.2);
}

.control-section h3 {
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

/* Controls */
.control-btn {
    background: linear-gradient(45deg, #ff6b9d, #4ecdc4);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.3);
}

/* Color Controls */
.color-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.color-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-input-group label {
    font-weight: 500;
    min-width: 70px;
}

input[type="color"] {
    width: 40px;
    height: 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Parameter Controls */
.param-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.param-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.param-group label {
    font-weight: 500;
    min-width: 60px;
}

input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b9d, #4ecdc4);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.param-value {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    min-width: 40px;
    text-align: right;
}

/* Info Display */
.info-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
}

/* Export Controls */
.export-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .controls-panel {
        grid-row: 2;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .canvas-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .editor-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .param-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }
    
    .color-input-group {
        justify-content: space-between;
    }
}

/* Syntax Highlighting Simulation */
.shader-editor {
    tab-size: 2;
}

/* Fullscreen styles */
#canvas:fullscreen {
    object-fit: contain;
    background: black;
}

/* Additional animations */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 107, 157, 0.3); }
    50% { box-shadow: 0 0 30px rgba(78, 205, 196, 0.5); }
}

.control-section:hover {
    animation: glow 2s ease-in-out infinite;
}