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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2a 100%);
    color: #fff;
    overflow-x: hidden;
}

#app {
    position: relative;
    min-height: 100vh;
}

.header {
    text-align: center;
    padding: 2rem 1rem 1rem;
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(0, 255, 255, 0.2);
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, #00ffff, #ff00ff, #00ffff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient 3s ease infinite;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    color: #aaa;
    margin-bottom: 1rem;
    font-style: italic;
}

.preset-tag {
    display: inline-block;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: monospace;
    color: #00ffff;
}

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

#scene-container {
    width: 100%;
    height: 70vh;
    position: relative;
    border-bottom: 2px solid rgba(0, 255, 255, 0.2);
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 26, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 255, 255, 0.1);
    border-top-color: #00ffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-text {
    font-size: 1.2rem;
    color: #00ffff;
    animation: pulse 2s ease-in-out infinite;
}

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

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

.control-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    border-top: 2px solid rgba(0, 255, 255, 0.3);
    padding: 1.5rem;
    z-index: 100;
    max-height: 60vh;
    overflow-y: auto;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.panel-header h3 {
    font-size: 1.3rem;
    color: #00ffff;
}

.collapse-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00ffff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.collapse-btn:hover {
    background: rgba(0, 255, 255, 0.2);
}

.panel-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.control-group {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.control-group label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.label-text {
    color: #aaa;
    font-size: 0.9rem;
}

.value-display {
    color: #00ffff;
    font-weight: bold;
    font-family: monospace;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(0, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00ffff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00ffff;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

select {
    width: 100%;
    padding: 0.6rem;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
}

select option {
    background: #1a1a2a;
    color: #fff;
}

.view-controls {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.view-btn {
    flex: 1;
    min-width: 100px;
    padding: 0.8rem;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.view-btn:hover {
    background: rgba(0, 255, 255, 0.2);
}

.view-btn.active {
    background: rgba(0, 255, 255, 0.3);
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.action-buttons {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 150px;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(255, 0, 255, 0.2));
    border: 1px solid rgba(0, 255, 255, 0.4);
    color: #fff;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 255, 0.3);
}

.preset-gallery {
    grid-column: 1 / -1;
    margin-top: 1rem;
}

.preset-gallery h4 {
    color: #00ffff;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.8rem;
}

.preset-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.preset-card:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: #00ffff;
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 255, 255, 0.2);
}

.preset-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #fff;
}

.preset-params {
    font-size: 0.8rem;
    color: #888;
    font-family: monospace;
}

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

.footer p {
    margin: 0.5rem 0;
    color: #aaa;
}

.footer a {
    color: #00ffff;
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: #ff00ff;
}

.credits {
    font-size: 0.85rem;
    font-style: italic;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .title {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    #scene-container {
        height: 50vh;
    }

    .control-panel {
        max-height: 50vh;
    }

    .panel-content {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-btn {
        min-width: 100%;
    }

    .preset-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Scrollbar styling */
.control-panel::-webkit-scrollbar {
    width: 8px;
}

.control-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.control-panel::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.3);
    border-radius: 4px;
}

.control-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.5);
}