/* Bus Tracker Stylesheet */

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

:root {
    --primary-color: #0066CC;
    --secondary-color: #00AA00;
    --danger-color: #FF0000;
    --warning-color: #FF6600;
    --dark-bg: #1a1a1a;
    --light-bg: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), #004499);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow);
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.subtitle {
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Main Content Layout */
.main-content {
    display: flex;
    height: calc(100vh - 120px);
    gap: 1rem;
    padding: 1rem;
}

/* Sidebar */
.sidebar {
    width: 350px;
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* Search Section */
.search-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-results {
    margin-top: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.search-result-item {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.search-result-item:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
}

/* Navigation Section */
.select-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    background: white;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

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

.btn-primary:hover {
    background: #0052a3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: #555;
}

.route-info {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 6px;
    display: none;
}

.route-info.active {
    display: block;
}

.route-step {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--primary-color);
    padding-left: 1rem;
}

/* Station Info */
.station-info-section {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: 6px;
}

.station-details {
    margin-bottom: 1rem;
}

.station-name {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.arrivals-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.arrival-item {
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.route-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.time-badge {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color);
}

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

.route-item {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.route-item:hover {
    border-color: var(--primary-color);
    background: var(--light-bg);
}

.route-item.active {
    border-color: var(--primary-color);
    background: #e6f2ff;
}

.route-number {
    font-size: 1.5rem;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
    padding: 0.5rem;
    border-radius: 4px;
    color: white;
}

.route-name {
    flex: 1;
    font-weight: 500;
}

/* Map Section */
.map-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.map-controls {
    padding: 1rem;
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.map {
    flex: 1;
    width: 100%;
    height: 100%;
}

/* Bus Marker Styles */
.bus-marker {
    background: var(--primary-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Station Marker Styles */
.station-marker {
    background: var(--secondary-color);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 102, 204, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar {
        width: 100%;
        max-height: 400px;
    }
    
    .map-section {
        height: 500px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

