:root {
    --bg-lab: #0a0a0c;
    --sidebar-bg: #0f0f12;
    --header-bg: #141419;

    --accent-cyan: #06b6d4;
    --accent-glow: rgba(6, 182, 212, 0.4);

    --text-primary: #f0f0f0;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;

    --border: #27272a;
    --border-glow: #3f3f46;

    --card-bg: rgba(24, 24, 27, 0.7);
    --input-bg: #18181b;
}

body {
    background: var(--bg-lab) !important;
    color: var(--text-primary);
    overflow: hidden;
}

.map-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.lab-nav {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    z-index: 100;
}

.map-workspace {
    display: grid;
    grid-template-columns: 320px 1fr;
    flex-grow: 1;
    overflow: hidden;
}

/* Sidebar Styling */
.map-sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
    overflow-y: auto;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-section.grow {
    flex-grow: 1;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
}

.section-header i {
    font-size: 1.25rem;
    color: var(--accent-cyan);
}

/* Layer List */
.layer-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.layer-item i {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.layer-item span {
    flex-grow: 1;
    font-size: 0.85rem;
}

.layer-item:hover {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.05);
}

.layer-item.active {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.1);
}

.layer-item.active i {
    color: var(--accent-cyan);
}

.toggle-switch {
    width: 32px;
    height: 16px;
    background: var(--text-muted);
    border-radius: 100px;
    position: relative;
    transition: background 0.2s;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.layer-item.active .toggle-switch {
    background: var(--accent-cyan);
}

.layer-item.active .toggle-switch::before {
    transform: translateX(16px);
}

/* Analysis Card */
.analysis-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#region-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 0.5rem;
}

.analysis-stat {
    display: flex;
    justify-content: space-between;
}

.analysis-stat span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.analysis-stat strong {
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
}

/* Map Canvas */
.map-canvas-container {
    background: #000;
    position: relative;
    overflow: hidden;
}

#geospatial-canvas {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.map-overlay-tools {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tool-group {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid var(--border);
}

.map-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.25rem;
}

.map-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.coordinate-display {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    border: 1px solid var(--border);
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
}

.coordinate-display span {
    color: var(--accent-cyan);
}

/* Lab Badge */
.lab-badge {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 4px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-icon {
    width: 6px;
    height: 6px;
    background: var(--accent-cyan);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 var(--accent-glow); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(6, 182, 212, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

.btn-block {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}
