@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Inter:wght@400;600&display=swap');

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

body {
    font-family: 'Inter', sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
}

#app-container {
    display: flex;
    height: 100vh;
    position: relative;
}

#scene-container {
    flex: 1;
    position: relative;
    background: #000;
}

#scene-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#control-panel {
    width: 380px;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    padding: 24px;
    overflow-y: auto;
    border-left: 2px solid rgba(255, 0, 255, 0.3);
}

header {
    margin-bottom: 32px;
}

.branding {
    font-size: 12px;
    color: #ff00ff;
    margin-bottom: 8px;
    font-weight: 600;
}

.title {
    font-family: 'Orbitron', monospace;
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(135deg, #1e3a8a, #7c3aed, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 14px;
    color: #888;
    font-weight: 400;
}

.control-section {
    margin-bottom: 32px;
}

.control-section h2 {
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ff00ff;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 0, 255, 0.3);
}

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

.control-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
}

.control-group label span {
    font-weight: 400;
}

.helper {
    display: block;
    font-size: 11px;
    color: #888;
    font-style: italic;
    margin-top: 4px;
}

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

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

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

input[type="range"]::-webkit-slider-runnable-track {
    background: linear-gradient(to right, #ff00ff 0%, rgba(255, 0, 255, 0.3) 100%);
    border-radius: 3px;
}

input[type="color"] {
    width: 100%;
    height: 40px;
    border: 2px solid rgba(255, 0, 255, 0.3);
    border-radius: 8px;
    background: #000;
    cursor: pointer;
}

button {
    font-family: 'Inter', sans-serif;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #ff00ff, #8b00ff);
    color: #fff;
    font-size: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 20px rgba(255, 0, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(255, 0, 255, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    width: 100%;
    padding: 12px;
    background: rgba(139, 0, 255, 0.2);
    color: #ff00ff;
    font-size: 14px;
    border-radius: 8px;
    border: 2px solid rgba(255, 0, 255, 0.3);
    margin-bottom: 12px;
}

.btn-secondary:hover {
    background: rgba(139, 0, 255, 0.3);
    border-color: #ff00ff;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-icon {
    flex: 1;
    min-width: 60px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-icon:hover {
    background: rgba(255, 0, 255, 0.2);
    border-color: #ff00ff;
}

.preset-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.preset-btn {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preset-btn:hover {
    background: rgba(255, 0, 255, 0.2);
    border-color: #ff00ff;
}

#stats-panel {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.8);
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    border: 1px solid rgba(255, 0, 255, 0.3);
    z-index: 10;
}

#stats-panel div {
    margin-bottom: 4px;
}

#stats-panel div:last-child {
    margin-bottom: 0;
}

#preset-modal,
#load-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #1a1a1a;
    padding: 32px;
    border-radius: 16px;
    border: 2px solid rgba(255, 0, 255, 0.3);
    min-width: 300px;
}

.modal-content h2 {
    font-family: 'Orbitron', monospace;
    color: #ff00ff;
    margin-bottom: 20px;
    text-align: center;
}

.modal-content input[type="text"] {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 0, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    margin-bottom: 16px;
}

.modal-content input[type="text"]:focus {
    outline: none;
    border-color: #ff00ff;
}

.modal-buttons {
    display: flex;
    gap: 8px;
}

.modal-buttons button {
    flex: 1;
}

#preset-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.preset-item {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.preset-load-btn {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.preset-load-btn:hover {
    background: rgba(255, 0, 255, 0.2);
    border-color: #ff00ff;
}

.preset-delete-btn {
    padding: 12px 16px;
    background: rgba(255, 0, 0, 0.2);
    color: #fff;
    border-radius: 8px;
    border: 1px solid rgba(255, 0, 0, 0.3);
}

.preset-delete-btn:hover {
    background: rgba(255, 0, 0, 0.4);
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-berry {
    font-size: 80px;
    animation: spin 2s linear infinite;
}

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

#loading-screen p {
    font-family: 'Orbitron', monospace;
    color: #ff00ff;
    margin-top: 20px;
    font-size: 18px;
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: calc(100% - 380px);
    text-align: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.8);
    font-size: 12px;
    color: #888;
}

footer p {
    margin: 4px 0;
}

footer a {
    color: #ff00ff;
    text-decoration: none;
}

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

footer .small {
    font-size: 10px;
}

/* Scrollbar styling */
#control-panel::-webkit-scrollbar,
#preset-list::-webkit-scrollbar {
    width: 8px;
}

#control-panel::-webkit-scrollbar-track,
#preset-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

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

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

/* Responsive design */
@media (max-width: 1024px) {
    #control-panel {
        width: 300px;
    }
    
    footer {
        width: calc(100% - 300px);
    }
}

@media (max-width: 768px) {
    #app-container {
        flex-direction: column;
    }
    
    #scene-container {
        height: 60vh;
    }
    
    #control-panel {
        width: 100%;
        height: 40vh;
        border-left: none;
        border-top: 2px solid rgba(255, 0, 255, 0.3);
    }
    
    footer {
        width: 100%;
        position: relative;
    }
    
    .preset-buttons {
        grid-template-columns: 1fr 1fr;
    }
}