/* =============================================
   GEODESIC EMOTION DOME - ENHANCED STYLESHEET
   ============================================= */

/* ============= DESIGN SYSTEM ============= */
:root {
    /* Color System */
    --primary-hue: 250;
    --primary: hsl(var(--primary-hue), 70%, 60%);
    --primary-dark: hsl(var(--primary-hue), 70%, 40%);
    --primary-light: hsl(var(--primary-hue), 70%, 80%);
    
    --secondary-hue: 280;
    --secondary: hsl(var(--secondary-hue), 60%, 55%);
    
    --accent: #00ffcc;
    --accent-glow: rgba(0, 255, 204, 0.3);
    
    /* Gradients */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --dark-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --glass-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    
    /* Dark Theme Colors */
    --bg-dark: #0a0e27;
    --bg-darker: #050714;
    --bg-darkest: #020308;
    --panel-bg: rgba(15, 20, 40, 0.95);
    --panel-glass: rgba(255, 255, 255, 0.03);
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    --text-accent: var(--accent);
    
    /* Borders & Shadows */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.4);
    
    /* Status Colors */
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --info: #4299e1;
    
    /* Emotion Category Colors */
    --joy-color: #FFD700;
    --joy-glow: rgba(255, 215, 0, 0.3);
    --love-color: #FF69B4;
    --love-glow: rgba(255, 105, 180, 0.3);
    --sadness-color: #4169E1;
    --sadness-glow: rgba(65, 105, 225, 0.3);
    --anger-color: #DC143C;
    --anger-glow: rgba(220, 20, 60, 0.3);
    --fear-color: #8B008B;
    --fear-glow: rgba(139, 0, 139, 0.3);
    --calm-color: #20B2AA;
    --calm-glow: rgba(32, 178, 170, 0.3);
    
    /* Spacing System */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Typography Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    
    /* Animation Timings */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Z-Index Scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-popover: 500;
    --z-tooltip: 600;
    --z-notification: 700;
    --z-top: 9999;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    position: relative;
    height: 100vh;
}

/* ============= LOADER SIMPLIFIED ============= */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

.loader-container.hidden {
    display: none;
}

.loader-content {
    text-align: center;
    position: relative;
}

.loader-sphere {
    width: 150px;
    height: 150px;
    margin: 0 auto 40px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-sphere-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: pulse-loader 2s infinite ease-in-out;
    box-shadow: 0 0 80px rgba(102, 126, 234, 0.8);
}

.loader-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 3px;
    margin-bottom: 10px;
    color: #fff;
    text-transform: uppercase;
}

.loader-subtext {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

@keyframes pulse-loader {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* ============= CANVAS ============= */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1a1e3a 0%, #0a0e27 100%);
    z-index: 1;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.welcome-modal {
    width: 90%;
    max-width: 600px;
    background: var(--panel-bg);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-slow);
    box-shadow: var(--shadow-xl),
                0 0 100px rgba(102, 126, 234, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modal-overlay.active .welcome-modal {
    transform: scale(1) translateY(0);
}

.welcome-header {
    padding: var(--space-2xl);
    background: var(--glass-gradient);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.welcome-header h1 {
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.welcome-header h1 i {
    font-size: var(--text-4xl);
}

.welcome-header p {
    color: var(--text-secondary);
    font-size: var(--text-lg);
    font-weight: 300;
}

.welcome-content {
    padding: var(--space-2xl);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--panel-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.feature-item:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary);
    transform: translateX(5px);
}

.feature-item i {
    font-size: var(--text-xl);
    color: var(--primary);
    width: 30px;
    text-align: center;
}

.feature-item span {
    color: var(--text-primary);
    font-size: var(--text-sm);
}

.btn-start {
    width: 100%;
    padding: var(--space-lg) var(--space-xl);
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-size: var(--text-lg);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-start::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;
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

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

/* ============= HEADER ============= */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(10, 14, 39, 0.9), transparent);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.logo i {
    font-size: 1.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-controls {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-icon.active {
    background: var(--primary-gradient);
    border-color: transparent;
}

/* ============= SIDE PANEL ============= */
.side-panel {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 320px;
    max-height: 80vh;
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    margin: 20px;
    padding: 25px;
    z-index: 50;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.panel-title i {
    color: #f56565;
}

.categories-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.emotion-category {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.emotion-category:hover {
    background: var(--hover-bg);
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.emotion-category.active {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.category-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.category-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.category-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.category-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.panel-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-normal);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* ============= INFO PANEL ============= */
.info-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 360px;
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0;
    z-index: 50;
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
    transition: all var(--transition-normal);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.info-panel.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.info-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-close {
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.info-body {
    padding: 20px;
}

.info-body > p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.info-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    text-align: center;
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stat-item i {
    font-size: 1.2rem;
    color: #667eea;
    margin-bottom: 8px;
    display: block;
}

.stat-item span {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 3px;
}

.stat-item label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.connections-section h4 {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.connections-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.connection-tag {
    padding: 6px 12px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.connection-tag:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

/* ============= CONTROLS OVERLAY ============= */
.controls-overlay {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 40;
}

.control-hint {
    padding: 10px 15px;
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.control-hint i {
    color: #667eea;
}

/* ============= MODAL ============= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i {
    color: #667eea;
}

.modal-body {
    padding: 25px;
}

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

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

.setting-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-gradient);
    border-radius: 50%;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.setting-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.setting-value {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 10px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    font-size: 0.85rem;
    color: #667eea;
    min-width: 50px;
    text-align: center;
}

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

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
    cursor: pointer;
}

/* ============= STATS DISPLAY ============= */
.stats-display {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 40;
}

.stat {
    padding: 15px;
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    min-width: 80px;
}

.stat i {
    font-size: 1.2rem;
    color: #667eea;
    margin-bottom: 8px;
    display: block;
}

.stat span {
    display: block;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 3px;
}

.stat label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============= RESPONSIVE ============= */
@media (max-width: 768px) {
    .side-panel {
        width: 280px;
        margin: 10px;
    }
    
    .info-panel {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
    }
    
    .controls-overlay {
        flex-direction: column;
        gap: 10px;
        bottom: 10px;
    }
    
    .stats-display {
        flex-direction: row;
        top: auto;
        bottom: 100px;
        right: 50%;
        transform: translateX(50%);
    }
    
    .modal-content {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 15px;
    }
    
    .logo span {
        display: none;
    }
    
    .side-panel {
        width: calc(100% - 20px);
        max-height: 50vh;
        top: auto;
        bottom: 10px;
        transform: none;
    }
}

/* ============= ANIMATIONS ============= */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

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

.floating {
    animation: float 3s ease-in-out infinite;
}

.pulsing {
    animation: pulse 2s ease-in-out infinite;
}

.rotating {
    animation: rotate 20s linear infinite;
}
