* {
    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;
    bottom: 2rem;
    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-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .info-panel {
        width: calc(100% - 2rem);
        right: 1rem;
        bottom: 1rem;
        max-height: 50vh;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
}

/* 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;
}
