/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --secondary-gradient: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1e1e1e;
    --border-color: #2a2a2a;
    --border-hover: #404040;
    --text-primary: #f5f5f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-orange: #f59e0b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    letter-spacing: -0.01em;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.settings-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
}

.settings-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.settings-content {
    position: absolute;
    top: 54px;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 300px;
    padding: 24px;
    display: none;
    backdrop-filter: blur(24px);
    box-shadow: var(--shadow-xl);
}

.settings-content.active {
    display: block;
}

.settings-content h3 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: -0.01em;
}

.setting-group input,
.setting-group select {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.setting-group input:focus,
.setting-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

/* Top Bar */
.top-bar {
    background: rgba(20, 20, 20, 0.95);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(24px);
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.logo i {
    color: var(--accent-blue);
    font-size: 24px;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.3));
}

.main-nav {
    display: flex;
    gap: 2px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    position: relative;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.nav-item.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    padding: 1px;
    background: var(--primary-gradient);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: transparent;
    border: 1px solid #333;
    color: #999;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #555;
    color: #e5e5e5;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Left Sidebar */
.left-sidebar {
    width: 340px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
}

.feature-panel {
    display: none;
}

.feature-panel.active {
    display: block;
}

.feature-tabs {
    display: flex;
    gap: 3px;
    margin-bottom: 32px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 6px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    flex: 1;
    text-align: center;
    letter-spacing: -0.01em;
    position: relative;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #6366f1;
}

.feature-content {
    display: none;
}

.feature-content.active {
    display: block;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

/* Toggle Switch Styling */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-input {
    display: none;
}

.toggle-label {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked + .toggle-label {
    background: var(--primary-gradient);
    border-color: #6366f1;
}

.toggle-input:checked + .toggle-label .toggle-slider {
    transform: translateX(24px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.toggle-label:hover {
    transform: scale(1.05);
}

.form-group input[type="checkbox"]:not(.toggle-input) {
    width: auto;
    margin: 0;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.upload-area {
    margin-bottom: 24px;
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-zone:hover {
    border-color: var(--accent-blue);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.upload-zone:hover::before {
    opacity: 1;
}

.upload-zone i {
    font-size: 40px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: block;
    transition: all 0.3s ease;
}

.upload-zone:hover i {
    color: var(--accent-blue);
    transform: scale(1.1);
}

.upload-zone p {
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 16px;
    letter-spacing: -0.01em;
}

.upload-zone small {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.4;
}

.generate-btn {
    width: 100%;
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-xl);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 32px;
    position: relative;
    overflow: hidden;
    letter-spacing: -0.01em;
    min-height: 52px;
    box-shadow: var(--shadow-md);
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.generate-btn:hover {
    background: linear-gradient(135deg, #5b5ffc, #9333ea);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.generate-btn:hover::before {
    left: 100%;
}

.generate-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-lg);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

/* Viewport Container */
.viewport-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    position: relative;
}

.viewport-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(20px);
}

.viewport-info {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.separator {
    opacity: 0.3;
    font-weight: 300;
}

.viewport {
    flex: 1;
    background: radial-gradient(ellipse at center, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.viewport::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(59, 130, 246, 0.02) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(1deg); }
}

.viewport-placeholder {
    text-align: center;
    color: var(--text-muted);
    z-index: 1;
    position: relative;
}

.viewport-placeholder i {
    font-size: 80px;
    margin-bottom: 24px;
    display: block;
    opacity: 0.3;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.1));
}

.viewport-placeholder h3 {
    margin-bottom: 12px;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.viewport-placeholder p {
    font-size: 16px;
    opacity: 0.6;
    line-height: 1.5;
}

/* Right Sidebar */
.right-sidebar {
    width: 300px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
}

.task-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.task-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.task-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.task-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.task-item.completed::before {
    background: var(--accent-green);
}

.task-item.processing::before {
    background: var(--accent-orange);
}

.task-item.queued::before {
    background: var(--text-muted);
}

.task-item.completed {
    border-color: rgba(16, 185, 129, 0.2);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.task-item.processing {
    border-color: rgba(245, 158, 11, 0.2);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(245, 158, 11, 0.05) 100%);
}

.task-item.queued {
    border-color: var(--border-color);
}

.task-preview {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.task-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.task-status {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.completed .task-status {
    background: #059669;
    color: white;
}

.processing .task-status {
    background: #f59e0b;
    color: white;
}

.queued .task-status {
    background: #6b7280;
    color: white;
}

.task-info {
    flex: 1;
}

.task-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.task-info p {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.task-time {
    font-size: 11px;
    color: #666;
}

.task-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-actions .action-btn {
    width: 24px;
    height: 24px;
    font-size: 10px;
    border-radius: 4px;
}

.clear-btn {
    background: transparent;
    border: none;
    color: #666;
    padding: 4px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.clear-btn:hover {
    color: #e5e5e5;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    background: #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.loading-spinner::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #666;
    border-top: 2px solid #f59e0b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Bottom Bar */
.bottom-bar {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(24px);
    flex-shrink: 0;
    position: relative;
    z-index: 50;
}

.scene-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.control-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.control-btn.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.scene-controls .separator {
    width: 1px;
    height: 20px;
    background: #333;
    margin: 0 8px;
}

.render-modes {
    display: flex;
    gap: 4px;
}

.mode-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.mode-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.mode-btn.active {
    background: var(--secondary-gradient);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.status-info {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-info::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .left-sidebar {
        width: 280px;
    }
    
    .right-sidebar {
        width: 240px;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    
    .left-sidebar,
    .right-sidebar {
        position: absolute;
        top: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .left-sidebar.active,
    .right-sidebar.active {
        transform: translateX(0);
    }
    
    .right-sidebar {
        right: 0;
        transform: translateX(100%);
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
} 