:root {
    /* Light Theme Variables */
    --bg-color: #f8fafc;
    --topbar-bg: rgba(255, 255, 255, 0.9);
    --topbar-border: rgba(0,0,0,0.05);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --shadow: 0 4px 15px rgba(0,0,0,0.05);
    --modal-overlay: rgba(15, 23, 42, 0.4);
    --tip-bg: #ffffff;
    --map-land: #e2e8f0;
    --map-border: #cbd5e1;
    --map-bg: radial-gradient(circle at 50% 50%, #ffffff 0%, #f1f5f9 100%);
}

body.dark-theme {
    /* Dark Theme Variables */
    --bg-color: #0a0f2e;
    --topbar-bg: rgba(10, 15, 46, 0.95);
    --topbar-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --card-bg: #0f172a;
    --card-border: rgba(255,255,255,0.1);
    --shadow: 0 10px 40px rgba(0,0,0,0.4);
    --modal-overlay: rgba(0, 0, 0, 0.8);
    --tip-bg: #0f172a;
    --map-land: #1e293b;
    --map-border: #334155;
    --map-bg: linear-gradient(160deg, #08102b 0%, #0d1a50 50%, #08102b 100%);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    font-family: 'Muli', sans-serif;
    background: var(--bg-color);
    transition: background 0.3s ease;
}
a { text-decoration: none; }

/* ===== FULL-SCREEN MAP ===== */
#map-fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    background: var(--map-bg);
}
#world-map { width: 100%; height: 100%; }

/* ===== FLOATING TOPBAR ===== */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 150;
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    background: var(--topbar-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--topbar-border);
    box-shadow: 0 1px 10px rgba(0,0,0,0.03);
}
.topbar-inner { display: flex; align-items: center; width: 100%; }
.topbar .logo img { height: 42px; width: auto; object-fit: contain; }
.topbar .tagline {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-left: 14px;
    padding-left: 14px;
    border-left: 1px solid var(--card-border);
}
.topbar-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-nav a {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}
.topbar-nav a:hover { color: #0067ed; background: rgba(0,103,237,0.05); }
.topbar-nav a.apply-btn {
    background: #0067ed;
    color: #fff;
    padding: 9px 22px;
    border-radius: 25px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0,103,237,0.2);
    cursor: pointer;
}
.topbar-nav a.apply-btn:hover { background: #0051bf; transform: translateY(-1px); }

/* Theme Toggle Button */
.theme-toggle {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
    transition: all 0.2s;
    margin-right: 10px;
}
.theme-toggle:hover { background: rgba(0,103,237,0.05); color: #0067ed; }

/* Mobile menu toggle */
.hamburger-btn {
    display: none; width: 40px; height: 40px;
    align-items: center; justify-content: center;
    font-size: 20px; color: var(--text-primary);
    cursor: pointer; margin-left: 8px;
}

/* ===== 3 SIDE TABS ===== */
.side-tabs {
    position: fixed; left: 0; top: 50%; transform: translateY(-50%);
    z-index: 200; display: flex; flex-direction: column; gap: 4px;
}
.side-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 54px; padding: 16px 0; cursor: pointer; position: relative;
    transition: width 0.25s cubic-bezier(0.4,0,0.2,1), box-shadow 0.25s;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
}
.side-tab:hover { width: 64px; }
.tab-visa    { background: #0067ed; border-radius: 0 10px 10px 0; }
.tab-ins     { background: #e07b1c; border-radius: 0 10px 10px 0; }
.tab-travel  { background: #16a85f; border-radius: 0 10px 10px 0; }
.side-tab .tab-icon { font-size: 18px; color: #fff; margin-bottom: 6px; }
.side-tab .tab-label {
    font-size: 8px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase;
    color: #fff; writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg);
}

/* Tooltip */
.side-tab::after {
    content: attr(data-tooltip); position: absolute; left: calc(100% + 12px); top: 50%;
    transform: translateY(-50%); background: #1e293b; color: #fff;
    padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 600;
    white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.side-tab::before {
    content: ''; position: absolute; left: calc(100% + 6px); top: 50%;
    transform: translateY(-50%); border: 6px solid transparent;
    border-right-color: #1e293b; opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 201;
}
.side-tab:hover::after, .side-tab:hover::before { opacity: 1; }

/* ===== MAP TOOLTIP ===== */
#map-tip {
    position: fixed; z-index: 500; background: var(--tip-bg); border: 1px solid var(--card-border);
    border-radius: 14px; padding: 14px 18px; pointer-events: none; opacity: 0;
    transition: opacity 0.15s; box-shadow: var(--shadow); min-width: 180px;
}
#map-tip.show { opacity: 1; }
#map-tip .tip-name { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
#map-tip .tip-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 3px 12px; border-radius: 20px; margin-bottom: 6px; }
#map-tip .tip-hint { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

/* ===== BOTTOM LEGEND ===== */
.map-legend {
    position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%);
    z-index: 100; display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
    background: var(--card-bg); padding: 12px 24px; border-radius: 35px;
    border: 1px solid var(--card-border); box-shadow: var(--shadow);
}
.leg-item { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-secondary); font-weight: 600; white-space: nowrap; }
.leg-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ===== SEARCH BOX ===== */
.search-box {
    position: fixed; top: 90px; left: 25px; z-index: 100;
    width: 280px; background: var(--card-bg);
    border: 1px solid var(--card-border); border-radius: 12px;
    box-shadow: var(--shadow); transition: all 0.2s;
}
.search-box:focus-within { border-color: #0067ed; box-shadow: 0 4px 20px rgba(0,103,237,0.15); }
.search-input {
    width: 100%; border: none; background: transparent; padding: 14px 14px 14px 40px;
    font-size: 14px; color: var(--text-primary); font-family: 'Muli', sans-serif;
    border-radius: 12px; outline: none; font-weight: 600;
}
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; }
.suggestions-dropdown {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--card-bg);
    border: 1px solid var(--card-border); border-radius: 12px;
    box-shadow: var(--shadow); max-height: 300px; overflow-y: auto; display: none;
}
.suggestion-item {
    padding: 12px 16px; font-size: 13.5px; color: var(--text-primary);
    cursor: pointer; display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid var(--card-border); font-weight: 500;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover, .suggestion-item.active { background: rgba(0,103,237,0.05); color: #0067ed; }
.suggestion-match { font-weight: 800; color: #0067ed; }

/* ===== COUNTRY COUNT BADGE ===== */
.country-count {
    position: fixed; top: 90px; right: 25px; z-index: 100; background: var(--card-bg);
    border: 1px solid var(--card-border); border-radius: 12px; padding: 12px 18px;
    color: var(--text-secondary); font-size: 12px; font-weight: 600; box-shadow: var(--shadow); text-align: right;
}
.country-count .count-num { font-size: 24px; font-weight: 800; color: #0067ed; display: block; line-height: 1; margin-bottom: 4px; }

/* ===== FOOTER LINKS ===== */
.footer-mini { position: fixed; bottom: 22px; right: 25px; z-index: 100; display: flex; gap: 16px; }
.footer-mini a { font-size: 10px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; transition: color 0.2s; }
.footer-mini a:hover { color: var(--text-secondary); }

.footer-left {
    position: fixed; bottom: 22px; left: 25px; z-index: 100;
    font-size: 10px; color: var(--text-muted); font-weight: 700;
    opacity: 0.6; letter-spacing: 0.5px; text-transform: uppercase;
}

/* ===== MODAL SYSTEM ===== */
.modal-overlay {
    position: fixed; inset: 0; background: var(--modal-overlay);
    z-index: 1000; opacity: 0; pointer-events: none; transition: 0.3s;
    backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
    background: var(--card-bg); width: 100%; max-width: 500px;
    border-radius: 20px; box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    transform: translateY(30px); transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 30px; border: 1px solid var(--card-border);
    max-height: 90vh; overflow-y: auto;
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
.modal-title { font-size: 20px; font-weight: 800; color: var(--text-primary); }
.modal-close { font-size: 24px; cursor: pointer; color: var(--text-muted); transition: 0.2s; }
.modal-close:hover { color: #ef4444; }

/* Form styling */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 6px; }
.form-control {
    width: 100%; background: rgba(0,0,0,0.03); border: 1px solid var(--card-border);
    border-radius: 10px; padding: 12px 14px; font-family: 'Muli', sans-serif;
    font-size: 14px; color: var(--text-primary); transition: all 0.2s;
}
body.dark-theme .form-control { background: rgba(255,255,255,0.05); }
.form-control:focus { outline: none; border-color: #0067ed; box-shadow: 0 0 0 3px rgba(0,103,237,0.1); }
.submit-btn {
    width: 100%; background: #0067ed; color: #fff; padding: 14px;
    border: none; border-radius: 12px; font-size: 15px; font-weight: 700;
    cursor: pointer; transition: 0.2s; margin-top: 10px;
}
.submit-btn:hover { background: #0051bf; transform: translateY(-1px); box-shadow: 0 10px 20px rgba(0,103,237,0.25); }

/* ===== FLASH MESSAGE ===== */
#lead-alert-landing {
    position: fixed; top: 85px; left: 50%; transform: translateX(-50%);
    z-index: 2000; padding: 12px 24px; border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); font-weight: 600; font-size: 14px;
    display: none; transition: 0.3s;
}
.alert-success { background: #22c55e; color: #fff; }

/* ===== MOBILE ===== */
@media (max-width: 800px) {
    .search-box { top: 80px; left: 15px; right: 15px; width: auto; }
    .topbar .tagline { display: none; }
    .hamburger-btn { display: flex; }
    .topbar-nav {
        position: fixed; top: 70px; right: -250px; width: 220px;
        background: var(--card-bg); box-shadow: -5px 5px 15px rgba(0,0,0,0.1);
        border-radius: 0 0 0 16px; border-left: 1px solid var(--card-border); border-bottom: 1px solid var(--card-border);
        flex-direction: column; align-items: flex-start; padding: 15px; margin: 0;
        transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); gap: 5px; z-index: 110;
    }
    .topbar-nav.open { right: 0; }
    .topbar-nav > a:not(.apply-btn) { width: 100%; border-bottom: 1px solid var(--card-border); border-radius: 0; padding: 12px 10px; }
    .topbar-nav > a:not(.apply-btn):last-of-type { border-bottom: none; }
    .topbar-nav { align-items: stretch; }
    
    .side-tab { width: 42px; padding: 12px 0; }
    .side-tab:hover { width: 48px; }
    .side-tab .tab-icon { font-size: 15px; }
    .map-legend { display: none; }
    .country-count { display: none; }
    .modal-box { border-radius: 0; max-height: 100vh; }
}
