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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* Header */
header {
    text-align: center;
    padding: 15px 0;
    margin-bottom: 15px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.logo {
    width: 210px;
    height: auto;
    border-radius: 5px;
}

.header-text {
    text-align: left;
}

h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.last-update {
    font-size: 0.9rem;
    color: #95a5a6;
}

/* Map Container */
.map-container {
    position: relative;
    height: 70vh;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

/* Bus Info Overlay as Leaflet Control */
.bus-info-overlay {
    width: 320px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px !important;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
}

/* Remove default Leaflet control styling */
.bus-info-overlay.leaflet-control {
    border: none;
    background: none;
    margin: 10px;
    margin-right: 20px;
}

/* Ensure left control is properly positioned */
.leaflet-left .leaflet-control.bus-info-overlay {
    margin-left: 20px;
}

/* Override Leaflet control positioning to ensure it's on the right */
.leaflet-right .leaflet-control {
    margin-right: 10px;
}

/* Ensure the leaflet top right controls are positioned correctly */
.leaflet-top.leaflet-right {
    right: 0;
    top: 10px;
}

/* Ensure the leaflet top left controls are positioned correctly */
.leaflet-top.leaflet-left {
    left: 0;
    top: 10px;
}

.bus-direction {
    margin-bottom: 20px;
}

.bus-direction:last-child {
    margin-bottom: 0;
}

.bus-direction h2 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bus-direction h2 i {
    color: #3498db;
}

.bus-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Bus Item */
.bus-item {
    background-color: #fff;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.bus-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bus-time {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.bus-destination {
    font-size: 0.9rem;
    color: #34495e;
}

.pints-container {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    align-items: flex-end;
}

.pint-icon {
    width: 20px;
    height: 20px;
}

.pint-icon.partial-pint {
    opacity: 0.8;
    transition: transform 0.2s ease;
}

.pint-icon.partial-pint:hover {
    transform: scale(1.2);
}

.loading {
    text-align: center;
    color: #7f8c8d;
    padding: 15px 0;
}

/* Error and Status Messages */
.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
    text-align: center;
}

.no-buses {
    background-color: #e2e3e5;
    color: #383d41;
    border-radius: 6px;
    padding: 12px;
    margin: 5px 0;
    text-align: center;
    font-style: italic;
}

/* Map Error */
#map .error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    font-size: 1.1rem;
}

/* Legend */
.legend {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #34495e;
}

.legend-icon {
    width: 24px;
    height: 24px;
}

/* Responsive Adjustments - Tablets and larger phones */
@media (max-width: 900px) {
    .map-container {
        height: 50vh;
    }

    /* Reduce margins on mobile */
    .bus-info-overlay.leaflet-control {
        margin: 5px !important;
    }

    .leaflet-left .leaflet-control.bus-info-overlay {
        margin-left: 5px !important;
    }

    .leaflet-right .leaflet-control.bus-info-overlay {
        margin-right: 5px !important;
    }

    /* Medium size for tablets and large phones */
    .bus-info-overlay {
        width: 165px !important;
        padding: 8px !important;
        font-size: 0.75rem;
    }

    .bus-direction {
        margin-bottom: 12px;
    }

    .bus-direction h2 {
        font-size: 1rem;
        margin-bottom: 6px;
        gap: 5px;
    }

    .bus-item {
        padding: 6px;
        gap: 2px;
    }

    .bus-time {
        font-size: 0.72rem;
    }

    .pint-icon {
        width: 15px;
        height: 15px;
    }

    .pints-container {
        gap: 3px;
    }

    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    .header-text {
        text-align: center;
    }

    .logo {
        width: 70px;
    }
}

/* Smaller phones - Samsung S23, iPhone, etc. */
@media (max-width: 420px) {
    /* Smaller boxes for small phones */
    .bus-info-overlay {
        width: 140px !important;
        padding: 6px !important;
        font-size: 0.7rem;
    }

    .bus-direction h2 {
        font-size: 0.9rem;
        margin-bottom: 5px;
        gap: 4px;
    }

    .bus-direction h2 i {
        font-size: 0.85rem;
    }

    .bus-item {
        padding: 5px;
        gap: 1px;
    }

    .bus-time {
        font-size: 0.68rem;
    }

    .pint-icon {
        width: 14px;
        height: 14px;
    }

    .pints-container {
        gap: 2px;
    }
}

/* Landscape orientation on mobile - make map much taller */
@media (max-width: 1024px) and (orientation: landscape) {
    .map-container {
        height: 100vh !important;
    }
}

/* Leaflet-specific overrides */
.leaflet-control {
    z-index: 800 !important; /* Lower than our overlay but higher than the map */
}

/* Ensure Leaflet attribution is visible but doesn't interfere */
.leaflet-control-attribution {
    background-color: rgba(255, 255, 255, 0.7) !important;
    font-size: 9px !important;
}

/* Creator attribution control */
.creator-attribution {
    background-color: rgba(255, 255, 255, 0.8) !important;
    border-radius: 3px !important;
    padding: 2px 5px !important;
    font-size: 10px !important;
    color: #666 !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.creator-attribution a {
    color: #666 !important;
    text-decoration: none !important;
}

.creator-attribution a:hover {
    color: #333 !important;
} 
