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

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-panel: rgba(17, 24, 39, 0.95);
    --accent-cyan: #00f5ff;
    --accent-magenta: #ff00ff;
    --accent-green: #39ff14;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --border-color: rgba(0, 245, 255, 0.2);
    --glow-cyan: 0 0 20px rgba(0, 245, 255, 0.5);
    --glow-magenta: 0 0 20px rgba(255, 0, 255, 0.5);
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Scanlines effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 3px
    );
    opacity: 0.3;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(20, 25, 35, 0.85);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(0, 245, 255, 0.15);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

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

.logo:hover .logo-icon {
    text-shadow: 0 0 30px rgba(0, 245, 255, 0.8);
}

.logo:hover h1 {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.logo-icon {
    font-size: 2rem;
    color: var(--accent-cyan);
    animation: pulse 2s ease-in-out infinite;
    text-shadow: var(--glow-cyan);
}

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

.logo h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--text-primary);
}

.logo .accent {
    color: var(--accent-cyan);
    text-shadow: var(--glow-cyan);
}

.header-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

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

.header-line {
    height: 1px;
    margin-top: 1rem;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--accent-cyan) 20%, 
        var(--accent-magenta) 50%, 
        var(--accent-cyan) 80%, 
        transparent 100%
    );
    opacity: 0.5;
}

/* Main container */
.main-container {
    width: 100%;
    height: 100vh;
    position: relative;
}

/* Map */
#map {
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
}

.leaflet-container {
    background: var(--bg-primary) !important;
    font-family: 'JetBrains Mono', monospace;
}

/* Custom map tiles dark style */
.leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) brightness(0.8) contrast(1.2);
}

/* Info Panel */
.info-panel {
    position: fixed;
    top: 5rem;
    right: 2rem;
    width: 400px;
    max-height: 60vh;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    z-index: 500;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 0 40px rgba(0, 0, 0, 0.5),
        inset 0 0 60px rgba(0, 245, 255, 0.03);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.info-panel.active {
    transform: translateX(0);
}

.info-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
}

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

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.flag {
    font-size: 2rem;
    line-height: 1;
}

.panel-title h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    border-color: var(--accent-magenta);
    color: var(--accent-magenta);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}

.panel-content {
    padding: 1.5rem;
    max-height: calc(60vh - 80px);
    overflow-y: auto;
}

.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.panel-content::-webkit-scrollbar-thumb {
    background: var(--accent-cyan);
    border-radius: 3px;
}

.hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem;
}

/* Resource categories */
.resource-category {
    margin-bottom: 1.5rem;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.category-icon {
    font-size: 1rem;
}

.category-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-cyan);
}

.resource-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.resource-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.resource-link:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 245, 255, 0.05);
    transform: translateX(4px);
}

.resource-link::before {
    content: '▸';
    color: var(--accent-green);
    font-size: 0.7rem;
}

.resource-link .link-icon {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Leaflet attribution - moved to bottom left */
.leaflet-control-attribution {
    position: fixed !important;
    bottom: 1rem !important;
    left: 1rem !important;
    right: auto !important;
    background: var(--bg-panel) !important;
    color: var(--text-secondary) !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.7rem !important;
    padding: 0.4rem 0.75rem !important;
    border-radius: 4px !important;
    border: 1px solid var(--border-color) !important;
    margin: 0 !important;
    z-index: 500 !important;
}

.leaflet-control-attribution a {
    color: var(--accent-cyan) !important;
    text-decoration: none !important;
}

.leaflet-control-attribution a:hover {
    color: var(--accent-magenta) !important;
}

/* Country hover tooltip */
.country-tooltip {
    background: var(--bg-panel) !important;
    border: 1px solid var(--accent-cyan) !important;
    border-radius: 4px !important;
    color: var(--text-primary) !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.85rem !important;
    padding: 0.5rem 0.75rem !important;
    box-shadow: var(--glow-cyan) !important;
}

.country-tooltip::before {
    border-top-color: var(--accent-cyan) !important;
}

/* Leaflet controls styling */
.leaflet-control-zoom {
    border: none !important;
    margin: 1rem !important;
}

.leaflet-control-zoom a {
    background: var(--bg-panel) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 1.2rem !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(0, 245, 255, 0.1) !important;
    border-color: var(--accent-cyan) !important;
}

.leaflet-control-zoom-in {
    border-radius: 4px 4px 0 0 !important;
}

.leaflet-control-zoom-out {
    border-radius: 0 0 4px 4px !important;
}

/* No data message */
.no-data {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.no-data-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-data p {
    font-size: 0.9rem;
}

/* Loading animation */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.loading::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem;
    }
    
    .header-content {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: space-between;
        align-items: center;
    }
    
    .logo {
        flex: 0 0 auto;
        max-width: 60%;
    }
    
    .logo-icon {
        font-size: 1.5rem;
    }
    
    .logo h1 {
        font-size: 1rem;
        letter-spacing: 0.1em;
    }
    
    .header-stats {
        flex: 0 0 auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: 0.5rem;
        align-items: center;
    }
    
    .stat {
        min-width: auto;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .stat-label {
        font-size: 0.6rem;
        letter-spacing: 0.05em;
    }
    
    .header-line {
        display: none;
    }
    
    .info-panel {
        width: 100%;
        right: 0;
        left: 0;
        top: auto;
        bottom: 0;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        border: none;
        border-top: 2px solid var(--accent-cyan);
    }
    
    .info-panel.active {
        transform: translateY(0);
    }
    
    /* Adjust panel content height for mobile */
    .panel-content {
        max-height: calc(70vh - 80px);
        padding: 1rem;
    }
    
    /* Add swipe indicator to info panel */
    .info-panel::after {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: var(--accent-cyan);
        border-radius: 2px;
        opacity: 0.5;
    }
    
    /* Search panel mobile */
    .search-panel {
        width: 100%;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
        border: none;
        border-top: 2px solid var(--accent-cyan);
    }
    
    /* Add swipe indicator to search panel */
    .search-panel .panel-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: var(--accent-cyan);
        border-radius: 2px;
        opacity: 0.5;
    }
    
    .search-btn {
        padding: 0.5rem;
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .search-btn .search-text {
        display: none;
    }
    
    .search-btn .search-icon {
        font-size: 1.2rem;
    }
    
    .continent-header {
        padding: 0.6rem 1rem;
    }
    
    .country-item {
        padding: 0.5rem 1rem 0.5rem 1.75rem;
    }
    
    .continent-name {
        font-size: 0.75rem;
    }
    
    .country-name-text {
        font-size: 0.8rem;
    }
    
    /* Make close button larger and more accessible on mobile */
    .close-btn {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        font-size: 1.8rem;
        flex-shrink: 0;
    }
    
    .back-btn {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }
    
    /* Adjust panel header for mobile */
    .panel-header {
        padding: 1rem;
        gap: 0.5rem;
        position: relative;
    }
    
    .panel-title {
        flex: 1;
        min-width: 0;
        gap: 0.5rem;
    }
    
    .panel-title h2 {
        font-size: 0.95rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .flag {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.5rem 0.75rem;
    }
    
    .logo h1 {
        font-size: 0.85rem;
    }
    
    .search-panel {
        width: 100%;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 75vh;
        border-radius: 16px 16px 0 0;
    }
    
    .info-panel {
        width: 100%;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 75vh;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }
    
    .info-panel.active {
        transform: translateY(0);
    }
    
    .panel-header {
        padding: 0.75rem;
    }
    
    .panel-content {
        max-height: calc(75vh - 80px);
        padding: 0.75rem;
    }
    
    .search-input-container {
        padding: 0.75rem 1rem;
    }
    
    #country-search-input {
        padding: 0.6rem 0.75rem 0.6rem 2.25rem;
        font-size: 0.85rem;
    }
    
    .search-input-icon {
        left: 1.75rem;
    }
}

/* Country styles on map */
.country-layer {
    fill: #5a3040;
    fill-opacity: 0.8;
    stroke: #8a5060;
    stroke-width: 0.5;
    stroke-opacity: 0.5;
    transition: all 0.3s ease;
}

.country-layer:hover {
    fill: #6a4050;
    fill-opacity: 1;
    stroke: #a06070;
    stroke-opacity: 1;
    stroke-width: 1.5;
}

.country-layer.has-data {
    fill: #1e4a7a;
    stroke: #00a8ff;
}

.country-layer.has-data:hover {
    fill: #2d6aaa;
    stroke: #00d4ff;
}

.country-layer.selected {
    fill: #00a8ff;
    fill-opacity: 0.4;
    stroke: var(--accent-magenta);
    stroke-width: 2;
}

/* Search Button in Header */
.search-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: rgba(0, 245, 255, 0.1);
    border: 1px solid var(--accent-cyan);
    border-radius: 4px;
    color: var(--accent-cyan);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.search-btn:hover {
    background: rgba(0, 245, 255, 0.2);
    box-shadow: var(--glow-cyan);
    transform: translateY(-2px);
}

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

.search-icon {
    font-size: 1.1rem;
}

/* Search Panel */
.search-panel {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 380px;
    max-height: 70vh;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    z-index: 500;
    transform: translateX(-120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 0 40px rgba(0, 0, 0, 0.5),
        inset 0 0 60px rgba(0, 245, 255, 0.03);
    backdrop-filter: blur(10px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.search-panel.active {
    transform: translateX(0);
}

.search-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-magenta), var(--accent-cyan));
}

.search-panel-icon {
    font-size: 1.5rem;
    color: var(--accent-cyan);
}

/* Search Input */
.search-input-container {
    position: relative;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

#country-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-left: 2.5rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    transition: all 0.2s;
}

#country-search-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.2);
}

#country-search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.search-input-icon {
    position: absolute;
    left: 2.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1rem;
    pointer-events: none;
}

/* Search Content */
.search-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.search-content::-webkit-scrollbar {
    width: 6px;
}

.search-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.search-content::-webkit-scrollbar-thumb {
    background: var(--accent-cyan);
    border-radius: 3px;
}

/* Continent Groups */
.continent-group {
    margin-bottom: 0.25rem;
}

.continent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.continent-header:hover {
    background: rgba(0, 245, 255, 0.05);
    border-left-color: var(--accent-cyan);
}

.continent-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.continent-icon {
    font-size: 1.2rem;
}

.continent-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--accent-cyan);
    text-transform: uppercase;
}

.continent-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

.continent-toggle {
    color: var(--text-secondary);
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.continent-group.collapsed .continent-toggle {
    transform: rotate(-90deg);
}

.continent-group.collapsed .country-list {
    display: none;
}

/* Country List */
.country-list {
    padding: 0.25rem 0;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem 0.6rem 2.5rem;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 2px solid transparent;
}

.country-item:hover {
    background: rgba(0, 245, 255, 0.08);
    border-left-color: var(--accent-magenta);
}

.country-item.no-data {
    opacity: 0.5;
}

.country-item.no-data:hover {
    opacity: 0.7;
}

.country-flag {
    font-size: 1.25rem;
    line-height: 1;
}

.country-name-text {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.country-item.no-data .country-name-text {
    color: var(--text-secondary);
}

.country-data-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 6px rgba(57, 255, 20, 0.5);
}

.country-item.no-data .country-data-indicator {
    background: var(--text-secondary);
    box-shadow: none;
    opacity: 0.3;
}

/* Back Button */
.back-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: transparent;
    color: var(--accent-cyan);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
}

.back-btn:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 245, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 245, 255, 0.3);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.no-results-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.no-results p {
    font-size: 0.9rem;
}

/* Panel Backdrop - Mobile overlay to close panels */
.panel-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 499;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.panel-backdrop.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .panel-backdrop.active {
        display: block;
    }
}

/* ============================================
   STATISTICS PANEL STYLES
   ============================================ */

/* Stats Button in Header */
.stats-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 0, 255, 0.1);
    border: 1px solid rgba(255, 0, 255, 0.3);
    border-radius: 4px;
    color: var(--accent-magenta);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.stats-btn:hover {
    background: rgba(255, 0, 255, 0.2);
    border-color: var(--accent-magenta);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}

.stats-icon {
    font-size: 1rem;
}

/* Stats Panel */
.stats-panel {
    position: fixed;
    top: 80px;
    left: 20px;
    width: 380px;
    max-height: calc(100vh - 100px);
    background: var(--bg-panel);
    border: 1px solid rgba(255, 0, 255, 0.3);
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.2);
    z-index: 500;
    display: flex;
    flex-direction: column;
    transform: translateX(-120%);
    opacity: 0;
    transition: all 0.3s ease;
}

.stats-panel.active {
    transform: translateX(0);
    opacity: 1;
}

.stats-panel .panel-header {
    border-bottom-color: rgba(255, 0, 255, 0.2);
}

.stats-panel-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

/* Stats Tabs */
.stats-tabs {
    display: flex;
    gap: 0;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 0, 255, 0.1);
}

.stats-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid rgba(255, 0, 255, 0.2);
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.stats-tab:first-child {
    border-radius: 4px 0 0 4px;
}

.stats-tab:last-child {
    border-radius: 0 4px 4px 0;
    border-left: none;
}

.stats-tab:hover {
    background: rgba(255, 0, 255, 0.1);
    color: var(--text-primary);
}

.stats-tab.active {
    background: rgba(255, 0, 255, 0.2);
    border-color: var(--accent-magenta);
    color: var(--accent-magenta);
}

.tab-icon {
    font-size: 1rem;
}

/* Stats Summary */
.stats-summary {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 0, 255, 0.1);
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.summary-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-magenta);
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

.summary-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

/* Stats Content */
.stats-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.stats-content::-webkit-scrollbar {
    width: 6px;
}

.stats-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.stats-content::-webkit-scrollbar-thumb {
    background: rgba(255, 0, 255, 0.3);
    border-radius: 3px;
}

/* Stats Loading */
.stats-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 0, 255, 0.1);
    border-top-color: var(--accent-magenta);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Stats Empty */
.stats-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.stats-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.stats-empty-hint {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    color: var(--accent-magenta);
    opacity: 0.7;
}

/* Stats Ranking */
.stats-ranking {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stats-item:hover {
    background: rgba(255, 0, 255, 0.1);
    border-color: rgba(255, 0, 255, 0.3);
    transform: translateX(5px);
}

.stats-item.medal-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(0, 0, 0, 0.2) 100%);
    border-color: rgba(255, 215, 0, 0.4);
}

.stats-item.medal-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.15) 0%, rgba(0, 0, 0, 0.2) 100%);
    border-color: rgba(192, 192, 192, 0.4);
}

.stats-item.medal-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.15) 0%, rgba(0, 0, 0, 0.2) 100%);
    border-color: rgba(205, 127, 50, 0.4);
}

.stats-rank {
    min-width: 2rem;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.stats-country {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.stats-flag {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stats-name {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-bar-container {
    width: 60px;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.stats-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-magenta) 0%, var(--accent-cyan) 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.stats-count {
    min-width: 2.5rem;
    text-align: right;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-magenta);
}

/* Privacy Note */
.stats-privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(0, 245, 255, 0.05);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: 6px;
}

.stats-privacy-note .privacy-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stats-privacy-note p {
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

/* Mobile Responsive Stats */
@media (max-width: 768px) {
    .stats-btn .stats-text {
        display: none;
    }
    
    .stats-btn {
        padding: 0.5rem;
        min-width: 40px;
        justify-content: center;
    }
    
    .stats-icon {
        font-size: 1.2rem;
    }
    
    .stats-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 75vh;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        border: none;
        border-top: 2px solid rgba(255, 0, 255, 0.4);
    }
    
    .stats-panel.active {
        transform: translateY(0);
    }
    
    .stats-panel .panel-header {
        padding: 1rem;
        border-bottom: 1px solid rgba(255, 0, 255, 0.2);
    }
    
    .stats-panel .panel-header h2 {
        font-size: 1rem;
    }
    
    .stats-panel-icon {
        font-size: 1rem;
    }
    
    .stats-tabs {
        padding: 0.5rem;
        gap: 0;
    }
    
    .stats-tab {
        padding: 0.6rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .tab-icon {
        font-size: 0.9rem;
    }
    
    .stats-summary {
        padding: 0.75rem;
    }
    
    .summary-value {
        font-size: 1.2rem;
    }
    
    .summary-label {
        font-size: 0.65rem;
    }
    
    .stats-content {
        padding: 0.75rem;
        max-height: calc(75vh - 200px);
        overflow-y: auto;
    }
    
    .stats-ranking {
        gap: 0.4rem;
    }
    
    .stats-item {
        padding: 0.6rem 0.5rem;
        gap: 0.5rem;
    }
    
    .stats-rank {
        min-width: 1.8rem;
        font-size: 0.8rem;
    }
    
    .stats-flag {
        font-size: 1.1rem;
    }
    
    .stats-name {
        font-size: 0.8rem;
    }
    
    .stats-bar-container {
        display: none;
    }
    
    .stats-count {
        min-width: 2rem;
        font-size: 0.8rem;
    }
    
    .stats-privacy-note {
        margin-top: 1rem;
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .stats-privacy-note .privacy-icon {
        font-size: 1rem;
    }
    
    .stats-privacy-note p {
        font-size: 0.7rem;
    }
    
    /* Fix for stats empty and loading states */
    .stats-empty,
    .stats-loading {
        padding: 1.5rem 1rem;
    }
    
    .stats-empty-icon,
    .loading-spinner {
        font-size: 2rem;
        width: 30px;
        height: 30px;
    }
}

/* Extra small screens */
@media (max-width: 380px) {
    .header {
        padding: 0.5rem 0.75rem;
    }
    
    .header-content {
        gap: 0.5rem;
    }
    
    .logo {
        gap: 0.5rem;
    }
    
    .logo-icon {
        font-size: 1.5rem;
    }
    
    .logo h1 {
        font-size: 0.9rem;
        letter-spacing: 0.1em;
    }
    
    .header-stats {
        gap: 0.5rem;
    }
    
    .stat {
        min-width: 40px;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.55rem;
    }
    
    .search-btn,
    .stats-btn {
        padding: 0.4rem;
        min-width: 36px;
        min-height: 36px;
    }
    
    .search-icon,
    .stats-icon {
        font-size: 1rem;
    }
}

/* ============================================
   SOCIAL LINKS FOOTER
   ============================================ */

.social-footer {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-panel);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    z-index: 500;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    transition: all 0.3s ease;
}

.social-footer:hover {
    border-color: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
}

.social-label {
    color: var(--text-secondary);
    white-space: nowrap;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: rgba(0, 245, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: var(--glow-cyan);
}

.social-link svg {
    width: 16px;
    height: 16px;
}

/* Mobile responsiveness for social footer */
@media (max-width: 768px) {
    .social-footer {
        bottom: 0.75rem;
        right: 0.75rem;
        padding: 0.4rem 0.6rem;
        font-size: 0.65rem;
        gap: 0.4rem;
    }
    
    .social-label {
        display: none;
    }
    
    .social-link {
        width: 32px;
        height: 32px;
    }
    
    .social-link svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .social-footer {
        bottom: 0.5rem;
        right: 0.5rem;
    }
}
