/* ==========================================================================
   Smart College Transport Management System - Responsive Styles
   Mobile-first adaptations, hamburger menu, grid collapse, touch-friendly UI
   ========================================================================== */

/* --------------------------------------------------------------------------
   Laptops & Medium Tablets (max-width: 1200px)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Tablets & Small Screens (max-width: 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .menu-toggle-btn {
        display: inline-flex;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background-color: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(3px);
        z-index: 95;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-fast);
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .page-content {
        padding: 1.5rem 1rem;
    }

    .top-header {
        padding: 0 1rem;
    }

    .header-profile-btn .profile-meta {
        display: none;
    }

    .next-stop-countdown-box {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .countdown-wrapper {
        align-items: flex-start;
        text-align: left;
    }
}

/* --------------------------------------------------------------------------
   Mobile Devices (max-width: 640px)
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    html {
        font-size: 14px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .quick-actions-bar {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .global-search-bar {
        display: none;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .page-title-group h1 {
        font-size: 1.5rem;
    }

    .upcoming-bus-card {
        padding: 1.4rem;
    }

    .route-title-large {
        font-size: 1.4rem;
    }

    .upcoming-card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .track-now-btn {
        justify-content: center;
        width: 100%;
    }

    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .toast {
        min-width: 100%;
        max-width: 100%;
    }

    /* Timetable Responsive Cards on Mobile */
    .timetable-table-wrapper {
        border: 0;
        background: transparent;
    }

    .timetable-table thead {
        display: none;
    }

    .timetable-table, .timetable-table tbody, .timetable-table tr, .timetable-table td {
        display: block;
        width: 100%;
    }

    .timetable-table tr {
        background-color: var(--bg-surface);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 1rem;
        margin-bottom: 0.85rem;
        box-shadow: var(--shadow-xs);
    }

    .timetable-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.4rem 0;
        border-bottom: 1px dashed var(--border-light);
    }

    .timetable-table td:last-child {
        border-bottom: none;
    }

    .timetable-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        font-size: 0.8rem;
        text-transform: uppercase;
    }
}
