:root {
    --bg-dark: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-success: #10b981;
    --glass-bg: rgba(15, 23, 42, 0.75);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(30, 41, 59, 0.8);
    --card-hover: rgba(51, 65, 85, 0.9);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
}

/* Map Container */
#map {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
}

/* Leaflet Dark Theme Adjustments */
.leaflet-container {
    background: #0b0f19;
}

/* Sidebar */
.sidebar {
    position: absolute;
    top: 20px;
    left: 20px;
    bottom: 20px;
    width: 380px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.glass {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.6));
}

header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid var(--glass-border);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

header p span {
    color: var(--text-main);
    font-weight: 600;
}

.btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.primary-btn {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.23);
}

.primary-btn:active {
    transform: translateY(1px);
}

/* Stats */
.stats {
    display: flex;
    padding: 16px 20px;
    gap: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.stat-box {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border: 1px solid var(--glass-border);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 800;
}

#identifiedCount {
    color: var(--accent-success);
}

#pendingCount {
    color: #facc15;
}

/* Controls */
.controls {
    padding: 16px 20px;
}

#searchInput {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

#searchInput:focus {
    border-color: var(--accent-primary);
}

/* List */
.list-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px;
}

.list-container::-webkit-scrollbar {
    width: 6px;
}

.list-container::-webkit-scrollbar-track {
    background: transparent;
}

.list-container::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 3px;
}

/* Client Card */
.client-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: fadeIn 0.4s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

.client-card:hover {
    background: var(--card-hover);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.client-card.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.coords {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

.status-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    background: #334155;
    color: #cbd5e1;
}

.status-badge.identified {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.business-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}

.address {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.correlate-mini-btn {
    margin-top: 10px;
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

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

/* Candidate Select */
.candidate-select {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    appearance: none;
}

.candidate-select:focus {
    border-color: var(--accent-primary);
}

.candidate-select option {
    background: var(--bg-dark);
    color: var(--text-main);
}


/* Animations */
@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Marker Styles */
.custom-div-icon {
    background: transparent;
    border: none;
}

.pin {
    width: 14px;
    height: 14px;
    background: #facc15;
    border-radius: 50%;
    border: 2px solid #1e293b;
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.6);
    transition: all 0.3s ease;
}

.pin.identified {
    background: var(--accent-success);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
    transform: scale(1.2);
}

.pin.active {
    background: #3b82f6;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.8);
    transform: scale(1.5);
    z-index: 1000 !important;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}