/* Global Variables & Reset */
:root {
    --bg-color: #0b0f19;
    --sidebar-bg: rgba(15, 23, 42, 0.75);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --card-bg: rgba(30, 41, 59, 0.5);
    --card-bg-hover: rgba(30, 41, 59, 0.8);
    
    /* Category Colors */
    --color-plot: #10b981;       /* Emerald */
    --color-road: #f59e0b;       /* Amber */
    --color-boundary: #ec4899;   /* Pink */
    --color-other: #8b5cf6;      /* Violet */
    
    --font-header: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

html, body {
    overscroll-behavior: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    touch-action: none;
}

/* Loading Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 400px;
    padding: 2rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(59, 130, 246, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin-bottom: 2rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.brand-title {
    font-family: var(--font-header);
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.animated-gradient {
    background: linear-gradient(to right, #3b82f6, #60a5fa, #2563eb, #3b82f6);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: gradientShift 3s linear infinite;
}

@keyframes gradientShift {
    to { background-position: 200% center; }
}

.loader-status {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.progress-bar-container {
    width: 250px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    width: 100%;
    height: 100vh;
    position: relative;
}

/* Sidebar Styling */
.sidebar {
    width: 360px;
    height: 100%;
    background-color: var(--sidebar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
}

.sidebar-header {
    padding: 1.5rem 1.25rem 1rem 1.25rem;
    border-bottom: 1px solid var(--panel-border);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.logo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.logo-area h2 {
    font-family: var(--font-header);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.accent-text {
    color: var(--accent);
}

.sidebar-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

/* Sidebar Sections */
.sidebar-section {
    padding: 1.25rem;
    border-bottom: 1px solid var(--panel-border);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-title i {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.section-title h3 {
    font-family: var(--font-header);
    font-size: 0.95rem;
    font-weight: 600;
}

/* Search Controls */
.search-section {
    position: relative;
}

.search-box-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 0 0.75rem;
    height: 44px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.search-box-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.search-box-wrapper input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
    height: 100%;
}

.clear-btn {
    background: none;
    border: none;
    outline: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    color: var(--text-primary);
}

.clear-btn.hidden {
    display: none;
}

/* Search Suggestions Autocomplete */
.suggestions-list {
    position: absolute;
    top: calc(100% - 10px);
    left: 1.25rem;
    right: 1.25rem;
    background-color: #1e293b;
    border: 1px solid var(--panel-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.suggestions-list.hidden {
    display: none;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background-color 0.2s;
}

.suggestion-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.suggestion-item:hover {
    background-color: rgba(59, 130, 246, 0.15);
}

.suggestion-main {
    display: flex;
    flex-direction: column;
}

.suggestion-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.suggestion-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.suggestion-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
}

/* Info Panel Card */
.info-card-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1rem;
    border: 1px dashed var(--panel-border);
    border-radius: 8px;
    background-color: rgba(15, 23, 42, 0.3);
}

.placeholder-icon {
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.info-card-placeholder p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.info-card {
    background-color: var(--card-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 1rem;
    transition: background-color 0.3s;
    animation: slideIn 0.3s ease-out;
}

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

.info-card.hidden {
    display: none;
}

.info-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
}

.info-card-header h4 {
    font-family: var(--font-header);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    background-color: var(--accent);
    color: white;
}

.data-row {
    margin-bottom: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.data-row:last-child {
    margin-bottom: 0;
}

.data-row .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-row .value {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.text-guj {
    font-family: var(--font-body); /* Supports Unicode Gujarati natively */
    color: #38bdf8 !important;
    font-weight: 500;
}

.font-tag {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-size: 0.75rem;
    display: inline-block;
    width: fit-content;
}

.info-card-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    outline: none;
    border-radius: 6px;
    font-family: var(--font-header);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

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

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

/* Legend & Highlights Control */
.layers-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.layer-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.85rem;
}

.layer-item input {
    display: none;
}

.custom-checkbox {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--panel-border);
    margin-right: 0.75rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.25s, border-color 0.25s;
    position: relative;
}

.layer-item input:checked + .custom-checkbox::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background-color: #fff;
    position: absolute;
}

.cb-plot { background-color: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.4); }
.layer-item input:checked + .cb-plot { background-color: var(--color-plot); border-color: var(--color-plot); }

.cb-road { background-color: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.4); }
.layer-item input:checked + .cb-road { background-color: var(--color-road); border-color: var(--color-road); }

.cb-boundary { background-color: rgba(236, 72, 153, 0.1); border-color: rgba(236, 72, 153, 0.4); }
.layer-item input:checked + .cb-boundary { background-color: var(--color-boundary); border-color: var(--color-boundary); }

.cb-other { background-color: rgba(139, 92, 246, 0.1); border-color: rgba(139, 92, 246, 0.4); }
.layer-item input:checked + .cb-other { background-color: var(--color-other); border-color: var(--color-other); }

.layer-name {
    color: var(--text-secondary);
    transition: color 0.2s;
    flex-grow: 1;
}

.layer-item:hover .layer-name {
    color: var(--text-primary);
}

.layer-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.05);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-family: var(--font-body);
}

/* Quick Navigation */
.quick-nav-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-chip {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
}

.nav-chip i {
    width: 12px;
    height: 12px;
}

.nav-chip:hover {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-1px);
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--panel-border);
    background-color: rgba(10, 15, 30, 0.4);
}

.footer-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}

.footer-stat-item {
    display: flex;
    gap: 0.25rem;
}

.stat-lbl {
    color: var(--text-secondary);
}

.stat-val {
    font-weight: 600;
}

.text-success {
    color: #10b981;
}

/* Viewport Area */
.viewport {
    flex-grow: 1;
    height: 100%;
    position: relative;
    background-color: #080a0f;
    overflow: hidden;
}

.canvas-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    cursor: grab;
    touch-action: none;
}

.canvas-container:active {
    cursor: grabbing;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* Floating Navigation Controls */
.floating-controls {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 100;
}

.control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(30, 41, 59, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.2s;
}

.control-btn:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.control-btn i {
    width: 18px;
    height: 18px;
}

/* Compass Widget */
.compass-widget {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    pointer-events: none;
}

.compass-dial {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid var(--panel-border);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.compass-n {
    font-family: var(--font-header);
    font-size: 0.7rem;
    font-weight: 700;
    color: #ef4444;
    position: absolute;
    top: 3px;
}

.compass-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 18px solid #ef4444;
    position: absolute;
    top: 12px;
}

/* Coordinates & Zoom Display */
.coords-display {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    display: flex;
    gap: 0.75rem;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid var(--panel-border);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.coord-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.coord-item i {
    width: 12px;
    height: 12px;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Village Selection Dropdown & Card */
.village-section {
    position: relative;
}

.select-box-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 0 0.75rem;
    height: 44px;
    transition: border-color 0.25s, box-shadow 0.25s;
    margin-bottom: 0.5rem;
}

.select-box-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.select-icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.select-box-wrapper select {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
    height: 100%;
    cursor: pointer;
    font-family: var(--font-body);
}

.select-box-wrapper select option {
    background-color: #1e293b;
    color: var(--text-primary);
}

.village-stats-card {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 0.5rem;
    animation: fadeIn 0.25s ease-out;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

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

/* ----------------------------------------------------
   Mobile Responsive Adjustments (Premium Mobile UX)
   ---------------------------------------------------- */
@media (max-width: 768px) {
    /* Main Layout */
    .dashboard-container {
        flex-direction: column;
        overflow: hidden;
    }

    /* Absolute Drawer Sidebar */
    .sidebar {
        position: absolute;
        top: 0;
        left: -320px; /* Initially hidden */
        width: 300px;
        height: 100%;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        box-shadow: 15px 0 30px rgba(0, 0, 0, 0.5);
        border-right: 1px solid var(--panel-border);
        background-color: rgba(11, 15, 25, 0.95); /* Higher opacity for mobile visibility */
        touch-action: auto; /* Override body touch-action:none to allow sidebar interactions */
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar.active {
        left: 0;
    }

    /* Sidebar Close Button */
    .sidebar-close-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 1.25rem;
        right: 1.25rem;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--panel-border);
        transition: all 0.2s;
        z-index: 1001;
        cursor: pointer;
    }

    .sidebar-close-btn:hover {
        background-color: rgba(239, 68, 68, 0.2);
        color: #f87171;
    }

    .sidebar-header {
        padding-right: 3.5rem; /* Make space for close button */
    }

    /* Floating Viewport menu toggle */
    .mobile-menu-btn {
        display: flex !important;
        position: absolute;
        top: 1rem;
        left: 1rem;
        width: 44px;
        height: 44px;
        border-radius: 12px;
        background-color: rgba(15, 23, 42, 0.8);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid var(--panel-border);
        color: var(--text-primary);
        justify-content: center;
        align-items: center;
        z-index: 900;
        cursor: pointer;
        box-shadow: var(--shadow-lg);
        transition: all 0.2s;
    }

    .mobile-menu-btn:hover {
        background-color: var(--accent);
        border-color: var(--accent);
    }

    /* Background overlay backdrop */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 999;
        transition: opacity 0.3s ease, visibility 0.3s;
    }

    .sidebar-overlay.hidden {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .sidebar-overlay:not(.hidden) {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Hide standard Info Panel inside Sidebar on Mobile */
    .sidebar .info-section {
        display: none !important;
    }

    /* Premium Slide-Up Bottom Sheet for Mobile Details */
    .mobile-info-panel {
        position: absolute;
        bottom: 1.5rem;
        left: 1rem;
        right: 1rem;
        background-color: rgba(15, 23, 42, 0.9);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--panel-border);
        border-radius: 16px;
        padding: 1.25rem;
        z-index: 950;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
        transform: translateY(0);
        opacity: 1;
    }

    .mobile-info-panel.hidden {
        transform: translateY(120%);
        opacity: 0;
        pointer-events: none;
    }

    .mobile-info-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.75rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 0.5rem;
        padding-right: 2rem; /* space for close button */
    }

    .mobile-info-header h4 {
        font-family: var(--font-header);
        font-size: 1.05rem;
        font-weight: 600;
        color: var(--text-primary);
    }

    .close-sheet-btn {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: none;
        border: none;
        outline: none;
        color: var(--text-secondary);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.05);
        transition: all 0.2s;
    }

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

    .mobile-data-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .mobile-data-grid .data-row {
        margin-bottom: 0;
    }

    .mobile-data-grid .data-row:nth-child(3),
    .mobile-data-grid .data-row:nth-child(2) {
        grid-column: span 2; /* Gujarati & English span full width */
    }

    /* Floating Viewport controls positioning */
    .floating-controls {
        bottom: auto;
        top: 1rem;
        right: 1rem;
        gap: 0.4rem;
    }

    .control-btn {
        width: 38px;
        height: 38px;
    }

    /* Compass position adjustment */
    .compass-widget {
        top: 1.25rem;
        right: 4.25rem;
    }

    .compass-dial {
        width: 38px;
        height: 38px;
    }

    .compass-arrow {
        top: 8px;
        border-bottom-width: 14px;
        border-left-width: 4px;
        border-right-width: 4px;
    }

    .compass-n {
        top: 1px;
        font-size: 0.6rem;
    }

    /* Status Bar placement on mobile */
    .coords-display {
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 2rem);
        justify-content: space-around;
        padding: 0.35rem 0.5rem;
        pointer-events: none; /* Let clicks pass through coordinates display */
    }
}

/* Premium Custom Select Dropdown */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 0.5rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 0 1rem;
    height: 44px;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.25s, box-shadow 0.25s;
    user-select: none;
    outline: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.custom-select-trigger:hover,
.custom-select-trigger:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.select-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    pointer-events: none;
}

.custom-select-wrapper.open .select-chevron {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background-color: #1e293b;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    z-index: 150;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    animation: dropdownFadeIn 0.2s ease-out;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.custom-select-options.hidden {
    display: none;
}

.custom-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: background-color 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover,
.custom-option:active {
    background-color: rgba(59, 130, 246, 0.15);
    color: white;
}

.custom-option.selected {
    background-color: var(--accent);
    color: white;
}

