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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0a1929 0%, #1a2332 100%);
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #17A2B8 0%, #138496 100%);
    padding: 12px 30px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 22px;
    color: #ffffff;
}

.logo h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 2px;
    font-weight: 400;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 480px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px 6px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.stat-content {
    text-align: left;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.stat-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 1px;
    font-weight: 500;
}

/* Info Panel */
.info-panel {
    position: fixed;
    top: 90px;
    left: 40px;
    z-index: 100;
    max-width: 380px;
}

.instructions {
    background: rgba(23, 162, 184, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(23, 162, 184, 0.3);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: pulse 2s ease-in-out infinite;
}

.instructions i {
    font-size: 20px;
    color: #17A2B8;
}

.instructions p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

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

/* Globe Container */
#globe-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Outbreak Detail Card */
.outbreak-card {
    position: fixed;
    top: 90px;
    right: 40px;
    width: 380px;
    max-height: calc(100vh - 110px);
    background: rgba(26, 35, 50, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(23, 162, 184, 0.3);
    border-radius: 16px;
    padding: 25px;
    z-index: 200;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.outbreak-card.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(20px);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.4);
    color: #E74C3C;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(231, 76, 60, 0.3);
    transform: scale(1.1);
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-country {
    font-size: 24px;
    font-weight: 700;
    color: #17A2B8;
    margin-bottom: 5px;
}

.card-year {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.card-stat {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.card-stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.card-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.card-stat-value.cases { color: #17A2B8; }
.card-stat-value.deaths { color: #E74C3C; }
.card-stat-value.cfr { color: #F39C12; }

.card-section {
    margin-bottom: 20px;
}

.card-section h4 {
    font-size: 14px;
    color: #17A2B8;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-section p {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

.card-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.source-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(23, 162, 184, 0.2);
    border: 1px solid rgba(23, 162, 184, 0.3);
    border-radius: 8px;
    color: #17A2B8;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

.source-link:hover {
    background: rgba(23, 162, 184, 0.3);
    transform: translateY(-2px);
}

/* Legend */
.legend {
    position: fixed;
    bottom: 100px;
    left: 40px;
    background: rgba(26, 35, 50, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    z-index: 100;
}

.legend-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.legend-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
}

/* Controls */
.controls {
    position: fixed;
    bottom: 40px;
    right: 40px;
    display: flex;
    gap: 12px;
    z-index: 100;
}

.control-btn {
    width: 50px;
    height: 50px;
    background: rgba(23, 162, 184, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(23, 162, 184, 0.3);
    border-radius: 50%;
    color: #17A2B8;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(23, 162, 184, 0.3);
    transform: scale(1.1);
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 25, 41, 0.9);
    padding: 15px 40px;
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    z-index: 50;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
    margin: 3px 0;
}

.copyright {
    color: rgba(255, 255, 255, 0.4);
}

/* SEO Content - Hidden */
.seo-content {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.visually-hidden {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a1929 0%, #1a2332 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

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

.loader i {
    font-size: 60px;
    color: #17A2B8;
    animation: spin 2s linear infinite;
}

.loading-screen p {
    margin-top: 20px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
}

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

/* Responsive Design */
@media (max-width: 1200px) {
    .outbreak-card {
        right: 20px;
        width: 360px;
        top: 80px;
        max-height: calc(100vh - 100px);
    }

    .info-panel {
        left: 20px;
        max-width: 320px;
        top: 80px;
    }
}

/* Mobile Devices - Major improvements for better globe visibility */
@media (max-width: 768px) {
    /* Header adjustments */
    .header {
        padding: 10px 15px;
    }

    .header-content {
        gap: 10px;
    }

    .logo {
        gap: 6px;
    }

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

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

    .subtitle {
        font-size: 9px;
        margin-top: 1px;
    }

    /* Compact stats in header */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        max-width: 100%;
    }

    .stat-card {
        padding: 6px 4px;
        border-radius: 6px;
        gap: 4px;
    }

    .stat-icon {
        font-size: 12px;
    }

    .stat-value {
        font-size: 12px;
    }

    .stat-label {
        font-size: 7px;
        margin-top: 1px;
        letter-spacing: 0.2px;
    }

    /* Hide info panel on mobile to maximize globe visibility */
    .info-panel {
        display: none;
    }

    /* Outbreak card - bottom sheet style */
    .outbreak-card {
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 65vh;
        border-radius: 20px 20px 0 0;
        padding: 24px 20px 20px 20px;
        transform: translateY(0);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .outbreak-card.hidden {
        transform: translateY(100%);
        opacity: 1;
    }

    /* Add swipe indicator for mobile */
    .outbreak-card::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }

    .card-header {
        margin-bottom: 15px;
        padding-bottom: 12px;
    }

    .card-country {
        font-size: 20px;
    }

    .card-stats {
        gap: 8px;
        margin-bottom: 15px;
    }

    .card-stat {
        padding: 10px 6px;
    }

    .card-stat-label {
        font-size: 10px;
    }

    .card-stat-value {
        font-size: 16px;
    }

    /* Legend - repositioned for mobile */
    .legend {
        bottom: 20px;
        left: 15px;
        padding: 10px 12px;
        max-width: calc(100vw - 140px);
    }

    .legend-title {
        font-size: 9px;
        margin-bottom: 8px;
    }

    .legend-items {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .legend-item {
        gap: 6px;
    }

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

    .legend-label {
        font-size: 9px;
    }

    /* Controls - repositioned */
    .controls {
        bottom: 20px;
        right: 15px;
        gap: 8px;
        flex-direction: column;
    }

    .control-btn {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    /* Footer - more compact */
    .footer {
        padding: 10px 15px;
        font-size: 9px;
    }

    /* Globe container - ensure full visibility */
    #globe-container {
        top: 0;
        height: 100vh;
    }
}

/* Extra Small Mobile - Further optimizations */
@media (max-width: 480px) {
    .header {
        padding: 8px 10px;
    }

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

    .logo i {
        font-size: 16px;
    }

    .subtitle {
        font-size: 8px;
    }

    .stat-card {
        padding: 5px 3px;
        gap: 3px;
    }

    .stat-icon {
        font-size: 10px;
    }

    .stat-value {
        font-size: 11px;
    }

    .stat-label {
        font-size: 6px;
    }

    .outbreak-card {
        max-height: 70vh;
        padding: 18px;
    }

    .card-country {
        font-size: 18px;
    }

    .card-year {
        font-size: 12px;
    }

    .card-stat-value {
        font-size: 14px;
    }

    .card-section h4 {
        font-size: 13px;
    }

    .card-section p {
        font-size: 12px;
    }

    .legend {
        padding: 8px 10px;
        left: 10px;
        bottom: 15px;
    }

    .legend-title {
        font-size: 8px;
    }

    .legend-color {
        width: 12px;
        height: 12px;
    }

    .legend-label {
        font-size: 8px;
    }

    .controls {
        right: 10px;
        bottom: 15px;
    }

    .control-btn {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
}

/* Landscape mobile - optimize for horizontal viewing */
@media (max-width: 768px) and (orientation: landscape) {
    .outbreak-card {
        max-height: 80vh;
    }

    .legend {
        bottom: 15px;
    }

    .controls {
        bottom: 15px;
    }
}
