/* EffiTrack Design System — EU Energy Tracker v2 */

:root {
    /* Background */
    --bg-primary: #0b1426;
    --bg-card: rgba(13, 25, 48, 0.85);
    --bg-card-solid: #0d1930;
    --bg-card-hover: rgba(18, 35, 65, 0.9);
    --bg-input: rgba(10, 20, 40, 0.6);

    /* Accents */
    --accent-cyan: #00d4aa;
    --accent-blue: #0ea5e9;
    --accent-purple: #8b5cf6;
    --accent-glow: rgba(0, 212, 170, 0.15);
    --accent-glow-strong: rgba(0, 212, 170, 0.3);

    /* Category Colors */
    --color-electricity: #f5a623;
    --color-fuel: #f87171;
    --color-transport: #4ade80;

    /* Text */
    --text-primary: #e8edf5;
    --text-secondary: #6b7d99;
    --text-muted: #3a4a63;

    /* Border */
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-glow: rgba(0, 212, 170, 0.2);

    /* Aurora (subtle purple-violet panel separation) */
    --aurora-violet: rgba(139, 92, 246, 0.07);
    --aurora-rose: rgba(180, 100, 220, 0.05);
    --aurora-shadow: rgba(139, 92, 246, 0.04);

    /* Layout */
    --sidebar-width: 60px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;

    /* Animation */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --transition: 0.3s var(--ease);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

/* ═══════════════════════════════════════
   AURORA BACKGROUND LAYER
   ═══════════════════════════════════════ */

.aurora-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.8s var(--ease);
}

body.aurora-active .aurora-layer {
    opacity: 1;
}

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    will-change: transform, opacity;
    filter: blur(120px);
    mix-blend-mode: screen;
}

.aurora-blob--primary {
    width: 120vw;
    height: 55vh;
    top: -25%;
    left: -10%;
    background: radial-gradient(ellipse at center,
        rgba(0, 212, 170, 0.18) 0%,
        rgba(0, 180, 160, 0.10) 35%,
        rgba(10, 80, 120, 0.05) 65%,
        transparent 100%);
    animation: auroraDrift1 20s ease-in-out infinite alternate;
}

.aurora-blob--secondary {
    width: 90vw;
    height: 45vh;
    bottom: -20%;
    right: -15%;
    background: radial-gradient(ellipse at center,
        rgba(59, 130, 246, 0.10) 0%,
        rgba(139, 92, 246, 0.06) 40%,
        transparent 100%);
    animation: auroraDrift2 25s ease-in-out infinite alternate;
}

@keyframes auroraDrift1 {
    0%   { transform: translate(0, 0) scale(1); opacity: 0.8; }
    50%  { transform: translate(5%, 3%) scale(1.05); opacity: 1; }
    100% { transform: translate(-3%, -2%) scale(0.97); opacity: 0.85; }
}

@keyframes auroraDrift2 {
    0%   { transform: translate(0, 0) scale(1); opacity: 0.7; }
    50%  { transform: translate(-4%, -3%) scale(1.08); opacity: 0.9; }
    100% { transform: translate(3%, 2%) scale(0.95); opacity: 0.75; }
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-cyan); border-radius: 10px; }

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

#globe-container canvas { display: block; }

/* ═══════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(13, 25, 48, 0.88), rgba(18, 18, 42, 0.85));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(139, 92, 246, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    z-index: 200;
    box-shadow: 2px 0 24px var(--aurora-shadow);
}

.sidebar-logo {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    box-shadow: 0 4px 16px rgba(0, 212, 170, 0.25);
    cursor: pointer;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.sidebar-logo::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 22px;
    background: rgba(255, 255, 255, 0.95);
    clip-path: polygon(
        45% 0%, 22% 44%, 46% 44%,
        28% 100%, 78% 38%, 54% 38%,
        68% 0%
    );
    opacity: 0;
    pointer-events: none;
    filter:
        drop-shadow(0 0 4px rgba(255, 255, 255, 0.9))
        drop-shadow(0 0 8px rgba(0, 212, 170, 0.8))
        drop-shadow(0 0 14px rgba(14, 165, 233, 0.5));
    z-index: 2;
}

.sidebar-logo:hover {
    transform: scale(1.08);
    animation: electricGlow 1.6s ease-in-out infinite;
}

.sidebar-logo:hover::after {
    animation: boltStrike 2.4s ease-in-out infinite;
}

.sidebar-logo:hover .logo-text {
    animation: textFlicker 2.4s ease infinite;
}

@keyframes electricGlow {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(0, 212, 170, 0.25);
    }
    10% {
        box-shadow:
            0 4px 16px rgba(0, 212, 170, 0.6),
            0 0 24px rgba(0, 212, 170, 0.4),
            0 0 4px rgba(255, 255, 255, 0.15);
    }
    13% {
        box-shadow: 0 4px 16px rgba(0, 212, 170, 0.25);
    }
    40% {
        box-shadow: 0 4px 16px rgba(0, 212, 170, 0.25);
    }
    42% {
        box-shadow:
            0 4px 20px rgba(14, 165, 233, 0.5),
            0 0 28px rgba(14, 165, 233, 0.35),
            0 0 6px rgba(255, 255, 255, 0.12);
    }
    45% {
        box-shadow: 0 4px 16px rgba(0, 212, 170, 0.3);
    }
    70% {
        box-shadow: 0 4px 16px rgba(0, 212, 170, 0.25);
    }
    72% {
        box-shadow:
            0 4px 24px rgba(0, 212, 170, 0.65),
            0 0 32px rgba(0, 212, 170, 0.45);
    }
    76% {
        box-shadow: 0 4px 16px rgba(0, 212, 170, 0.25);
    }
}

@keyframes boltStrike {
    0%, 100% { opacity: 0; transform: translateX(-50%) scale(0.85); }
    14% { opacity: 0; }
    15% { opacity: 1; transform: translateX(-50%) scale(1.15); }
    17% { opacity: 0.2; transform: translateX(-50%) scale(1); }
    19% { opacity: 0.9; transform: translateX(-50%) scale(1.05); }
    22% { opacity: 0; }
    64% { opacity: 0; }
    65% { opacity: 0.85; transform: translateX(-50%) scale(1.1); }
    67% { opacity: 0; }
    68% { opacity: 0.5; transform: translateX(-50%) scale(1); }
    70% { opacity: 0; }
}

@keyframes textFlicker {
    0%, 100% { opacity: 1; }
    15%, 19% { opacity: 0.3; }
    17% { opacity: 0.7; }
    65%, 68% { opacity: 0.4; }
    67% { opacity: 0.8; }
}

.logo-text {
    font-weight: 700;
    font-size: 14px;
    color: var(--bg-primary);
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-icon {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.nav-icon:hover {
    color: var(--text-secondary);
    background: rgba(139, 92, 246, 0.06);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.04);
}

.nav-icon.active {
    color: var(--accent-cyan);
    background: rgba(0, 212, 170, 0.08);
}

.nav-icon.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent-cyan);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 8px var(--accent-glow-strong);
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.sidebar-compare {
    display: none;
}

.sidebar-compare.compare-active {
    background: rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.4);
    color: #f87171;
}

.sidebar-music {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.15);
    color: rgba(139, 92, 246, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.06);
}

.sidebar-music:hover {
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.35);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.15);
}

.sidebar-music.playing {
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
    animation: musicPulse 2s ease-in-out infinite;
}

@keyframes musicPulse {
    0%, 100% { box-shadow: 0 0 12px rgba(139, 92, 246, 0.15); }
    50% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.3); }
}

.sidebar-refresh {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 212, 170, 0.08);
    border: 1px solid rgba(0, 212, 170, 0.15);
    color: rgba(0, 212, 170, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 8px rgba(0, 212, 170, 0.06);
}

.sidebar-refresh:hover {
    color: var(--accent-cyan);
    background: rgba(0, 212, 170, 0.15);
    border-color: rgba(0, 212, 170, 0.35);
    box-shadow: 0 0 16px rgba(0, 212, 170, 0.15);
}

.sidebar-refresh.refreshing svg {
    animation: spin 0.8s linear infinite;
}

.sidebar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════
   HEADER CARD (top-left)
   ═══════════════════════════════════════ */

.header-card {
    position: fixed;
    top: 16px;
    left: calc(var(--sidebar-width) + 16px);
    z-index: 100;
    background: linear-gradient(145deg, rgba(13, 25, 48, 0.87), rgba(18, 16, 44, 0.85), rgba(13, 25, 48, 0.87));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.08);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    min-width: 260px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 20px var(--aurora-shadow),
        inset 0 1px 0 var(--aurora-violet);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.header-card:hover {
    background: linear-gradient(145deg, rgba(18, 30, 55, 0.9), rgba(24, 20, 50, 0.88), rgba(18, 30, 55, 0.9));
    border-color: rgba(139, 92, 246, 0.18);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 32px rgba(139, 92, 246, 0.08),
        0 0 12px rgba(180, 100, 220, 0.04),
        inset 0 1px 0 rgba(139, 92, 246, 0.12);
}

.header-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.header-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
}

.header-title {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    letter-spacing: -0.01em;
}

.header-menu-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.header-menu-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

/* Region Selector Dropdown */
.region-dropdown-wrap {
    position: relative;
    margin-bottom: 6px;
}

.region-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.region-toggle:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.06);
}

.region-toggle .chevron {
    margin-left: auto;
    opacity: 0.5;
    transition: transform var(--transition);
}

.region-toggle.open .chevron {
    transform: rotate(180deg);
}

.region-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    z-index: 100;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.region-dropdown.open {
    display: block;
}

.region-option {
    padding: 6px 10px;
    font-size: 11px;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
}

.region-option:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.region-option.active {
    color: var(--accent-cyan);
    background: rgba(0, 212, 170, 0.08);
}

/* Currency Toggle */
.currency-toggle-group {
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 2px;
    margin-bottom: 8px;
}

.currency-btn {
    flex: 1;
    padding: 4px 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 500;
    font-family: var(--font-mono);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.currency-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
}

.currency-btn.active {
    color: var(--accent-cyan);
    background: rgba(0, 212, 170, 0.1);
}

.header-tabs {
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 2px;
    margin-bottom: 10px;
}

.header-tab {
    flex: 1;
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    font-family: var(--font-primary);
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--transition);
}

.header-tab:hover {
    color: var(--text-secondary);
}

.header-tab.active {
    background: rgba(0, 212, 170, 0.12);
    color: var(--accent-cyan);
}

.header-location {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.header-location:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.header-location svg:first-child {
    color: var(--accent-cyan);
}

.header-location svg:last-child {
    margin-left: auto;
    opacity: 0.5;
}

.header-location .chevron {
    transition: transform 0.2s ease;
}

.header-location.open .chevron {
    transform: rotate(180deg);
}

/* Tab Panels */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Location Dropdown */
.location-dropdown {
    display: none;
    margin-top: 6px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card-light);
    padding: 4px;
}

.location-dropdown.open {
    display: block;
}

.location-dropdown::-webkit-scrollbar {
    width: 4px;
}

.location-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.location-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 2px;
}

.location-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    font-size: 11px;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.location-option:hover {
    background: rgba(0, 212, 170, 0.08);
    color: var(--text-primary);
}

.location-option.active {
    color: var(--accent-cyan);
    background: rgba(0, 212, 170, 0.06);
}

.location-option .flag-img {
    width: 16px;
    height: 12px;
    border-radius: 2px;
    object-fit: cover;
}

.location-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* Countries List (Countries tab) */
.countries-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 2px;
}

.countries-list::-webkit-scrollbar {
    width: 4px;
}

.countries-list::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 2px;
}

.country-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    font-size: 11px;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.country-list-item:hover {
    background: rgba(0, 212, 170, 0.08);
    color: var(--text-primary);
}

.country-list-item.selected {
    color: var(--accent-cyan);
    background: rgba(0, 212, 170, 0.1);
}

.country-list-item .flag-img {
    width: 18px;
    height: 13px;
    border-radius: 2px;
    object-fit: cover;
}

.country-list-item .country-price {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent-cyan);
}

/* Layer Toggles (Layers tab) */
.layer-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-secondary);
}

.layer-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 28px;
    height: 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.layer-toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.layer-toggle input[type="checkbox"]:checked {
    background: rgba(0, 212, 170, 0.3);
}

.layer-toggle input[type="checkbox"]:checked::after {
    left: 14px;
    background: var(--accent-cyan);
}

.layer-label {
    -webkit-user-select: none;
    user-select: none;
}


.hcp-status {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.hcp-status[data-state="inactive"] {
    background: var(--text-muted);
}

.hcp-status[data-state="loading"] {
    background: #fbbf24;
    animation: hcpPulse 1.2s ease-in-out infinite;
}

.hcp-status[data-state="camera"] {
    background: var(--accent-cyan);
    box-shadow: 0 0 6px rgba(0, 212, 170, 0.5);
}

.hcp-status[data-state="mouse"] {
    background: var(--accent-blue);
    box-shadow: 0 0 6px rgba(14, 165, 233, 0.4);
}

@keyframes hcpPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

#hcpVideo {
    display: none;
}

/* Refresh button spin animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.nav-icon.refreshing svg {
    animation: spin 0.8s linear infinite;
}

/* ═══════════════════════════════════════
   SEARCH PILL (top-right)
   ═══════════════════════════════════════ */

.search-pill {
    position: fixed;
    top: 16px;
    right: 24px;
    z-index: 380;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(13, 25, 48, 0.87), rgba(16, 18, 42, 0.85));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.08);
    border-radius: 40px;
    min-width: 200px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.2),
        0 0 16px var(--aurora-shadow),
        inset 0 1px 0 var(--aurora-violet);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-pill:hover {
    background: linear-gradient(135deg, rgba(18, 30, 55, 0.9), rgba(22, 22, 48, 0.88));
    border-color: rgba(139, 92, 246, 0.18);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.2),
        0 0 28px rgba(139, 92, 246, 0.08),
        0 0 12px rgba(180, 100, 220, 0.04),
        inset 0 1px 0 rgba(139, 92, 246, 0.12);
}

.search-pill:focus-within {
    border-color: var(--border-glow);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--border-glow);
}

.search-pill svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-pill input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 12px;
    outline: none;
    width: 100%;
}

.search-pill input::placeholder {
    color: var(--text-muted);
}

/* Search dropdown */
.search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: linear-gradient(160deg, rgba(13, 25, 48, 0.95), rgba(16, 18, 44, 0.93));
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: 12px;
    padding: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.2) transparent;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 12px var(--aurora-shadow);
}
.search-dropdown.open { display: block; }

.search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.search-result:hover {
    background: rgba(139, 92, 246, 0.1);
}
.search-result-name {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
}
.search-result-region {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.03em;
    padding: 2px 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
}
.search-result-none {
    padding: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
}

/* ═══════════════════════════════════════
   FLOATING CARDS (shared)
   ═══════════════════════════════════════ */

.card {
    position: fixed;
    z-index: 100;
    background: linear-gradient(160deg, rgba(13, 25, 48, 0.87), rgba(16, 18, 44, 0.85), rgba(13, 25, 48, 0.87));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.05);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.35),
        0 4px 16px rgba(0, 0, 0, 0.2),
        0 0 20px var(--aurora-shadow),
        inset 0 1px 0 var(--aurora-violet);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    animation: cardFadeIn 0.6s var(--ease) both;
}

.card:hover {
    background: linear-gradient(160deg, rgba(18, 30, 55, 0.9), rgba(22, 22, 50, 0.88), rgba(18, 30, 55, 0.9));
    border-color: rgba(139, 92, 246, 0.18);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 32px rgba(139, 92, 246, 0.08),
        0 0 12px rgba(180, 100, 220, 0.04),
        inset 0 1px 0 rgba(139, 92, 246, 0.12);
    transform: translateY(-1px);
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.card-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card-menu-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.card-menu-btn:hover {
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════
   BREAKDOWN CARD (bottom-left)
   ═══════════════════════════════════════ */

.card-breakdown {
    left: calc(var(--sidebar-width) + 16px);
    bottom: 16px;
    width: 240px;
    animation-delay: 0.1s;
}

.breakdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.breakdown-row:last-of-type {
    border-bottom: none;
}

.breakdown-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}

.breakdown-label svg {
    opacity: 0.6;
}

.breakdown-values {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breakdown-price {
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
}

.breakdown-pct {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--accent-glow);
    color: var(--accent-cyan);
}

/* Source gradient cards */
.source-cards {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

.source-card {
    flex: 1;
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all var(--transition);
}

.source-card svg {
    opacity: 0.8;
}

.source-card-label {
    font-size: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

.source-card-value {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.source-card-unit {
    font-size: 7px;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.source-elec {
    background: linear-gradient(180deg, rgba(245, 166, 35, 0.22), rgba(245, 166, 35, 0.06));
    color: var(--color-electricity);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.source-fuel {
    background: linear-gradient(180deg, rgba(248, 113, 113, 0.22), rgba(248, 113, 113, 0.06));
    color: var(--color-fuel);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.source-trans {
    background: linear-gradient(180deg, rgba(74, 222, 128, 0.22), rgba(74, 222, 128, 0.06));
    color: var(--color-transport);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ═══════════════════════════════════════
   DISTRIBUTION CARD (right side — swaps with country popup)
   ═══════════════════════════════════════ */

.card-distribution {
    right: 24px;
    top: 80px;
    left: auto;
    bottom: auto;
    width: 310px;
    overflow: hidden;
    animation: popupIn 0.3s var(--ease);
}

.card-distribution.hidden-by-popup {
    display: none !important;
}

.distribution-gauges {
    display: flex;
    justify-content: space-around;
    gap: 4px;
    margin-bottom: 14px;
}

.gauge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.gauge-svg {
    width: 80px;
    height: 80px;
}

.gauge-value {
    font-size: 20px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    fill: var(--text-primary);
}

.gauge-label-text {
    font-size: 11px;
    fill: var(--text-secondary);
    font-family: 'Inter', sans-serif;
}

.gauge-name {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
}

.distribution-stats {
    display: flex;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.dist-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dist-stat-icon {
    color: var(--accent-blue);
}

.dist-stat-icon.renewable {
    color: var(--accent-cyan);
}

.dist-stat-value {
    display: block;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.dist-stat-label {
    display: block;
    font-size: 9px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

/* ═══════════════════════════════════════
   PRICE INDEX CARD (bottom-right)
   ═══════════════════════════════════════ */

.card-index {
    right: 24px;
    bottom: 72px;
    width: 200px;
    animation-delay: 0.3s;
}

.index-value-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 14px;
}

.index-big-number {
    font-size: 36px;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1;
    background: linear-gradient(180deg, #ffffff, #a8c4d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.index-unit {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.index-bar-container {
    margin-bottom: 12px;
}

.index-bar {
    position: relative;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    overflow: visible;
}

.index-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--color-electricity), var(--color-fuel));
    transition: width 0.8s var(--ease);
    width: 0%;
}

.index-bar-marker {
    position: absolute;
    top: -3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-cyan);
    border: 2px solid var(--bg-primary);
    box-shadow: 0 0 8px var(--accent-glow-strong);
    transition: left 0.8s var(--ease);
    left: 0%;
}

.index-bar-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 9px;
    color: var(--text-muted);
}

.index-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.index-footer-label {
    font-size: 10px;
    color: var(--text-muted);
}

.index-footer-value {
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
}

/* ═══════════════════════════════════════
   COUNTRY POPUP
   ═══════════════════════════════════════ */

.country-popup {
    position: fixed;
    z-index: 300;
    top: 80px;
    right: 24px;
    background: linear-gradient(160deg, rgba(13, 25, 48, 0.9), rgba(18, 16, 44, 0.88), rgba(13, 25, 48, 0.9));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: var(--radius-lg);
    padding: 18px;
    min-width: 260px;
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.4),
        0 0 24px var(--aurora-shadow),
        inset 0 1px 0 var(--aurora-violet);
    display: none;
    animation: popupIn 0.3s var(--ease);
    transition: box-shadow 0.25s ease;
}

.country-popup:hover {
    background: linear-gradient(160deg, rgba(18, 30, 55, 0.92), rgba(24, 20, 50, 0.9), rgba(18, 30, 55, 0.92));
    border-color: rgba(139, 92, 246, 0.2);
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.4),
        0 0 36px rgba(139, 92, 246, 0.1),
        0 0 14px rgba(180, 100, 220, 0.05),
        inset 0 1px 0 rgba(139, 92, 246, 0.14);
}

@keyframes popupIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.country-popup.visible {
    display: block;
}

.popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.popup-flag {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.popup-flag img {
    display: block;
    width: 28px;
    height: 21px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.popup-country {
    font-size: 15px;
    font-weight: 600;
}

.popup-code {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.popup-close {
    margin-left: auto;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.popup-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.popup-body .popup-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.popup-body .popup-row:last-child {
    border-bottom: none;
}

.popup-row-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.popup-row-value {
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
}

/* ═══════════════════════════════════════
   ACTION BUTTONS (bottom-right)
   ═══════════════════════════════════════ */

.zoom-controls {
    position: fixed;
    bottom: 80px;
    right: 236px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.zoom-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(13, 25, 48, 0.87), rgba(16, 18, 42, 0.85));
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(139, 92, 246, 0.08);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 12px var(--aurora-shadow);
}

.zoom-btn:hover {
    background: linear-gradient(135deg, rgba(20, 32, 56, 0.92), rgba(24, 22, 50, 0.9));
    color: var(--text-primary);
    border-color: rgba(139, 92, 246, 0.18);
    box-shadow: 0 2px 16px rgba(139, 92, 246, 0.08);
}

.zoom-btn:active {
    transform: scale(0.92);
}

.action-buttons {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    display: flex;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 40px;
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

#compareBtn {
    display: none;
}

#compareBtn.btn-visible {
    display: flex;
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: var(--bg-primary);
    box-shadow: 0 4px 16px rgba(0, 212, 170, 0.3);
}

.action-btn.primary:hover {
    box-shadow: 0 6px 24px rgba(0, 212, 170, 0.45);
    transform: translateY(-1px);
}

.action-btn.secondary {
    background: linear-gradient(135deg, rgba(13, 25, 48, 0.85), rgba(16, 18, 42, 0.82));
    color: var(--text-secondary);
    border: 1px solid rgba(139, 92, 246, 0.08);
    box-shadow: 0 2px 12px var(--aurora-shadow);
}

.action-btn.secondary:hover {
    background: linear-gradient(135deg, rgba(20, 32, 56, 0.9), rgba(24, 22, 50, 0.88));
    color: var(--text-primary);
    border-color: rgba(139, 92, 246, 0.18);
    box-shadow: 0 4px 18px rgba(139, 92, 246, 0.08);
}

.action-btn.hcp-toggle {
    background: linear-gradient(135deg, rgba(13, 25, 48, 0.85), rgba(16, 18, 42, 0.82));
    color: var(--text-secondary);
    border: 1px solid rgba(139, 92, 246, 0.08);
    position: relative;
    box-shadow: 0 2px 12px var(--aurora-shadow);
}

.action-btn.hcp-toggle:hover {
    background: linear-gradient(135deg, rgba(20, 32, 56, 0.9), rgba(24, 22, 50, 0.88));
    color: var(--text-primary);
    border-color: rgba(139, 92, 246, 0.18);
    box-shadow: 0 4px 18px rgba(139, 92, 246, 0.08);
}

.action-btn.hcp-toggle.active {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.15), rgba(14, 165, 233, 0.15));
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 212, 170, 0.2);
}

.action-btn.hcp-toggle.active:hover {
    box-shadow: 0 0 18px rgba(0, 212, 170, 0.3);
}

.action-btn.hcp-toggle .hcp-status {
    margin-left: 2px;
}

/* ═══════════════════════════════════════
   ANALYTICS OVERLAY
   ═══════════════════════════════════════ */

.analytics-overlay {
    position: fixed;
    top: 0;
    left: 60px;
    right: 0;
    bottom: 0;
    background: rgba(11, 20, 38, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.analytics-overlay.visible {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.analytics-panel {
    width: 100%;
    max-width: 900px;
    max-height: calc(100vh - 48px);
    background: var(--bg-card);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-glow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: panelSlideIn 0.35s var(--ease);
}

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

.analytics-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.analytics-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 8px;
}

.analytics-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 3px;
}

.analytics-tab {
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.analytics-tab:hover {
    color: var(--text-secondary);
}

.analytics-tab.active {
    background: rgba(0, 212, 170, 0.12);
    color: var(--accent-cyan);
}

.analytics-close {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.analytics-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.analytics-body {
    padding: 18px 22px;
    overflow-y: auto;
    flex: 1;
}

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

.analytics-stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}

.analytics-stat-card .analytics-stat-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.analytics-stat-card .analytics-stat-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.analytics-stat-card.cheapest .analytics-stat-value {
    color: #4ade80;
}

.analytics-stat-card.expensive .analytics-stat-value {
    color: #f87171;
}

.analytics-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.analytics-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.15s ease;
}

.analytics-filter:focus-within {
    border-color: var(--border-glow);
}

.analytics-filter svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.analytics-filter input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 12px;
    font-family: var(--font-body);
}

.analytics-filter input::placeholder {
    color: var(--text-muted);
}

.analytics-sort-btns {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.sort-btn {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 500;
    font-family: var(--font-body);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.sort-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.sort-btn.active {
    background: var(--accent-glow);
    border-color: var(--border-glow);
    color: var(--accent-cyan);
}

.analytics-table-wrap {
    overflow-x: auto;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.analytics-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
}

.analytics-table td {
    padding: 9px 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.analytics-table tbody tr {
    cursor: pointer;
}

.analytics-table tr:hover td {
    background: rgba(0, 212, 170, 0.04);
    color: var(--text-primary);
}

.analytics-table .flag-img {
    width: 18px;
    height: 13px;
    border-radius: 2px;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 6px;
}

.analytics-table .rank-num {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}

.analytics-table .price-cell {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--accent-cyan);
}

/* ═══════════════════════════════════════
   DATA NOTIFICATION
   ═══════════════════════════════════════ */

.data-notification {
    position: fixed;
    bottom: 45px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    z-index: 600;
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-card);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glow);
    border-radius: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: all 0.3s var(--ease);
    pointer-events: none;
    white-space: nowrap;
}

.data-notification.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.data-notification[data-type="loading"] {
    color: var(--accent-cyan);
}

.data-notification[data-type="success"] {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.3);
}

.data-notification[data-type="error"] {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}

/* ═══════════════════════════════════════
   COMPARE MODE
   ═══════════════════════════════════════ */

.compare-toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    z-index: 500;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glow);
    border-radius: 40px;
    padding: 10px 24px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-cyan);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-glow);
    opacity: 0;
    transition: all 0.3s var(--ease);
    pointer-events: none;
    white-space: nowrap;
}

.compare-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Compare button floated above country popup on mobile */
.action-btn.floating-above-popup {
    z-index: 311;
}

.action-btn.compare-active {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
    box-shadow: 0 4px 16px rgba(248, 113, 113, 0.2);
}

.action-btn.compare-active:hover {
    box-shadow: 0 6px 24px rgba(248, 113, 113, 0.3);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.action-btn.shake {
    animation: shake 0.3s ease-in-out 2;
}

/* Compare Overlay */

.compare-overlay {
    position: fixed;
    top: 0;
    left: 60px;
    right: 0;
    bottom: 0;
    background: rgba(11, 20, 38, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.compare-overlay.visible {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.compare-panel {
    width: 100%;
    max-width: 560px;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-glow);
    overflow: hidden;
    animation: panelSlideIn 0.35s var(--ease);
}

.compare-panel-header {
    display: flex;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.compare-panel-title {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.compare-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.compare-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.compare-panel-body {
    padding: 22px;
}

.compare-countries {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.compare-country {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.compare-country img {
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.compare-country-name {
    font-size: 14px;
    font-weight: 600;
}

.compare-vs {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    letter-spacing: 0.1em;
}

.compare-table {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.compare-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-bottom: 1px solid var(--border);
}

.compare-row:last-child {
    border-bottom: none;
}

.compare-header-row {
    background: rgba(255, 255, 255, 0.03);
}

.compare-header-row .compare-val {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.compare-metric {
    padding: 10px 14px;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.compare-val {
    padding: 10px 14px;
    font-size: 13px;
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
}

.compare-val.winner {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.06);
}

.compare-verdict {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-cyan);
    padding: 12px;
    background: var(--accent-glow);
    border-radius: 10px;
    border: 1px solid var(--border-glow);
}

/* ═══════════════════════════════════════
   LOADER
   ═══════════════════════════════════════ */

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

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

.loader-ring {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-top-color: var(--accent-cyan);
    animation: loaderSpin 1s linear infinite;
    margin-bottom: 16px;
    position: relative;
}

.loader-ring-inner {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--accent-blue);
    animation: loaderSpin 0.6s linear infinite reverse;
}

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

.loader p {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* Globe Marker Tooltip */
.globe-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 350;
    padding: 5px 10px;
    background: rgba(10, 18, 36, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.globe-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 1200px) {
    .card-distribution {
        right: 16px;
        width: 240px;
    }

    .card-breakdown {
        bottom: 16px;
        width: calc(50% - var(--sidebar-width) / 2 - 24px);
        max-width: 260px;
    }

    .card-index {
        right: 16px;
        bottom: 72px;
    }
}

@media (max-width: 768px) {
    /* ── Sidebar → bottom bar ── */
    .sidebar {
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        height: 56px;
        flex-direction: row;
        padding: 0 8px;
        border-right: none;
        border-top: 1px solid var(--border);
    }

    .sidebar-logo {
        margin-bottom: 0;
        margin-right: 12px;
    }

    .sidebar-nav {
        flex-direction: row;
        gap: 2px;
    }

    .nav-icon.active::before {
        left: 50%;
        top: -8px;
        transform: translateX(-50%);
        width: 20px;
        height: 3px;
        border-radius: 0 0 3px 3px;
    }

    .sidebar-bottom {
        margin-top: 0;
        margin-left: auto;
        flex-direction: row;
    }

    .sidebar-compare {
        display: none;
    }

    .sidebar-music,
    .sidebar-refresh {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .sidebar-music svg,
    .sidebar-refresh svg {
        width: 16px;
        height: 16px;
    }

    /* ── Header card: full width below search ── */
    .header-card {
        left: 12px;
        right: 12px;
        top: 52px;
        min-width: auto;
        padding: 10px 14px;
    }

    .header-card-top {
        margin-bottom: 8px;
    }

    .header-tabs {
        gap: 0;
    }

    .header-tab {
        padding: 5px 10px;
        font-size: 11px;
    }

    .region-toggle {
        padding: 5px 10px;
        font-size: 11px;
    }

    .currency-btn {
        padding: 4px 8px;
        font-size: 10px;
    }

    /* ── Search pill: top strip ── */
    .search-pill {
        left: 12px;
        right: 12px;
        top: 10px;
        min-width: auto;
        padding: 8px 14px;
    }

    .search-pill input {
        font-size: 13px;
    }

    .search-dropdown {
        max-height: 200px;
    }

    /* ── Hide bottom stat cards ── */
    .card-breakdown,
    .card-distribution,
    .card-index {
        display: none;
    }

    /* ── Action buttons: icons only on mobile, behind country card ── */
    .action-buttons {
        bottom: 68px;
        right: 12px;
        gap: 6px;
        flex-direction: column;
        align-items: flex-end;
        z-index: 290;
    }

    .action-btn {
        padding: 10px;
        font-size: 0;
        gap: 0;
        border-radius: 12px;
    }

    .action-btn svg {
        width: 16px;
        height: 16px;
    }

    .action-btn.hcp-toggle {
        font-size: 11px;
        gap: 5px;
        padding: 8px 14px;
    }

    .action-btn.hcp-toggle .hcp-status {
        display: none;
    }

    /* ── Zoom controls ── */
    .zoom-controls {
        bottom: 68px;
        right: auto;
        left: 12px;
    }

    .zoom-btn {
        width: 32px;
        height: 32px;
    }

    /* ── Country popup: full width ── */
    .country-popup {
        right: 12px;
        left: 12px;
        top: auto;
        bottom: 68px;
        min-width: auto;
        max-height: 50vh;
        overflow-y: auto;
    }

    /* ── Overlays: full screen (sidebar is bottom, not left) ── */
    .analytics-overlay,
    .compare-overlay {
        left: 0;
        bottom: 56px;
        padding: 12px;
    }

    .analytics-panel {
        max-height: calc(100vh - 80px);
        border-radius: var(--radius-md);
    }

    .analytics-header {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .analytics-title {
        font-size: 14px;
    }

    .analytics-tabs {
        order: 3;
        width: 100%;
    }

    .analytics-tab {
        flex: 1;
        text-align: center;
    }

    .analytics-body {
        padding: 12px 16px;
    }

    .analytics-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .compare-panel {
        max-width: 100%;
        border-radius: var(--radius-md);
    }

}

/* ═══════════════════════════════════════
   SMALL PHONES (≤ 480px)
   ═══════════════════════════════════════ */

@media (max-width: 480px) {
    .header-card {
        left: 8px;
        right: 8px;
        top: 48px;
        padding: 8px 12px;
    }

    .search-pill {
        left: 8px;
        right: 8px;
        top: 8px;
        padding: 7px 12px;
    }

    .action-buttons {
        bottom: 64px;
        right: 8px;
        gap: 4px;
    }

    .action-btn {
        padding: 7px 10px;
        font-size: 10px;
    }

    .action-btn svg {
        width: 12px;
        height: 12px;
    }

    .country-popup {
        right: 8px;
        left: 8px;
        bottom: 64px;
        padding: 14px;
    }

    .zoom-controls {
        left: 8px;
        bottom: 64px;
    }

    .sidebar {
        height: 50px;
        padding: 0 4px;
    }

    .sidebar-logo {
        margin-right: 6px;
    }

    .sidebar-logo .logo-text {
        font-size: 12px;
    }

    .nav-icon {
        width: 36px;
        height: 36px;
    }

}

/* ═══════════════════════════════════════
   EXPERIENCE TIP
   ═══════════════════════════════════════ */

.experience-tip {
    position: fixed;
    top: 75%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(13, 25, 48, 0.92), rgba(18, 16, 44, 0.9));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(139, 92, 246, 0.08);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.experience-tip svg {
    color: var(--accent-cyan);
    flex-shrink: 0;
}

.experience-tip.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 1024px) {
    .experience-tip {
        top: 65%;
        font-size: 11px;
        padding: 10px 18px;
    }
}

/* ═══════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════ */

.hidden {
    display: none !important;
}

/* Links */
a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-blue);
}

/* ═══════════════════════════════════════
   SITE FOOTER
   ═══════════════════════════════════════ */

.site-footer {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 350;
    text-align: center;
    font-family: var(--font-body);
    font-size: 0.6rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.25);
    opacity: 1;
    transition: all 0.3s ease;
    pointer-events: auto;
    white-space: nowrap;
    padding: 3px 10px;
    background: transparent;
    border-radius: 10px;
}

.site-footer:active {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.4);
}

.site-footer:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.4);
}

.site-footer .footer-text,
.site-footer .heart {
    display: inline;
}

.site-footer .heart {
    color: #ef4444;
    font-size: 0.65rem;
    margin: 0 0.15rem;
    opacity: 0.3;
    animation: heartbeat 2s ease-in-out infinite;
    transition: opacity 0.3s ease;
}

.site-footer:active .heart,
.site-footer:hover .heart {
    opacity: 1;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.site-footer:hover .heart {
    animation: heartbeat 0.5s ease-in-out infinite;
}

@media (max-width: 768px) {
    .site-footer {
        bottom: 64px;
    }
    .data-notification {
        bottom: 95px;
    }
}

@media (max-width: 480px) {
    .site-footer {
        bottom: 58px;
    }
    .data-notification {
        bottom: 88px;
    }
}
