/* 
   MoodDrop Analytics Dashboard - Premium Gradient Design
   Path: css/dashboard.css
*/

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

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --happy-gradient: linear-gradient(135deg, #FFD700 0%, #FFED4E 100%);
    --calm-gradient: linear-gradient(135deg, #52D96E 0%, #6FDF6F 100%);
    --sad-gradient: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
    --angry-gradient: linear-gradient(135deg, #EF4444 0%, #F87171 100%);
    --anxious-gradient: linear-gradient(135deg, #A855F7 0%, #D8B4FE 100%);
    
    --bg-primary: #0f0f1e;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #242a40;
    --text-primary: #ffffff;
    --text-secondary: #b0b0c8;
    --border-color: rgba(255, 255, 255, 0.1);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

html, body {
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background animated gradients */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(212, 70, 239, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: gradientShift 15s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background: 
            radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
            radial-gradient(circle at 80% 80%, rgba(212, 70, 239, 0.15) 0%, transparent 50%);
    }
    50% {
        background: 
            radial-gradient(circle at 30% 60%, rgba(102, 126, 234, 0.2) 0%, transparent 50%),
            radial-gradient(circle at 70% 70%, rgba(212, 70, 239, 0.2) 0%, transparent 50%);
    }
}

header h1,
.subtitle,
.map-section h2,
.section-subtitle,
.chart-card h3,
.app-download h2,
.app-download p {
    text-align: center;
}

/* ============================================================================

.header {
    background: rgba(15, 15, 30, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem 3rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

.logo-section {
    text-align: center;
    width: 100%;
    padding-bottom: 1.5rem;
}

.header .logo-section h1,
.header .logo-section .app-title,
.logo-section h1,
.logo-section .app-title {
    font-size: 1.8rem !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #4facfe 0%, #FFD700 50%, #52D96E 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    margin-bottom: 0.25rem !important;
    text-align: center !important;
    color: transparent !important;
}

.logo-section p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
}

.cta-section {
    display: flex;
    gap: 1rem;
}

/* ============================================================================
   BUTTONS - Gradient with hover effects
   ============================================================================ */

.download-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.download-btn.primary-gradient {
    background: var(--primary-gradient);
    color: white;
}

.download-btn.secondary-gradient {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

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

/* ============================================================================
   LIVE BANNER - Live data indicator with pulse animation
   ============================================================================ */

.live-banner {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    text-align: center;
}

.live-indicator,
.stat-item,
.stat-number,
.stat-label {
    text-align: center;
}

.live-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    color: #4ade80;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px #4ade80;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.live-stats {
    display: flex;
    gap: 3rem;
    flex: 1;
    min-width: 300px;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #FFD700 0%, #4facfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================================================
   MAIN DASHBOARD
   ============================================================================ */

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-primary);
}

.dashboard {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

/* ============================================================================
   MAP SECTION - Hero map area with premium styling
   ============================================================================ */

.map-section {
    background: rgba(36, 42, 64, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    margin: 0 auto 2.5rem auto;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 100%;
}

.map-header {
    margin-bottom: 2rem;
    text-align: center;
}

.map-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.map-header p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.map-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.dropdown-control {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: #000000;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23000000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
}

.dropdown-control option {
    color: #000000;
    background: #ffffff;
}

.dropdown-control:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(102, 126, 234, 0.5);
}

.map-container {
    position: relative;
}

.usa-map {
    min-height: 400px;
    background: linear-gradient(135deg, rgba(15, 15, 30, 0.8) 0%, rgba(36, 42, 64, 0.8) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
}

.map-legend {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
}

.happy-color {
    background: #FFD700;
}

.calm-color {
    background: #52D96E;
}

.sad-color {
    background: #3B82F6;
}

.angry-color {
    background: #EF4444;
}

.in-love-color {
    background-image: url('/assets/moods/sunset_fire_gradient.png');
    background-size: cover;
    background-position: center;
}

.inspired-color {
    background-image: url('/assets/moods/golden_hour_gradient.png');
    background-size: cover;
    background-position: center;
}

.lonely-color {
    background-image: url('/assets/moods/ocean_depths_gradient.png');
    background-size: cover;
    background-position: center;
}

.frustrated-color {
    background-image: url('/assets/moods/electric_storm_gradient.png');
    background-size: cover;
    background-position: center;
}

.stressed-color {
    background-image: url('/assets/moods/midnight_mist_gradient.png');
    background-size: cover;
    background-position: center;
}

.sleepy-color {
    background-image: url('/assets/moods/celestial_gradient.png');
    background-size: cover;
    background-position: center;
}

.bored-color {
    background-image: url('/assets/moods/neon_tokyo_gradient.png');
    background-size: cover;
    background-position: center;
}

.grateful-color {
    background-image: url('/assets/moods/forest_magic_gradient.png');
    background-size: cover;
    background-position: center;
}

/* ============================================================================
   DATA PANELS - Card-based layout with glassmorphism
   ============================================================================ */

.data-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.data-panel {
    background: rgba(36, 42, 64, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-normal);
    max-height: 500px;
}

.data-panel:hover {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
}

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

.panel-header h3 {
    font-size: 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn:hover {
    color: var(--text-primary);
    transform: rotate(180deg);
}

.panel-content {
    padding: 1.5rem;
    animation: slideIn var(--transition-normal) ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   CHARTS
   ============================================================================ */

.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 1.5rem;
}

.chart-container.large {
    height: 400px;
}

canvas {
    max-width: 100%;
}

/* ============================================================================
   MOOD LIST
   ============================================================================ */

.mood-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mood-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: all var(--transition-fast);
}

.mood-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.mood-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mood-icon {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.mood-name {
    font-weight: 500;
}

.mood-percentage {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #FFD700 0%, #4facfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================================================
   REGIONAL INSIGHTS
   ============================================================================ */

.regional-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.region-stat {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(212, 70, 239, 0.1) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition-normal);
}

.region-stat:hover {
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.region-stat h4 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.region-mood {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #FFD700 0%, #4facfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.region-trend {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================================================
   METRICS GRID
   ============================================================================ */

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

.metric-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all var(--transition-normal);
}

.metric-card:hover {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-4px);
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.metric-icon.happy-gradient {
    background: var(--happy-gradient);
}

.metric-icon.calm-gradient {
    background: var(--calm-gradient);
}

.metric-icon.trending-gradient {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}

.metric-icon.secondary-gradient {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.metric-content h4 {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #FFD700 0%, #4facfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================================================
   PROMO SECTION - Call to action with gradient
   ============================================================================ */

.promo-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(212, 70, 239, 0.15) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
}

.promo-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.2) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

.promo-content {
    position: relative;
    z-index: 1;
}

.promo-section h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.promo-section p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.promo-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.download-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.store-badge {
    display: inline-block;
    transition: all var(--transition-normal);
}

.store-badge img {
    height: 50px;
    display: block;
}

.store-badge:hover {
    transform: translateY(-2px);
}

.store-badge:active {
    transform: translateY(0);
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
    background: rgba(15, 15, 30, 0.8);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: center;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.75rem;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.footer-section a:hover {
    color: var(--text-primary);
}

/* ============================================================================
   LOADING OVERLAY
   ============================================================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 30, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    pointer-events: auto;
    animation: fadeOut 0.5s ease-in-out 2s forwards;
}

.loading-overlay.hidden {
    display: none;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        pointer-events: none;
    }
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top: 3px solid #667eea;
    border-right: 3px solid #764ba2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

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

.loading-overlay p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1024px) {
    .data-panels {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .live-stats {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .dashboard {
        padding: 1.5rem 1rem;
    }
    
    .map-section {
        padding: 1.5rem;
    }
    
    .promo-section {
        padding: 2rem 1.5rem;
    }
    
    .promo-section h2 {
        font-size: 1.5rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .live-banner {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 1.25rem;
        gap: 1rem;
        text-align: center;
    }
    
    .live-stats {
        flex-direction: row;
        gap: 2rem;
        width: 100%;
        text-align: center;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
    }
    
    .stat-item {
        min-width: 100px;
        flex: 0 0 auto;
    }
    
    .download-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .store-badge {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    .store-badge img {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    
    .logo-section {
        width: 100%;
    }
    
    .logo-section h1 {
        font-size: 1.3rem;
    }
    
    .stat-number {
        font-size: 1.4rem;
    }
    
    .live-stats {
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .stat-item {
        min-width: 80px;
    }
    
    .promo-features {
        flex-direction: column;
        gap: 1rem;
    }
    
    .regional-stats {
        grid-template-columns: 1fr;
    }
    
    .map-header h2 {
        font-size: 1.4rem;
    }
    
    .panel-header h3 {
        font-size: 1rem;
    }
    
    .metric-card {
        flex-direction: column;
        text-align: center;
    }
    
    .metric-icon {
        width: 40px;
        height: 40px;
    }
}
