/* ====================================
   RESET & BASE
   ==================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ====================================
   CANVAS THREE.JS
   ==================================== */
#three-canvas {
    display: block;
    width: 100vw;
    height: 100vh;
    cursor: grab;
}

#three-canvas:active {
    cursor: grabbing;
}

/* ====================================
   UI OVERLAY
   ==================================== */
#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

#ui-overlay > * {
    pointer-events: auto;
}

/* ====================================
   HEADER
   ==================================== */
#header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo h1 {
    color: white;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 2px;
}

nav {
    display: flex;
    gap: 15px;
}

/* ====================================
   BUTTONS
   ==================================== */
button {
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

button.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

button.primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    font-size: 18px;
}

/* ====================================
   PANELS
   ==================================== */
.panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.9);
}

.panel h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 28px;
}

.panel p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.panel ul {
    list-style: none;
    margin: 20px 0;
}

.panel ul li {
    padding: 10px 0;
    color: #555;
    border-bottom: 1px solid #eee;
}

.stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin-top: 20px;
}

/* ====================================
   FORM
   ==================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

#form-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

#form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ====================================
   LOADING SCREEN
   ==================================== */
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#loading-screen p {
    color: white;
    margin-top: 20px;
    font-size: 18px;
}

/* ====================================
   RESPONSIVE
   ==================================== */
@media (max-width: 768px) {
    #header {
        padding: 15px 20px;
    }

    .logo h1 {
        font-size: 18px;
    }

    button {
        padding: 8px 15px;
        font-size: 12px;
    }

    .panel {
        padding: 30px 20px;
        max-width: 90%;
    }

    .panel h2 {
        font-size: 22px;
    }
}

/* ====================================
   UTILITIES
   ==================================== */
.hidden {
    display: none !important;
}
