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

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

.header {
    background: linear-gradient(90deg, #0a0a0a 0%, #ff6b35 50%, #0a0a0a 100%);
    padding: 2rem 0;
    border-bottom: 2px solid #00d4ff;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
}

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

.title {
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(45deg, #ff6b35, #00d4ff, #ff6b35);
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: cinematicGlow 4s ease infinite;
    text-shadow: 0 0 40px rgba(255, 107, 53, 0.6);
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
    color: #e0e0e0;
}

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

.main-layout {
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    gap: 1.5rem;
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 2rem;
    min-height: calc(100vh - 250px);
}

.left-panel, .right-panel {
    background: rgba(22, 33, 62, 0.7);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid rgba(0, 212, 255, 0.4);
    backdrop-filter: blur(15px);
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.center-panel {
    background: rgba(10, 10, 10, 0.8);
    border-radius: 15px;
    border: 2px solid rgba(0, 212, 255, 0.3);
    overflow: hidden;
    position: relative;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
}

.workspace-header h3 {
    color: #00d4ff;
    font-size: 1.2rem;
    margin: 0;
}

.camera-controls {
    display: flex;
    gap: 0.5rem;
}

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

.camera-btn:hover {
    background: rgba(0, 212, 255, 0.3);
}

.camera-btn.active {
    background: #00d4ff;
    color: #0a0a0a;
    font-weight: bold;
}

.scene-container {
    width: 100%;
    height: calc(100vh - 450px);
    min-height: 400px;
    background: radial-gradient(circle at 50% 50%, rgba(0, 212, 255, 0.1) 0%, rgba(10, 10, 10, 0.9) 100%);
    position: relative;
}

.timeline-3d {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    border-top: 1px solid rgba(0, 212, 255, 0.3);
    padding: 1rem;
}

.timeline-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.play-btn {
    background: linear-gradient(45deg, #ff6b35, #00d4ff);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.play-btn:hover {
    transform: scale(1.1);
}

.time-display {
    color: #00d4ff;
    font-family: monospace;
    font-size: 1rem;
    min-width: 100px;
}

.time-slider {
    flex: 1;
    height: 6px;
    background: rgba(0, 212, 255, 0.3);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.time-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(45deg, #ff6b35, #00d4ff);
    border-radius: 50%;
    cursor: pointer;
}

.ai-section, .project-section, .inspector-section, .scene-hierarchy, .generation-history, .export-section {
    margin-bottom: 2rem;
}

.ai-section h3, .project-section h3, .inspector-section h3, .scene-hierarchy h3, .generation-history h3, .export-section h3 {
    color: #00d4ff;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

#aiModel, #exportFormat, #exportResolution {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 6px;
    background: rgba(10, 10, 26, 0.8);
    color: white;
    font-size: 0.9rem;
}

#elementPrompt {
    width: 100%;
    min-height: 80px;
    padding: 0.8rem;
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 6px;
    background: rgba(10, 10, 26, 0.8);
    color: white;
    font-size: 0.9rem;
    resize: vertical;
    font-family: inherit;
}

#elementPrompt:focus, #aiModel:focus, #exportFormat:focus, #exportResolution:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.element-types, .style-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

.type-btn, .style-btn {
    padding: 0.6rem;
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 6px;
    background: rgba(10, 10, 26, 0.6);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    text-align: center;
}

.type-btn:hover, .style-btn:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.15);
}

.type-btn.active, .style-btn.active {
    background: linear-gradient(45deg, #00d4ff, #ff6b35);
    color: #0a0a0a;
    font-weight: bold;
    border-color: #00d4ff;
}

.generate-btn, .export-btn {
    width: 100%;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(45deg, #ff6b35, #00d4ff);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

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

.loading-spinner {
    width: 16px;
    height: 16px;
    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); }
}

.upload-area {
    border: 2px dashed rgba(0, 212, 255, 0.5);
    border-radius: 8px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 212, 255, 0.05);
}

.upload-area:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
}

.upload-content .upload-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.upload-content p {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.upload-content small {
    color: #999;
    font-size: 0.8rem;
}

.media-library h4, .asset-collection h4 {
    color: #ff6b35;
    font-size: 0.9rem;
    margin: 1rem 0 0.5rem 0;
}

.media-items, .asset-items {
    max-height: 150px;
    overflow-y: auto;
}

.media-item, .asset-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
    border: 1px solid transparent;
}

.media-item:hover, .asset-item:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
}

.media-thumb, .asset-icon {
    font-size: 1.2rem;
    min-width: 24px;
}

.media-info, .asset-info {
    flex: 1;
    min-width: 0;
}

.media-name, .asset-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-duration, .asset-type {
    font-size: 0.75rem;
    color: #999;
}

.object-properties {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 1rem;
}

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

.property-group label {
    font-size: 0.85rem;
    color: #00d4ff;
    margin-bottom: 0.5rem;
}

.xyz-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.4rem;
}

.xyz-controls input, #opacity {
    padding: 0.4rem;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 4px;
    background: rgba(10, 10, 26, 0.8);
    color: white;
    font-size: 0.8rem;
}

.hierarchy-tree, .history-items {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 0.5rem;
}

.hierarchy-item, .history-item {
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.hierarchy-item:hover, .history-item:hover {
    background: rgba(0, 212, 255, 0.15);
}

.history-prompt {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.history-meta {
    font-size: 0.7rem;
    color: #999;
}

.export-controls {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

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

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

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

.berry-icon {
    display: inline-block;
    animation: spin 4s linear infinite;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .main-layout {
        grid-template-columns: 280px 1fr 280px;
        gap: 1rem;
    }
    
    .title {
        font-size: 3rem;
    }
}

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .left-panel, .right-panel {
        max-height: none;
    }
    
    .scene-container {
        height: 50vh;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .camera-controls {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .main-layout {
        padding: 0 1rem;
    }
    
    .left-panel, .right-panel {
        padding: 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .element-types, .style-presets {
        grid-template-columns: 1fr;
    }
    
    .xyz-controls {
        grid-template-columns: 1fr;
    }
    
    .timeline-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 10, 26, 0.5);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #00d4ff, #ff6b35);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #ff6b35, #00d4ff);
}

/* Animation for demo elements */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Smooth transitions for interactive elements */
button, input, select, textarea {
    transition: all 0.3s ease;
}

/* Glowing effect for active elements */
.scene-container:hover {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

/* Professional gradient overlays */
.left-panel::before, .right-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b35, #00d4ff, #ff6b35);
    border-radius: 15px 15px 0 0;
}

.left-panel, .right-panel {
    position: relative;
}