/* ========== TERRITORIES PAGE STYLES ========== */

/* Variables unique to territories (extend/override variables.css) */
:root {
    --gold-dim: rgba(201, 162, 39, 0.15);
    --gold-glow: rgba(201, 162, 39, 0.4);
    --green: #22c55e;
    --green-dim: rgba(34, 197, 94, 0.15);
}

/* Navbar Override (territories uses simpler navbar) */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 24px;
    background: rgba(10, 15, 26, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-back {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.nav-back:hover {
    color: var(--gold);
}

/* ========== MAIN LAYOUT ========== */
.main-container {
    display: flex;
    padding-top: 70px;
    min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 320px;
    background: var(--navy-mid);
    border-right: 1px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: calc(100vh - 70px);
}

.sidebar-header {
    margin-bottom: 24px;
}

.sidebar-header h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.sidebar-header h1 .highlight {
    color: var(--gold);
}

.sidebar-header p {
    color: var(--gray-400);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ========== STAT BOXES ========== */
.stats-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-box {
    flex: 1;
    background: var(--navy-deep);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-box.available {
    border-color: rgba(201, 162, 39, 0.3);
}

.stat-box.claimed {
    border-color: rgba(34, 197, 94, 0.3);
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
}

.stat-box.available .stat-number {
    color: var(--gold);
}

.stat-box.claimed .stat-number {
    color: var(--green);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ========== FILTER BUTTONS ========== */
.filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-btn {
    flex: 1;
    padding: 10px;
    background: var(--navy-deep);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--gray-400);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--gold);
    color: var(--white);
}

.filter-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--navy-deep);
}

/* ========== CITY LIST ========== */
.city-list {
    flex: 1;
    overflow-y: auto;
}

.city-list h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-500);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.city-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--navy-deep);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.city-item:hover {
    border-color: var(--gold);
    transform: translateX(4px);
}

.city-item.claimed {
    border-color: rgba(34, 197, 94, 0.3);
}

.city-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.city-dot.available {
    background: var(--gold);
    box-shadow: 0 0 8px var(--gold-glow);
}

.city-dot.claimed {
    background: var(--green);
}

.city-info {
    flex: 1;
}

.city-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.city-status {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.city-item.claimed .city-status {
    color: var(--green);
}

/* ========== SIDEBAR CTA ========== */
.sidebar-cta {
    display: block;
    background: var(--gold);
    color: var(--navy-deep);
    text-align: center;
    padding: 14px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 20px;
    transition: all 0.3s;
}

.sidebar-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--gold-glow);
}

/* ========== MAP CONTAINER ========== */
.map-container {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
    background: var(--navy-deep);
}

/* ========== LEAFLET OVERRIDES ========== */
.leaflet-container {
    background: var(--navy-deep);
    font-family: var(--font-body);
}

.leaflet-popup-content-wrapper {
    background: var(--navy-mid);
    color: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.leaflet-popup-content {
    margin: 16px;
}

.leaflet-popup-tip {
    background: var(--navy-mid);
    border: 1px solid var(--border);
}

.leaflet-control-zoom {
    border: none !important;
}

.leaflet-control-zoom a {
    background: var(--navy-mid) !important;
    color: var(--white) !important;
    border: 1px solid var(--border) !important;
}

.leaflet-control-zoom a:hover {
    background: var(--navy) !important;
    color: var(--gold) !important;
}

/* ========== CUSTOM MARKERS ========== */
.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--white);
    cursor: pointer;
    transition: transform 0.2s;
}

.marker-dot:hover {
    transform: scale(1.3);
}

.marker-dot.available {
    background: var(--gold);
    box-shadow: 0 0 12px var(--gold-glow);
}

.marker-dot.claimed {
    background: var(--green);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

/* ========== POPUP CONTENT ========== */
.popup-content {
    text-align: center;
    min-width: 160px;
}

.popup-city {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.popup-status {
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 12px;
}

.popup-status.available {
    background: var(--gold-dim);
    color: var(--gold);
}

.popup-status.claimed {
    background: var(--green-dim);
    color: var(--green);
}

.popup-cta {
    display: block;
    background: var(--gold);
    color: var(--navy-deep);
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.popup-cta:hover {
    transform: scale(1.02);
}

/* ========== MAP LEGEND ========== */
.map-legend {
    position: absolute;
    bottom: 30px;
    left: 20px;
    background: var(--navy-mid);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    z-index: 500;
}

.legend-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.available {
    background: var(--gold);
}

.legend-dot.claimed {
    background: var(--green);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .main-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .city-list {
        max-height: 200px;
    }

    .map-container {
        height: 60vh;
    }

    .map-legend {
        bottom: 20px;
        left: 10px;
        padding: 12px;
    }
}
