﻿/* Custom Styles for Bus Timing Page (Design Only) */

/* Basic Page Structure */
.bg-light-gray {
    background-color: #f8f9fa; /* A very light grey for the background */
}

/* Page Title */
.page-title {
    color: #004d40; /* Dark Teal for heading */
    font-weight: 700;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 10px;
}

    .page-title::after {
        content: '';
        position: absolute;
        left: 50%;
        bottom: 0;
        transform: translateX(-50%);
        width: 80px;
        height: 4px;
        background-color: #007bff; /* Primary Blue for underline */
        border-radius: 2px;
    }

/* Route Summary Card */
.route-summary-card {
    background-color: #e9f5ff; /* Light blue background */
    border: 1px solid #cce5ff; /* Lighter blue border */
    border-radius: 0.75rem; /* More rounded corners */
    padding: 1.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05); /* Soft shadow */
}

    .route-summary-card .card-title {
        color: #007bff; /* Primary Blue */
        font-weight: 600;
    }

    .route-summary-card .lead {
        color: #343a40; /* Darker text for route details */
        font-size: 1.35rem;
    }

    .route-summary-card .bi-arrow-right-short {
        vertical-align: middle;
        font-size: 1.5rem;
        color: #007bff;
    }

/* Main Content Cards (Bus Details and Map) */
.bus-details-card, .map-card {
    border-radius: 1rem; /* Consistent rounded corners */
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.1); /* More pronounced shadow */
}

    .bus-details-card .card-title {
        color: #007bff; /* Primary Blue */
        border-bottom: 2px solid #e9ecef; /* Subtle separator */
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
        font-size: 1.6rem;
    }

/* Individual Bus Group Section */
.bus-group-section {
    background-color: #f8f9fa; /* Light grey background */
    border: 1px solid #e2e6ea;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; /* Smooth hover effect */
}

    .bus-group-section:hover {
        transform: translateY(-5px); /* Lift effect on hover */
        box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.08); /* Enhanced shadow on hover */
    }

    .bus-group-section h6 {
        font-size: 1.25rem;
        color: #343a40; /* Dark text for bus number */
    }

    .bus-group-section .text-muted.small {
        font-size: 0.95rem;
    }

    .bus-group-section .row p {
        font-size: 1.1rem;
    }

        .bus-group-section .row p span {
            font-weight: 600;
            color: #212529; /* Even darker for emphasis */
        }

/* Accordion Customization for Timings */
.accordion-item {
    border: none !important; /* Remove default accordion item border */
}

.accordion-button {
    background-color: #007bff; /* Primary Blue button */
    color: white;
    font-weight: 600;
    border-radius: 0.5rem !important; /* Rounded corners for button */
    padding: 1rem 1.25rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

    .accordion-button:not(.collapsed) {
        background-color: #0056b3; /* Darker blue when open */
        color: white;
        box-shadow: inset 0 -1px 0 rgba(0,0,0,.125);
    }

    .accordion-button::after {
        color: white; /* Make accordion arrow white */
    }

.accordion-body {
    border-top: 1px solid #e9ecef; /* Separator for accordion body */
    padding: 0 !important; /* Remove default body padding */
}

.timing-list .list-group-item {
    border-left: none;
    border-right: none;
    padding: 0.8rem 1.25rem;
    font-size: 1.05rem;
}

    .timing-list .list-group-item:first-child {
        border-top: none;
    }

    .timing-list .list-group-item:last-child {
        border-bottom: none;
    }

    .timing-list .list-group-item:nth-child(even) {
        background-color: #f1f8ff; /* Light background for even items */
    }

    .timing-list .list-group-item:nth-child(odd) {
        background-color: #ffffff; /* White background for odd items */
    }

.badge.bg-success-subtle {
    background-color: #d1e7dd !important; /* More prominent success shade */
    color: #0f5132 !important;
    padding: 0.5em 0.8em;
    font-size: 0.9em;
    border-radius: 0.3rem;
    font-weight: 600;
}

/* Action Buttons at the bottom */
.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 0.5rem;
    font-weight: 600;
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
}

    .btn-outline-secondary:hover {
        background-color: #6c757d;
        color: white;
    }

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

    .btn-primary:hover {
        background-color: #0056b3;
        border-color: #0056b3;
    }

/* Map Section - Adjusted for Responsiveness */
#map {
    height: 600px; /* Default height for larger screens */
    border-radius: 1rem; /* Match card border-radius */
    min-height: 250px; /* Minimum height for map */
}

/* Modal Styling */
.modal-content {
    border-radius: 1rem;
    overflow: hidden; /* Ensure rounded corners clip content */
}

.modal-header {
    background-color: #007bff; /* Primary Blue header */
    color: white;
    border-bottom: none; /* No ugly line */
}

    .modal-header .btn-close {
        filter: invert(1) grayscale(100%) brightness(200%); /* White X icon for dark background */
    }

.modal-title {
    font-weight: 600;
}

.stop-list-container {
    max-height: 400px; /* Max height for scrollable stop list */
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
}

    .stop-list-container .list-group-item {
        background-color: #f8f9fa;
        border-color: #e9ecef;
        padding: 0.75rem 1.25rem;
        font-size: 1.05rem;
        transition: background-color 0.2s ease;
    }

        .stop-list-container .list-group-item:hover {
            background-color: #e9ecef;
        }

/* General Layout Adjustments */
.container.bus-timing-page {
    
    margin-bottom: 3rem !important;
}

.container-fluid.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

.gx-4 {
    --bs-gutter-x: 1.5rem; /* Increase gap between columns */
}

/* Media Queries for responsiveness - Refined */
@media (max-width: 991.98px) { /* Tablets and smaller (lg breakpoint) */
    /* Map height uses viewport height, allowing flexibility */
    #map {
        height: 50vh; /* Map takes 50% of viewport height */
    }

    .bus-details-card, .map-card {
        margin-bottom: 2rem; /* Add space between cards when stacked */
    }
}

@media (max-width: 767.98px) { /* Mobile (md breakpoint) */
    .page-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .route-summary-card .lead {
        font-size: 1.1rem;
    }

    .bus-group-section h6 {
        font-size: 1.1rem;
    }

    .bus-group-section .row p {
        font-size: 0.95rem;
    }

    .btn-lg {
        width: 100%; /* Full width buttons */
    }

    .d-flex.flex-column.flex-lg-row {
        flex-direction: column !important; /* Stack buttons vertically */
    }

    #map {
        height: 40vh; /* Map takes 40% of viewport height on smaller phones */
    }
}
