/* TvůjBus Dashboard Styles */

:root {
    --primary-color: #9B2B46;
    --secondary-color: #7A2238;
    --background: #f5f5f5;
    --card-bg: #ffffff;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --error-color: #F44336;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 30px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

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

/* Statistics Overview */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(155, 43, 70, 0.15);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Charts */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.chart-container {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chart-container h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

/* Tables */
.tables-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.table-container {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.table-container h2,
.recent-rides-section h2,
.punctuality-section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.recent-rides-section,
.punctuality-section {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

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

th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background-color: #f9f9f9;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Status badges */
.status-on-time {
    background-color: var(--success-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-late {
    background-color: var(--error-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-early {
    background-color: var(--warning-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Footer */
footer {
    background-color: var(--text-dark);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 50px;
}

footer p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Map Section */
.map-section {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
}

.map-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.map-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.map-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.map-button:hover {
    background-color: var(--secondary-color);
}

.map-info {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.speed-indicator {
    font-weight: bold;
    color: var(--primary-color);
}

#map {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

/* Map popups */
.vehicle-popup {
    font-size: 0.9rem;
}

.vehicle-popup .route-name {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 5px;
}

.vehicle-popup .speed {
    color: var(--success-color);
    font-weight: bold;
}

.vehicle-popup .inactive {
    color: var(--text-light);
    font-style: italic;
}

/* Logout Button */
.logout-button {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-button:hover {
    background-color: white;
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    .tables-section {
        grid-template-columns: 1fr;
    }

    .stat-card .stat-value {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .stats-overview {
        grid-template-columns: 1fr;
    }
}
