/* =============== CSS Variables & Theme (Dark by default) =============== */
:root {
    /* Deep Navy */
    --bg-color: #0a0f1e;
    --bg-surface: #151d30;
    --bg-surface-hover: #1e293f;
    --bg-glass: rgba(21, 29, 48, 0.7);
    --border-color: #27344f;

    /* Typography */
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;

    /* Accents */
    --accent-cyan: #00e5ff;
    --accent-cyan-glow: rgba(0, 229, 255, 0.2);
    --accent-amber: #ffab00;
    --status-green: #10b981;
    --status-red: #ef4444;

    /* Spacing & Sizes */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Fonts */
    --font-ui: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* Light Theme Variables */
.theme-light {
    --bg-color: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --border-color: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent-cyan: #0284c7;
    --accent-cyan-glow: rgba(2, 132, 199, 0.1);
}

/* =============== CSS Reset & Base styling =============== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-ui);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

ul {
    list-style: none;
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.no-link {
    color: inherit;
    text-decoration: none;
}

.no-link:hover {
    text-decoration: none;
    cursor: default;
}

/* Typography */
h1,
h2,
h3,
h4 {
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.mt-4 {
    margin-top: var(--spacing-md);
}

/* =============== Buttons & Inputs =============== */
.btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: var(--bg-surface-hover);
    color: var(--text-main);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
}

.btn-outline:hover {
    background: var(--accent-cyan-glow);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--bg-surface-hover);
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-main);
    font-family: var(--font-ui);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px var(--accent-cyan-glow);
}

/* =============== Header & Navigation =============== */
.app-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0 var(--spacing-md);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.antenna-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-cyan);
}

.logo-text {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    margin: 0;
    font-weight: 700;
}

.main-nav {
    display: flex;
    height: 100%;
    gap: var(--spacing-sm);
}

.nav-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0 var(--spacing-sm);
    cursor: pointer;
    height: 100%;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-tab:hover {
    color: var(--text-main);
}

.nav-tab.active {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
}

.header-utilities {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.location-display {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* =============== Layout & Structure =============== */
.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.tab-pane {
    display: none;
    flex: 1;
}

/* =============== Ad Placement Styling =============== */
.ad-slot {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) 0;
    margin: var(--spacing-sm) 0;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.ad-slot:hover {
    opacity: 0.9;
}

.ad-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.ad-leaderboard {
    max-width: 728px;
    min-height: 90px;
    margin: var(--spacing-md) auto;
}

.ad-anchor-mobile {
    display: none;
    position: sticky;
    bottom: 0;
    z-index: 1000;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    border-radius: 0;
    margin: 0;
}

@media (max-width: 768px) {
    .ad-anchor-mobile {
        display: flex;
    }
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-lg);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.split-layout {
    display: flex;
    gap: var(--spacing-lg);
    flex: 1;
    height: calc(100vh - 120px);
    /* rough header/footer diff */
}

.sidebar {
    width: 300px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.filter-panel {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-list {
    flex: 1;
    overflow-y: auto;
}

.main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.map-container {
    flex: 1;
    background: var(--bg-surface);
}

.full-height-map {
    height: calc(100vh - 120px);
}

/* =============== Components =============== */
/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: var(--spacing-md);
}

/* Glass Card overlay */
.floating-overlay {
    position: absolute;
    top: var(--spacing-lg);
    z-index: 1000;
}

.floating-overlay.right {
    right: var(--spacing-lg);
}

.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    width: 300px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Badges */
.badge {
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-amber {
    background: rgba(255, 171, 0, 0.1);
    color: var(--accent-amber);
    border: 1px solid rgba(255, 171, 0, 0.3);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

/* Stats Bar */
.stats-bar {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    gap: var(--spacing-md);
}

.stat-item {
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    padding: var(--spacing-sm) var(--spacing-lg);
}

.stat-val {
    display: block;
    font-size: 1.5rem;
    color: var(--text-main);
    font-weight: 700;
    font-family: var(--font-mono);
}

/* Tables */
.table-container {
    overflow-x: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: rgba(0, 0, 0, 0.2);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
}

/* Utility classes */
.hidden {
    display: none !important;
}

.skeleton-loader {
    height: 40px;
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-surface-hover) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-sm);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* =============== Ads & Footer =============== */
.ad-slot {
    background: var(--bg-surface-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border: 1px dashed var(--border-color);
}

.ad-leaderboard {
    height: 90px;
    max-width: 728px;
    margin: var(--spacing-md) auto;
}

.ad-rectangle {
    height: 250px;
    margin: var(--spacing-md);
    flex-shrink: 0;
}

.app-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-md);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-links {
    margin-top: var(--spacing-sm);
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: var(--bg-surface);
        border-top: 1px solid var(--border-color);
        justify-content: space-around;
        padding: 0;
        z-index: 1000;
    }

    .header-utilities {
        display: none;
    }

    .split-layout {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        max-height: 400px;
    }

    .floating-overlay {
        position: relative;
        top: 0;
        right: 0;
        left: 0;
        width: 100%;
        margin-top: var(--spacing-md);
    }

    .glass-card {
        width: 100%;
    }

    main {
        padding-bottom: 80px;
    }
}