/*
 * World Mood - Global Emotion Pulse
 * Main stylesheet
 * 
 * Author: [Your Name]
 * Created: November 2024
 * Last updated: November 2024
 * 
 * Color palette:
 * - Primary: #4ECDC4 (teal)
 * - Secondary: #FF6B6B (coral)
 * - Accent: #FFD93D (yellow)
 * - Background: #0a0a1a (dark blue)
 */

/* ============================================
   Reset & Base Styles
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 50%, #0a0a1a 100%);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ============================================
   Loading Screen
   ============================================ */

#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a1a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}

#loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #4ECDC4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { 
        transform: rotate(360deg); 
    }
}

#loading p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

/* ============================================
   Main App Container
   ============================================ */

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================
   Header
   ============================================ */

header {
    text-align: center;
    padding: 20px 0 10px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #4ECDC4, #FF6B6B, #FFD93D);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.tagline {
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
    font-size: 1.1rem;
    font-weight: 300;
}


/* ============================================
   Globe Container
   ============================================ */

#globe-container {
    width: 100%;
    height: 450px;
    position: relative;
    cursor: grab;
    /* border: 1px solid rgba(255,255,255,0.1); */ /* debug border */
}

#globe-container:active {
    cursor: grabbing;
}

/* ============================================
   Mood Selection Panel
   ============================================ */

#mood-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Safari support */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#mood-panel > p {
    margin-bottom: 18px;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

#mood-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Individual mood button */
.mood-btn {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mood-btn:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.mood-btn:active {
    transform: translateY(0);
}

.mood-btn.selected {
    border-color: #4ECDC4;
    box-shadow: 0 0 30px rgba(78, 205, 196, 0.4);
    background: rgba(78, 205, 196, 0.1);
}

/* Mood icons - using CSS shapes instead of emoji */
.mood-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    position: relative;
}

/* TODO: Consider using SVG icons for better quality */
.happy-icon { background: linear-gradient(135deg, #FFD93D, #F59E0B); }
.love-icon { background: linear-gradient(135deg, #FF6B6B, #EF4444); }
.sad-icon { background: linear-gradient(135deg, #4ECDC4, #06B6D4); }
.angry-icon { background: linear-gradient(135deg, #FF8C42, #EA580C); }
.anxious-icon { background: linear-gradient(135deg, #A855F7, #9333EA); }
.peaceful-icon { background: linear-gradient(135deg, #22C55E, #16A34A); }
.excited-icon { background: linear-gradient(135deg, #F97316, #DC2626); }
.tired-icon { background: linear-gradient(135deg, #6B7280, #4B5563); }

.mood-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}


/* ============================================
   Stats Panel
   ============================================ */

#stats-panel {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 30px 0;
}

.stat {
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px 40px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 150px;
}

.stat span {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(90deg, #4ECDC4, #FFD93D);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   Live Feed
   ============================================ */

#recent-moods {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 20px 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
}

#recent-moods h3 {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

#mood-feed {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 150px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for feed */
#mood-feed::-webkit-scrollbar {
    width: 6px;
}

#mood-feed::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

#mood-feed::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.mood-item {
    background: rgba(255, 255, 255, 0.08);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    animation: fadeInUp 0.4s ease-out;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mood-item .mood-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mood-item .mood-text {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.mood-item .location {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* ============================================
   Footer
   ============================================ */

footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

footer p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

footer .footer-note {
    font-size: 0.8rem;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   Responsive Design
   ============================================ */

@media screen and (max-width: 768px) {
    header h1 { 
        font-size: 2rem; 
    }
    
    #globe-container { 
        height: 350px; 
    }
    
    .mood-btn { 
        width: 70px; 
        height: 70px; 
    }
    
    .mood-icon {
        width: 28px;
        height: 28px;
    }
    
    #stats-panel { 
        gap: 20px; 
    }
    
    .stat {
        padding: 15px 25px;
    }
}

@media screen and (max-width: 480px) {
    header h1 { 
        font-size: 1.6rem; 
    }
    
    .tagline {
        font-size: 0.95rem;
    }
    
    #globe-container { 
        height: 280px; 
    }
    
    .mood-btn { 
        width: 60px; 
        height: 60px; 
    }
    
    .mood-icon {
        width: 24px;
        height: 24px;
    }
    
    .mood-label {
        font-size: 0.6rem;
    }
    
    #stats-panel { 
        flex-direction: column; 
        gap: 15px; 
    }
    
    .stat {
        padding: 15px 20px;
    }
    
    #mood-panel {
        padding: 20px 15px;
    }
}


/* ============================================
   Anonymous Message Panel
   ============================================ */

#message-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

#message-panel h3 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.message-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.message-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#mood-message {
    flex: 1;
    padding: 12px 18px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
}

#mood-message:focus {
    border-color: #4ECDC4;
}

#mood-message::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#send-message-btn {
    padding: 12px 25px;
    border-radius: 25px;
    border: none;
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#send-message-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(78, 205, 196, 0.4);
}

#world-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.world-message {
    background: rgba(255, 255, 255, 0.08);
    padding: 12px 16px;
    border-radius: 12px;
    animation: fadeInUp 0.4s ease-out;
}

.world-message .msg-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.world-message .msg-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   Time Travel Panel
   ============================================ */

#time-travel-panel {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(78, 205, 196, 0.1));
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    margin-bottom: 30px;
}

#time-travel-panel h3 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.time-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.time-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.time-btn {
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.time-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.6);
}

.time-btn.active {
    background: linear-gradient(135deg, #A855F7, #7C3AED);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

#time-indicator {
    text-align: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

#viewing-time {
    color: #A855F7;
    font-weight: 500;
}
