/* Container for plugin content */
.bussit-kartalla-container {
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Map specific styles */
.bk-map {
    height: 600px;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1; /* Ensure map is below other wp-admin elements if necessary */
}

/* Legend */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.legend h3 {
    width: 100%;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.9em;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
}

/* Controls */
.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    margin-bottom: 5px;
    font-weight: bold;
}

.input-group select,
.input-group input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.bk-refresh-btn {
    background-color: #0066cc;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    align-self: flex-end;
    transition: background-color 0.2s;
}

.bk-refresh-btn:hover {
    background-color: #0052a3;
}

/* Stats */
.stats-container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-card {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.stat-card h3 {
    font-size: 0.9em;
    color: #666;
    margin: 0 0 5px 0;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    margin: 0;
}

/* Error message */
.error {
    background-color: #fee2e2;
    border: 1px solid #ef4444;
    color: #b91c1c;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* Bus List */
.bus-list-container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bk-bus-list {
    max-height: 500px;
    overflow-y: auto;
}

.bus-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.bus-item:hover {
    background-color: #f0f7ff;
}

.bus-route {
    font-weight: bold;
    color: #0066cc;
}

.bus-details {
    text-align: right;
    font-size: 0.9em;
}

.bus-delay {
    font-weight: bold;
    margin-left: 10px;
}

.bus-delay.late { color: #dc2626; }
.bus-delay.early { color: #16a34a; }

/* Bus Icons on Map */
.bus-marker {
    background: none !important;
    border: none !important;
}

.bus-icon {
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    border: 2px solid white;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .controls {
        grid-template-columns: 1fr;
    }
    
    .stats-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}
