/**
 * HCMC Tourism Dashboard - Main Stylesheet
 * Vibrant, modern design with smooth animations
 */

/* ========================================
   CSS Variables & Fonts
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700;800&family=Dancing+Script:wght@700&display=swap');

:root {
    /* Brand Colors */
    --primary: #FF6B35;
    --primary-dark: #E85A2B;
    --secondary: #00B4D8;
    --secondary-light: #48CAE4;
    --accent: #7B2CBF;
    --accent-light: #9D4EDD;
    
    /* Gradient Colors */
    --gradient-orange: linear-gradient(135deg, #FF6B35 0%, #FF9F1C 100%);
    --gradient-blue: linear-gradient(135deg, #00B4D8 0%, #48CAE4 100%);
    --gradient-purple: linear-gradient(135deg, #7B2CBF 0%, #9D4EDD 100%);
    --gradient-sunset: linear-gradient(135deg, #FF6B35 0%, #FF9F1C 50%, #FFD166 100%);
    --gradient-sky: linear-gradient(135deg, #90E0EF 0%, #00B4D8 50%, #0077B6 100%);
    --gradient-header: linear-gradient(180deg, #87CEEB 0%, #E0F7FF 50%, #FFFFFF 100%);
    
    /* Text Colors */
    --text-primary: #1A1A2E;
    --text-secondary: #4A4A6A;
    --text-light: #8888A0;
    --text-white: #FFFFFF;
    
    /* Background Colors */
    --bg-primary: #F8FAFF;
    --bg-card: #FFFFFF;
    --bg-header: linear-gradient(180deg, #C5E8F7 0%, #E8F6FF 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --shadow-glow-orange: 0 4px 30px rgba(255, 107, 53, 0.3);
    --shadow-glow-blue: 0 4px 30px rgba(0, 180, 216, 0.3);
    --shadow-glow-purple: 0 4px 30px rgba(123, 44, 191, 0.3);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    
    /* Animation */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   Main Container
   ======================================== */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-md);
    position: relative;
}

/* ========================================
   Header Section
   ======================================== */
.dashboard-header {
    background: var(--bg-header);
    border-radius: var(--radius-xl);
    padding: var(--space-lg) var(--space-xl);
    margin-bottom: var(--space-lg);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.logo-image {
    width: 80px;
    height: auto;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.1));
    animation: float 3s ease-in-out infinite;
}

.brand-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.brand-icon {
    font-size: 2.5rem;
    margin-bottom: -10px;
}

.brand-name {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.brand-name .vibrant {
    font-family: 'Dancing Script', cursive;
    color: var(--primary);
    font-size: 2.2rem;
    margin-right: 0.3rem;
}

.dashboard-subtitle {
    font-size: 1.1rem;
    color: var(--secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: var(--space-xs);
}

/* Floating decorations */
.header-decoration {
    position: absolute;
    pointer-events: none;
}

.hot-air-balloon {
    position: absolute;
    right: 5%;
    top: 10%;
    font-size: 3rem;
    animation: floatBalloon 4s ease-in-out infinite;
    filter: drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.15));
}

.paper-kite {
    position: absolute;
    left: 5%;
    top: 20%;
    font-size: 2.5rem;
    animation: swingKite 3s ease-in-out infinite;
    transform-origin: top center;
}

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

@keyframes floatBalloon {
    0%, 100% { transform: translateY(0) rotate(5deg); }
    50% { transform: translateY(-15px) rotate(-5deg); }
}

@keyframes swingKite {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

/* ========================================
   Stats Cards
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.orange::before { background: var(--gradient-orange); }
.stat-card.blue::before { background: var(--gradient-blue); }
.stat-card.purple::before { background: var(--gradient-purple); }

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card.orange:hover {
    box-shadow: var(--shadow-glow-orange);
    border-color: var(--primary);
}

.stat-card.blue:hover {
    box-shadow: var(--shadow-glow-blue);
    border-color: var(--secondary);
}

.stat-card.purple:hover {
    box-shadow: var(--shadow-glow-purple);
    border-color: var(--accent);
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-sm);
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.stat-card.orange .stat-value { color: var(--primary); }
.stat-card.blue .stat-value { color: var(--secondary); }
.stat-card.purple .stat-value { color: var(--accent); }

.stat-unit {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Number counting animation */
.stat-value .number {
    display: inline-block;
    animation: countUp 1.5s ease-out forwards;
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   Charts Grid
   ======================================== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.chart-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.chart-card:hover {
    box-shadow: var(--shadow-lg);
}

.chart-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--bg-primary);
}

.chart-container {
    position: relative;
    height: 220px;
}

/* Pie Chart Legend */
.pie-legend {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-top: var(--space-sm);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.85rem;
    font-weight: 600;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.legend-color.domestic { background: var(--primary); }
.legend-color.international { background: var(--secondary); }

/* ========================================
   Destinations Section
   ======================================== */
.destinations-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-lg);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.section-title::before {
    content: '📍';
    font-size: 1.2rem;
}

.destinations-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

.destination-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.destination-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.destination-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.destination-card:hover .destination-image {
    transform: scale(1.1);
}

.destination-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: var(--space-md) var(--space-sm);
    text-align: center;
}

.destination-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: var(--space-xs);
}

.destination-percentage {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

/* ========================================
   City Illustration
   ======================================== */
.city-illustration {
    position: fixed;
    bottom: 0;
    right: 20px;
    width: 300px;
    height: 200px;
    pointer-events: none;
    opacity: 0.9;
    z-index: 1;
}

.building {
    position: absolute;
    bottom: 0;
    animation: buildingPulse 3s ease-in-out infinite;
}

@keyframes buildingPulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

/* ========================================
   Animations & Effects
   ======================================== */
/* Pulse animation for stats */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

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

/* Fade in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Stagger animation delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }

/* Shimmer loading effect */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Glow effect */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 107, 53, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 107, 53, 0.6); }
}

.glow-effect {
    animation: glow 2s ease-in-out infinite;
}

/* Particle effect background */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: particleFloat 15s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ========================================
   Loading State
   ======================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-primary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1200px) {
    .stats-grid,
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .destinations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: var(--space-sm);
    }
    
    .stats-grid,
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .destinations-grid {
        grid-template-columns: 1fr;
    }
    
    .brand-name {
        font-size: 1.8rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .city-illustration {
        display: none;
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mt-auto { margin-top: auto; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

/* ========================================
   Admin Button
   ======================================== */
.admin-link {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--gradient-purple);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow-purple);
}

.admin-link i {
    font-size: 1.1rem;
}

/* ========================================
   Refresh Indicator
   ======================================== */
.refresh-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.refresh-indicator.visible {
    opacity: 1;
}

.refresh-indicator .dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
