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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f1a 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

.header {
    background: linear-gradient(90deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    padding: 2rem 0;
    border-bottom: 2px solid #00f5ff;
    box-shadow: 0 4px 20px rgba(0, 245, 255, 0.2);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding: 0 2rem;
}

.title {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(45deg, #00f5ff, #ff6b6b, #4ecdc4);
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
    text-shadow: 0 0 30px rgba(0, 245, 255, 0.5);
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

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

.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    min-height: calc(100vh - 300px);
}

.left-panel, .right-panel {
    background: rgba(22, 33, 62, 0.6);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid rgba(0, 245, 255, 0.3);
    backdrop-filter: blur(10px);
}

.controls-section h3,
.code-section h3,
.preview-section h3,
.examples-section h3 {
    color: #00f5ff;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #e0e0e0;
}

#modelSelect {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(0, 245, 255, 0.3);
    border-radius: 8px;
    background: rgba(26, 26, 46, 0.8);
    color: white;
    font-size: 1rem;
}

#modelSelect:focus {
    outline: none;
    border-color: #00f5ff;
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.3);
}

#promptInput {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid rgba(0, 245, 255, 0.3);
    border-radius: 8px;
    background: rgba(26, 26, 46, 0.8);
    color: white;
    font-size: 1rem;
    resize: vertical;
    font-family: inherit;
}

#promptInput:focus {
    outline: none;
    border-color: #00f5ff;
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.3);
}

.char-counter {
    text-align: right;
    font-size: 0.9rem;
    color: #999;
    margin-top: 0.5rem;
}

.preset-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.preset-btn {
    padding: 0.75rem;
    border: 2px solid rgba(0, 245, 255, 0.3);
    border-radius: 8px;
    background: rgba(26, 26, 46, 0.6);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.preset-btn:hover {
    border-color: #00f5ff;
    background: rgba(0, 245, 255, 0.1);
}

.preset-btn.active {
    background: linear-gradient(45deg, #00f5ff, #4ecdc4);
    color: #1a1a2e;
    font-weight: bold;
    border-color: #00f5ff;
}

.generate-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 107, 107, 0.4);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

.code-section {
    margin-top: 2rem;
}

.code-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.action-btn, .control-btn {
    padding: 0.5rem 1rem;
    background: rgba(0, 245, 255, 0.2);
    border: 1px solid #00f5ff;
    border-radius: 6px;
    color: #00f5ff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.action-btn:hover, .control-btn:hover {
    background: rgba(0, 245, 255, 0.3);
    transform: translateY(-1px);
}

.control-btn.active {
    background: #00f5ff;
    color: #1a1a2e;
}

.code-output {
    background: rgba(15, 15, 26, 0.9);
    border: 1px solid rgba(0, 245, 255, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    color: #e0e0e0;
}

.preview-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.scene-container {
    width: 100%;
    height: 400px;
    border: 2px solid rgba(0, 245, 255, 0.3);
    border-radius: 12px;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, rgba(0, 245, 255, 0.1) 0%, rgba(15, 15, 26, 0.9) 100%);
}

.examples-section {
    margin-top: 2rem;
}

.example-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.example-btn {
    padding: 0.75rem;
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid #ff6b6b;
    border-radius: 8px;
    color: #ff6b6b;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    text-align: center;
}

.example-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.footer {
    background: rgba(26, 26, 46, 0.8);
    text-align: center;
    padding: 2rem;
    border-top: 1px solid rgba(0, 245, 255, 0.3);
    margin-top: 2rem;
}

.footer a {
    color: #00f5ff;
    text-decoration: none;
    font-weight: bold;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 0 1rem;
    }
    
    .left-panel, .right-panel {
        padding: 1.5rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .preset-buttons {
        grid-template-columns: 1fr;
    }
    
    .example-buttons {
        grid-template-columns: 1fr;
    }
    
    .scene-container {
        height: 300px;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(26, 26, 46, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #00f5ff, #4ecdc4);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #4ecdc4, #00f5ff);
}