:root {
    --bg-dark: #0f111a;
    --bg-sidebar: rgba(15, 17, 26, 0.92);
    --primary: #ff3b30;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── RTL ──────────────────────────────────────────────────── */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .modern-select {
    background-position: left 12px top 50%;
    padding: 10px 14px 10px 30px;
}

[dir="rtl"] #right-panel {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid var(--glass-border);
    transform: translateX(-100%);
}

[dir="rtl"] #right-panel.hidden {
    transform: translateX(-100%);
}

[dir="rtl"] #right-panel:not(.hidden) {
    transform: translateX(0);
}

[dir="rtl"] .overlay-glass {
    right: auto;
    left: 24px;
}

[dir="rtl"] .map-legend {
    right: auto;
    left: 24px;
}

[dir="rtl"] .feed-item::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .lang-select {
    padding: 6px 10px 6px 24px;
    background-position: left 8px top 50%;
}

/* ─── Header ───────────────────────────────────────────────── */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lang-select {
    width: auto;
    min-width: 60px;
    padding: 6px 24px 6px 10px;
    background-position: right 8px top 50%;
}

/* ─── App Layout ───────────────────────────────────────────── */
#app {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ─── Sidebar ──────────────────────────────────────────────── */
#sidebar {
    width: 380px;
    min-width: 320px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
}

header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
}

header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #fff, #a1a1aa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.header-controls {
    margin-top: 12px;
}

.modern-select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px top 50%;
    background-size: 10px auto;
}

.modern-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.08);
}

.modern-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 59, 48, 0.2);
}

.modern-select option {
    background: var(--bg-dark);
    color: var(--text-main);
    padding: 10px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 59, 48, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
    }
}

/* ─── Sidebar Content & Sections ───────────────────────────── */
#sidebar-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

#sidebar-content::-webkit-scrollbar {
    width: 6px;
}

#sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

#sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.2s;
    user-select: none;
    min-height: 44px;
}

.section-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.section-header h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    flex: 1;
    pointer-events: none;
}

.section-header span {
    pointer-events: none;
}

.toggle-icon {
    color: var(--text-muted);
    font-size: 0.7rem;
    transition: transform 0.3s;
    pointer-events: none;
}

.sidebar-section.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.sidebar-section.collapsed .section-body {
    display: none;
}

.section-body {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Feed Container ───────────────────────────────────────── */
#feed-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

#feed-container::-webkit-scrollbar {
    width: 6px;
}

#feed-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

#feed-container::-webkit-scrollbar-track {
    background: transparent;
}

.no-data {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--glass-border);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.sidebar-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.sidebar-footer a:hover {
    color: #ff6b64;
}

/* ─── Feed Items ───────────────────────────────────────────── */
.feed-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.feed-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
    transform-origin: bottom;
}

.feed-item:hover::before,
.feed-item.active::before {
    transform: scaleY(1);
}

.feed-item:hover,
.feed-item.active {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.feed-location {
    font-size: 0.7rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-weight: 700;
}

.loc-dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    flex-shrink: 0;
}

.event-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.mini-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: capitalize;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

.event-badge {
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 4px;
    color: #fff;
    font-weight: 600;
    text-transform: capitalize;
    display: inline-block;
    margin-bottom: 8px;
}

.feed-item h4 {
    font-size: 0.9rem;
    margin-bottom: 6px;
    line-height: 1.4;
    color: #fff;
}

.feed-item p {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
    line-height: 1.5;
}

.feed-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
}

.feed-meta a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.feed-meta a:hover {
    color: #60a5fa;
}

/* ─── Market Cards ─────────────────────────────────────────── */
.market-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
}

.market-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.market-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.market-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.market-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.market-name {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.market-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.market-change {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.market-change.up {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.market-change.down {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ─── Tensions ─────────────────────────────────────────────── */
.tensions-list {
    padding: 0 12px 8px;
}

.tension-header {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
    padding-top: 4px;
}

.tension-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.tension-item.high {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.tension-item.elevated {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.tension-country {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    min-width: 60px;
}

.tension-reason {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex: 1;
}

.tension-badge {
    font-size: 0.55rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.tension-badge.high {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.tension-badge.elevated {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.market-updated {
    padding: 6px 12px;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: right;
}

/* ─── Warnings Cards ───────────────────────────────────────── */
#warnings-container {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.warning-count-badge {
    font-size: 0.65rem;
    background: var(--primary);
    color: #fff;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.warning-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
}

.warning-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.warning-card.critical::before {
    background: #ef4444;
}

.warning-card.high::before {
    background: #f59e0b;
}

.warning-card.medium::before {
    background: #3b82f6;
}

.warning-card.critical {
    border-color: rgba(239, 68, 68, 0.2);
}

.warning-card.high {
    border-color: rgba(245, 158, 11, 0.2);
}

.warning-card.medium {
    border-color: rgba(59, 130, 246, 0.15);
}

.warning-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.severity-badge {
    font-size: 0.55rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-badge.critical {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.severity-badge.high {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.severity-badge.medium {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.warning-country {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.warning-card h4 {
    font-size: 0.85rem;
    color: #fff;
    margin-bottom: 6px;
    line-height: 1.4;
}

.warning-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 10px;
}

.warning-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: #64748b;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}

.warning-meta a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
}

.warning-meta a:hover {
    color: #60a5fa;
}

/* ─── Map Area ─────────────────────────────────────────────── */
#map-container {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
    background: #000;
}

/* ─── Overlay Stats ────────────────────────────────────────── */
.overlay-glass {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(15, 17, 26, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px 20px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* ─── Map Legend ───────────────────────────────────────────── */
.map-legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(15, 17, 26, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 14px;
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.legend-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.legend-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    color: var(--text-main);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.legend-dot.missile {
    background: #ff1744;
    box-shadow: 0 0 6px rgba(255, 23, 68, 0.5);
}

.legend-dot.airstrike {
    background: #ff9100;
    box-shadow: 0 0 6px rgba(255, 145, 0, 0.5);
}

.legend-dot.drone_strike {
    background: #d500f9;
    box-shadow: 0 0 6px rgba(213, 0, 249, 0.5);
}

.legend-dot.troop_movement {
    background: #ff6d00;
    box-shadow: 0 0 6px rgba(255, 109, 0, 0.5);
}

.legend-dot.shelling {
    background: #ffd600;
    box-shadow: 0 0 6px rgba(255, 214, 0, 0.5);
}

.legend-dot.conflict {
    background: #ff3b30;
    box-shadow: 0 0 6px rgba(255, 59, 48, 0.5);
}

/* ─── Custom Marker CSS ────────────────────────────────────── */
.marker-pin {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px rgba(255, 59, 48, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.8);
    z-index: 2;
}

.marker-pulse {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.4);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: markerPulse 2s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8);
    z-index: 1;
}

.marker-label {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
    padding: 1px 4px;
    border-radius: 3px;
    z-index: 3;
    white-space: nowrap;
    pointer-events: none;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ─── Event Summary Bar (country detail panel) ─────────────── */
.event-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
}

.event-summary-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.event-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.event-chip-label {
    font-size: 0.7rem;
    color: var(--text-main);
    font-weight: 600;
    text-transform: capitalize;
}

.event-chip-count {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 700;
}

@keyframes markerPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* ─── Conflict Zone Cards ──────────────────────────────────── */
.zone-card {
    padding: 12px 14px;
    margin: 6px 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.25s;
}

.zone-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.zone-card.active {
    border-color: var(--primary);
    background: rgba(255, 59, 48, 0.08);
    box-shadow: 0 0 15px rgba(255, 59, 48, 0.15);
}

.zone-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.zone-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
}

.zone-status {
    font-size: 0.55rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.zone-status.active {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

.zone-status.escalating {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.zone-parties {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.zone-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.zone-chip {
    font-size: 0.55rem;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
}

/* ─── Troop Markers ────────────────────────────────────────── */
.troop-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(15, 17, 26, 0.85);
}

.troop-inner {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: block;
}

.troop-label {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 6px;
    font-weight: 800;
    color: inherit;
    white-space: nowrap;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* ─── Shelling Markers ─────────────────────────────────────── */
.shelling-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 17, 26, 0.7);
    position: relative;
}

.shelling-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: block;
    animation: shellingPulse 1.5s infinite;
}

@keyframes shellingPulse {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* ─── Arrow Tooltips ───────────────────────────────────────── */
.arrow-tooltip {
    background: rgba(15, 17, 26, 0.9) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-main) !important;
    font-size: 0.7rem !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.arrow-tooltip::before {
    border-top-color: rgba(15, 17, 26, 0.9) !important;
}

.arrow-head {
    background: none !important;
    border: none !important;
}

/* Arrow line animation */
.arrow-line {
    animation: arrowDash 2s linear infinite;
}

@keyframes arrowDash {
    to {
        stroke-dashoffset: -24;
    }
}

/* ─── Zone Detail Panel ────────────────────────────────────── */
.zone-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

.back-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 16px;
    transition: all 0.2s;
    width: 100%;
    text-align: center;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.zone-movements-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.zone-group {
    border-radius: 8px;
    overflow: hidden;
}

.zone-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    text-transform: capitalize;
}

.zone-group-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.zone-group-count {
    margin-left: auto;
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 5px;
    border-radius: 4px;
}

.zone-movement-item {
    padding: 6px 10px 6px 14px;
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.zone-side {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* ─── Leaflet Popup Overrides ──────────────────────────────── */
.custom-popup .leaflet-popup-content-wrapper {
    background: rgba(20, 24, 36, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    padding: 0;
}

.custom-popup .leaflet-popup-content {
    margin: 0;
    padding: 14px;
    font-family: 'Inter', sans-serif;
}

.custom-popup .leaflet-popup-tip-container {
    overflow: visible;
}

.custom-popup .leaflet-popup-tip {
    background: rgba(20, 24, 36, 0.9);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
}

.popup-glass h3 {
    font-size: 0.7rem;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 6px;
    margin-top: 0;
    letter-spacing: 1px;
    font-weight: 700;
}

.popup-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    color: #fff;
}

.popup-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 6px;
    transition: all 0.2s ease;
    min-height: 36px;
    line-height: 24px;
}

.popup-link:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.leaflet-container a.leaflet-popup-close-button {
    color: var(--text-muted);
    padding: 8px;
    font-size: 1.4rem;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: #fff;
}

/* ─── Right Panel ──────────────────────────────────────────── */
#right-panel {
    width: 400px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
}

#right-panel.hidden {
    transform: translateX(100%);
}

.right-header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.right-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

#close-panel {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#close-panel:hover {
    color: #fff;
}

#right-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

#right-panel-content::-webkit-scrollbar {
    width: 6px;
}

#right-panel-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

#right-panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.country-news-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 16px;
    position: relative;
}

.country-news-card h4 {
    font-size: 0.95rem;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.4;
}

.country-news-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

.country-news-card .mini-badge {
    margin-bottom: 8px;
}

.country-news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #64748b;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
}

.country-news-meta a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
}

.country-news-meta a:hover {
    color: #60a5fa;
}

/* ─── Mobile Navigation ────────────────────────────────────── */
#mobile-nav {
    display: none;
}

/* ─── Mobile Responsiveness ────────────────────────────────── */
@media (max-width: 768px) {
    #app {
        flex-direction: column;
    }

    #mobile-nav {
        display: flex;
        width: 100%;
        background: var(--bg-sidebar);
        border-top: 1px solid var(--glass-border);
        z-index: 5000;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 6px 12px;
        padding-bottom: calc(6px + var(--safe-bottom));
        gap: 8px;
        position: fixed;
        bottom: 0;
        left: 0;
    }

    #mobile-nav button {
        flex: 1;
        padding: 10px 6px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
        color: var(--text-muted);
        border-radius: 10px;
        font-weight: 600;
        font-family: inherit;
        font-size: 0.7rem;
        cursor: pointer;
        transition: all 0.2s;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
    }

    #mobile-nav button .nav-icon {
        font-size: 1.1rem;
    }

    #mobile-nav button.active {
        background: rgba(255, 59, 48, 0.1);
        border-color: var(--primary);
        color: #fff;
    }

    #map-container {
        width: 100%;
        height: calc(100vh - 56px - var(--safe-bottom));
        order: 1;
    }

    #sidebar {
        width: 100%;
        height: calc(100vh - 56px - var(--safe-bottom));
        order: 2;
        border-right: none;
        display: none;
        background: var(--bg-dark);
        z-index: 2000;
        position: absolute;
        top: 0;
        left: 0;
    }

    /* Show-list state: sidebar shows, map hides */
    #app.show-list #sidebar {
        display: flex;
    }

    #app.show-list #map-container {
        display: none;
    }

    /* Show-alerts state: same UI but different sidebar sections active */
    #app.show-alerts #sidebar {
        display: flex;
    }

    #app.show-alerts #map-container {
        display: none;
    }

    /* On mobile, hide non-active sections */
    #app.show-list #feed-section {
        display: block;
    }

    #app.show-list #markets-section {
        display: none;
    }

    #app.show-list #warnings-section {
        display: none;
    }

    #app.show-alerts #feed-section {
        display: none;
    }

    #app.show-alerts #markets-section {
        display: block;
    }

    #app.show-alerts #warnings-section {
        display: block;
    }

    /* Desktop: all sections visible */
    .sidebar-section {
        display: block;
    }

    .overlay-glass {
        top: 10px;
        right: 10px;
        padding: 10px 14px;
    }

    [dir="rtl"] .overlay-glass {
        top: 10px;
        left: 10px;
        right: auto;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .map-legend {
        bottom: 10px;
        right: 10px;
        padding: 8px 10px;
    }

    .legend-items {
        gap: 4px 10px;
    }

    .legend-item {
        font-size: 0.6rem;
    }

    #right-panel {
        width: 100%;
        height: calc(100vh - 56px - var(--safe-bottom));
        z-index: 3000;
    }

    .right-header {
        padding: 14px;
    }

    header {
        padding: 14px;
    }

    .feed-item {
        padding: 12px;
    }

    .market-card {
        padding: 10px 12px;
    }

    .warning-card {
        padding: 12px;
    }

    /* Improved touch targets */
    .modern-select {
        min-height: 44px;
        font-size: 16px;
        /* Prevents iOS zoom on focus */
    }
}

/* Extra-small screens */
@media (max-width: 380px) {
    header h1 {
        font-size: 1.2rem;
    }

    .market-price {
        font-size: 0.95rem;
    }

    .legend-items {
        grid-template-columns: 1fr;
    }
}

/* Tablet landscape */
@media (min-width: 769px) and (max-width: 1100px) {
    #sidebar {
        width: 320px;
        min-width: 280px;
    }

    #right-panel {
        width: 350px;
    }
}

/* Leaflet zoom buttons style fix */
.leaflet-control-zoom a {
    background: rgba(15, 17, 26, 0.8) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--glass-border) !important;
    min-width: 36px;
    min-height: 36px;
    line-height: 36px !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}