/* Root Variables */
:root {
    --primary-color: #60a5fa;
    --secondary-color: #34d399;
    --danger-color: #f87171;
    --light-gray: #1f2937;
    --dark-gray: #e5e7eb;
    --page-background: #0b1120;
    --panel-background: #111827;
    --panel-border: #273449;
    --muted-text: #9ca3af;
    --border-radius: 8px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--page-background);
    color: var(--dark-gray);
}

/* Container Layout */
.container {
    display: flex;
    height: 100vh;
    width: 100%;
}

.map-mode .debug-only {
    display: none;
}

/* Sidebar */
.sidebar {
    width: 350px;
    background: var(--panel-background);
    padding: 20px;
    overflow-y: auto;
    box-shadow: var(--shadow);
    border-right: 1px solid var(--panel-border);
}

.sidebar-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--panel-border);
}

.sidebar-header h1 {
    font-size: 24px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header i {
    font-size: 28px;
}

/* Info Panel */
.info-panel {
    background: var(--light-gray);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.info-panel h2 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--dark-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.location-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.info-item .label {
    font-weight: 600;
    color: var(--muted-text);
    font-size: 13px;
}

.info-item .value {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 14px;
    word-break: break-all;
}

/* Controls */
.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn i {
    font-size: 14px;
}

/* Settings */
.settings {
    background: #0f172a;
    border: 1px solid var(--panel-border);
    padding: 15px;
    border-radius: var(--border-radius);
}

.settings h3 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--dark-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 14px;
}

.settings label:last-child {
    margin-bottom: 0;
}

.settings input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Map Container */
.map-container {
    flex: 1;
    background: #1f2937;
    position: relative;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
}

.bus-marker {
    color: #fbbf24;
    font-size: 28px;
    line-height: 32px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.75);
}

/* Leaflet Overrides */
.leaflet-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.leaflet-popup-content-wrapper {
    background: #111827;
    color: #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-tip {
    background: #111827;
}

.leaflet-control {
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.leaflet-control-zoom {
    border: none;
    background: #111827;
}

.leaflet-control-zoom a {
    background-color: #111827;
    border: 1px solid var(--panel-border);
    width: 36px;
    height: 36px;
    line-height: 36px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 18px;
}

.leaflet-control-zoom a:hover {
    background-color: var(--light-gray);
}

.leaflet-control-attribution {
    background: rgba(17, 24, 39, 0.85) !important;
    color: #9ca3af;
}

.leaflet-control-attribution a {
    color: var(--primary-color);
}

.leaflet-marker-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Status Indicator */
.status-indicator {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: #111827;
    color: var(--dark-gray);
    padding: 12px 16px;
    border-radius: 50px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 1000;
}

.status-indicator i {
    font-size: 10px;
    animation: pulse 2s infinite;
}

.status-indicator.connected i {
    color: var(--secondary-color);
}

.status-indicator.disconnected i {
    color: var(--danger-color);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 250px;
        overflow-y: auto;
    }

    .map-container {
        flex: 1;
    }

    .controls {
        grid-template-columns: 1fr;
    }

    .status-indicator {
        bottom: 10px;
        right: 10px;
        font-size: 12px;
    }
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar,
.map-container::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.map-container::-webkit-scrollbar-track {
    background: var(--light-gray);
}

.sidebar::-webkit-scrollbar-thumb,
.map-container::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.map-container::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}
