/* style.css content here */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4f46e5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.8rem;
}

.header-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.anycoder-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.anycoder-link:hover {
    background: #6366f1;
    color: white;
}

.device-toggle {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
}

.device-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.device-btn.active {
    background: #4f46e5;
    color: white;
}

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

.canvas-container {
    position: relative;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

#threeCanvas {
    width: 100%;
    height: 600px;
    display: block;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.controls-panel {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-height: 600px;
    overflow-y: auto;
}

.panel-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.panel-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.panel-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ai-controls input {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.ai-controls input:focus {
    outline: none;
    border-color: #4f46e5;
}

.quick-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
}

.preset-btn {
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    border-color: #4f46e5;
    color: #4f46e5;
}

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

.control-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.5rem;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 0.25rem;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    border: none;
}

.camera-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.scene-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.scene-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.scene-controls input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.animation-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.animation-controls button {
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.primary-btn {
    background: #4f46e5;
    color: white;
    border: none;
    cursor: pointer;
}

.primary-btn:hover {
    background: #4338ca;
}

.primary-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.secondary-btn {
    background: white;
    color: #4f46e5;
    border: 2px solid #4f46e5;
    cursor: pointer;
}

.secondary-btn:hover {
    background: #4f46e5;
    color: white;
}

.animation-controls input[type="range"] {
    width: 100%;
}

.animation-controls span {
    font-size: 0.9rem;
    color: #64748b;
    text-align: center;
}

.error-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
}

.modal-content h3 {
    color: #dc2626;
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .controls-panel {
        max-height: none;
        order: -1;
    }
    
    #threeCanvas {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    
    .header-links {
        justify-content: center;
    }
    
    .main-content {
        padding: 0.5rem;
    }
    
    .controls-panel {
        padding: 1rem;
    }
    
    .quick-presets {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .camera-controls {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.2rem;
    }
    
    .logo-icon {
        font-size: 1.4rem;
    }
    
    .anycoder-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .device-toggle .device-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    #threeCanvas {
        height: 300px;
    }
    
    .quick-presets {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Custom scrollbar for controls panel */
.controls-panel::-webkit-scrollbar {
    width: 6px;
}

.controls-panel::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.controls-panel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.controls-panel::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animation for panel sections */
.panel-section {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover effects */
.canvas-container {
    transition: transform 0.3s ease;
}

.canvas-container:hover {
    transform: translateY(-2px);
}

.preset-btn {
    animation: fadeInUp 0.6s ease-out;
}

.preset-btn:nth-child(2) { animation-delay: 0.1s; }
.preset-btn:nth-child(3) { animation-delay: 0.2s; }
.preset-btn:nth-child(4) { animation-delay: 0.3s; }
.preset-btn:nth-child(5) { animation-delay: 0.4s; }