/* ============================================
   Base – mobile first
   ============================================ */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #111;
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    padding-top: 56px;   /* ← space for the fixed navbar (adjust if your navbar is taller) */
}

/* ============================================
   Fixed header (navbar) – always visible
   ============================================ */
.navbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background-color: #000 !important;
    width: 100%;
}
.navbar-brand,
.nav-link {
    color: #fff !important;
    font-size: 1rem;
}

/* ============================================
   Collapsible menu – also fixed when opened
   ============================================ */
.nav-links-container {
    position: fixed;
    top: 56px;            /* same height as the navbar */
    left: 0;
    right: 0;
    z-index: 1029;
    background-color: #212529;  /* dark background to match the navbar */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.nav-links-container.show {
    max-height: 500px;    /* enough to show all links */
}

/* ============================================
   Buttons – larger touch targets
   ============================================ */
.btn,
.btn-sm,
.btn-lg {
    border-radius: 8px;
    font-weight: 500;
}
.btn-primary,
.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}
.btn-primary:hover,
.btn-success:hover {
    background-color: #218838;
}
.btn-outline-success {
    color: #28a745;
    border-color: #28a745;
}
.btn-outline-success:hover {
    background-color: #28a745;
    color: #fff;
}

/* ============================================
   Cards – subtle shadows, full width on mobile
   ============================================ */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
}
.card-header {
    background-color: #28a745;
    color: #fff;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    padding: 0.75rem 1rem;
}

/* Request cards */
.request-card {
    border-left: 6px solid #28a745;
    transition: transform 0.2s;
}
.request-card:hover {
    transform: translateY(-2px);
}

/* Badge statuses */
.badge-pending {
    background-color: #ffc107;
    color: #000;
}
.badge-accepted {
    background-color: #17a2b8;
}
.badge-en_route {
    background-color: #007bff;
}
.badge-completed {
    background-color: #28a745;
}
.badge-cancelled {
    background-color: #dc3545;
}

/* Links */
a {
    color: #28a745;
}
a:hover {
    color: #1e7e34;
}

/* ============================================
   Forms – full width inputs, bigger tap areas
   ============================================ */
.form-control,
.form-select {
    border-radius: 8px;
    font-size: 16px;        /* prevents iOS zoom on focus */
    padding: 0.5rem 0.75rem;
}
.form-label {
    font-weight: 500;
}

/* ============================================
   Tables – scroll horizontally on small screens
   ============================================ */
.table-responsive {
    border-radius: 8px;
}

/* ============================================
   Map container – full width, responsive height
   ============================================ */
#map {
    height: 250px;           /* smaller on mobile */
    width: 100%;
    border-radius: 8px;
}
@media (min-width: 768px) {
    #map {
        height: 400px;       /* larger on desktop */
    }
}

/* Chat / ETA boxes */
.chat-container,
#eta-box {
    border-radius: 8px;
}

/* Driver profile card – make sure photos don't overflow */
.driver-profile-card img {
    object-fit: cover;
    max-width: 100%;
}

/* ============================================
   Buttons group – stack on very small screens
   ============================================ */
@media (max-width: 480px) {
    .btn-group {
        flex-direction: column;
        gap: 0.25rem;
    }
    .btn-group form,
    .btn-group .btn {
        display: block;
        width: 100%;
        margin-bottom: 4px;
    }
    .btn-group form .form-select,
    .btn-group form .form-control {
        width: 100% !important;
        margin-bottom: 4px;
    }
    h2 {
        font-size: 1.5rem;
    }
    h4 {
        font-size: 1.2rem;
    }
    h5 {
        font-size: 1rem;
    }
}

/* Autocomplete suggestions */
.autocomplete-suggestions {
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    max-height: 180px;
    overflow-y: auto;
    background: white;
}
.autocomplete-suggestion {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}
.autocomplete-suggestion:hover {
    background: #f0f0f0;
}

/* Navigation links on mobile – smaller padding */
@media (max-width: 576px) {
    .navbar-nav {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .nav-link {
        padding: 0.5rem 0.5rem;
        font-size: 0.9rem;
    }
}

/* Collapsible menu instant toggle */
.collapsing {
    transition: none !important;
    height: auto !important;
}

/* Give buttons inside the menu more room on mobile */
.nav-item .btn {
    width: 100%;
    text-align: left;
    border-radius: 20px;
}
@media (min-width: 992px) {
    .nav-item .btn {
        width: auto;
        text-align: center;
    }
}