/**
 * ============================================================
 *  KAVYA CAB — Main Stylesheet
 *  Golden top / White-Black professional bottom theme
 * ============================================================
 */

/* 1. Base Variables (fallbacks if root-theme.css not loaded) */
:root {
    --primary: #F2C200;
    /* Logo ribbon gold */
    --primary-dark: #A07F00;
    --primary-light: #FFE566;
    --dark: #1a1a1a;
    --bg-light: #f7f7f8;
    --bg-white: #ffffff;
    --text-dark: #1a1a1a;
    --text-muted: #6c757d;
    --card-radius: 16px;
    --section-padding: 80px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --golden-gradient: linear-gradient(135deg, #E8B800 0%, #F7CE1B 45%, #FFE566 72%, #F2C200 100%);
    --card-shadow: 0 10px 30px rgba(200, 160, 0, 0.10);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
}

@media (min-width: 992px) {
    :root {
        --section-padding: 100px;
    }
}

/* 2. Global Styles */
html,
body {
    /* Guard against stray horizontal overflow on narrow screens
       (clip, unlike hidden, doesn't break position:sticky) */
    overflow-x: clip;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.65;
}

main {
    display: block;
}

section {
    padding: var(--section-padding) 0;
}

/* ─── Section Title ─────────────────────────────────────── */
.section-title {
    position: relative;
    padding-bottom: 16px;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    font-size: clamp(1.3rem, 4.5vw, 2rem);
    overflow-wrap: break-word;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--golden-gradient);
    border-radius: 2px;
}

/* ─── Typography ─────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--dark);
}

.text-orange,
.text-golden {
    color: var(--primary-dark) !important;
}

.fw-black {
    font-weight: 900 !important;
}

.bg-premium-light {
    background-color: var(--bg-light);
}

/* ─── NAVBAR — GOLDEN PROFESSIONAL TOP ──────────────────── */
/* Persistent Golden Top Status Bar */
.top-status-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(90deg, #DDB100 0%, #F2C200 50%, #DDB100 100%);
    z-index: var(--z-top-strip, 10000);
}

body {
    padding-top: 50px;
}

/* Main Navbar */
.navbar {
    background: #000000 !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45) !important;
    border-radius: 50px !important;
    margin: 0 auto !important;
    padding: 4px 16px !important;
    top: 32px !important;
    width: 96% !important;
    left: 0;
    right: 0;
    z-index: var(--z-navbar, 1030);
    min-height: 52px !important;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: #000000 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
}

.navbar.sticky-top {
    position: sticky;
    top: 32px;
    z-index: var(--z-navbar, 1030);
}

.navbar .nav-link {
    color: #ffffff !important;
    font-weight: 600;
    padding: 8px 18px;
    transition: var(--transition);
}

.navbar .nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Logo */
.mobile-logo {
    height: 40px !important;
    width: auto !important;
    object-fit: contain;
    min-width: 0 !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Navbar brand */
.navbar-brand {
    color: #ffffff !important;
}

/* ─── ADMIN NAVBAR ────────────────────────────────────────── */
.admin-navbar {
    background: #000000 !important;
    border: 1px solid rgba(242, 194, 0, 0.2) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

/* ─── BUTTONS ─────────────────────────────────────────────── */
.btn-primary {
    background: var(--golden-gradient);
    border: none;
    color: #14130b !important;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(200, 160, 0, 0.35);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(200, 160, 0, 0.50);
    filter: brightness(1.04);
    background: linear-gradient(135deg, #D5A900 0%, #EFC400 50%, #FFDC4D 100%);
}

/* White button for golden navbar */
.btn-nav-white {
    background: rgba(255, 255, 255, 0.92) !important;
    color: #8a6d00 !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.btn-nav-white:hover {
    background: #ffffff !important;
    color: #A07F00 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.btn-outline-orange {
    border: 2px solid var(--primary);
    color: var(--primary-dark);
    font-weight: 600;
    background: transparent;
    transition: var(--transition);
}

.btn-outline-orange:hover {
    background: var(--golden-gradient);
    color: #14130b;
    border-color: transparent;
    box-shadow: 0 5px 15px rgba(200, 160, 0, 0.3);
}

.btn-orange-gradient {
    background: var(--golden-gradient);
    border: none;
    color: #14130b !important;
    font-weight: 700;
    transition: var(--transition);
}

/* ─── FLEET CARDS ─────────────────────────────────────────── */
.responsive-grid {
    display: grid;
    /* min(280px, 100%) prevents horizontal overflow on screens narrower than 280px + padding */
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 28px;
    align-items: stretch;
}

.fleet-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.35s ease,
        border-color 0.35s ease;
    will-change: transform;
    height: 100%;
    border: 1px solid #e8e9ec;
}

.fleet-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 24px 60px rgba(200, 160, 0, 0.22);
    border-color: rgba(242, 194, 0, 0.4);
}

.fleet-card-img {
    width: 100%;
    height: 220px;
    background-color: #ffffff !important;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(242, 194, 0, 0.12);
    flex-shrink: 0;
}

.fleet-card-img picture {
    display: block;
    width: 100%;
    height: 100%;
}

.fleet-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(1.05) contrast(1.1);
    mix-blend-mode: multiply;
    object-position: center bottom;
    transition: transform 0.4s ease;
    padding: 15px 10px 0;
    background: #ffffff !important;
}

.fleet-card:hover .fleet-card-img img {
    transform: scale(1.07) translateY(-4px);
}

.fleet-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--golden-gradient);
    color: #14130b;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(200, 160, 0, 0.4);
}

.fleet-card-body {
    padding: 22px 24px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    background: #ffffff;
}

.fleet-card-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.fleet-card-desc {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 14px;
    font-weight: 500;
}

.fleet-card-features {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
}

.fleet-card-features li {
    display: flex;
    align-items: center;
    font-size: 0.92rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.fleet-card-features li i {
    color: #DDB100;
    font-size: 1rem;
    margin-right: 8px;
    flex-shrink: 0;
}

.fleet-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #ececee;
}

.fleet-card-price {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--primary-dark);
}

/* ─── GLASS CARDS ─────────────────────────────────────────── */
.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(200, 160, 0, 0.12) !important;
    border-color: rgba(242, 194, 0, 0.35) !important;
}

/* ─── ICON BOXES ──────────────────────────────────────────── */
.icon-box {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

/* ─── DRAWER BUTTON ───────────────────────────────────────── */
.drawer-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

.drawer-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}

.drawer-btn:active {
    background: rgba(255, 255, 255, 0.35);
}

/* ─── WHATSAPP BUTTON ─────────────────────────────────────── */
.whatsapp-btn {
    position: fixed;
    bottom: 28px;
    right: 24px;
    background: #25d366;
    color: #ffffff;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    z-index: 1000;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4), 0 4px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s ease, opacity 0.5s ease, box-shadow 0.25s ease;
    opacity: 0;
    pointer-events: none;
}

.whatsapp-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(37, 211, 102, 0.5);
    color: #ffffff;
}

.whatsapp-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.whatsapp-btn.hidden {
    transform: translateY(150px);
}

/* ─── PWA ─────────────────────────────────────────────────── */
* {
    -webkit-tap-highlight-color: transparent;
}

.btn,
.card,
.navbar-brand,
.nav-link,
.whatsapp-btn {
    -webkit-user-select: none;
    user-select: none;
}

/* ─── ADMIN SIDEBAR ───────────────────────────────────────── */
.offcanvas-admin {
    width: 280px !important;
    background: #111111;
    color: #ffffff;
    border-right: 1px solid rgba(242, 194, 0, 0.2);
}

.offcanvas-admin .nav-link {
    color: rgba(255, 255, 255, 0.65) !important;
    padding: 12px 25px;
    border-radius: 0;
    transition: all 0.2s;
    font-weight: 500;
    border-left: 4px solid transparent;
}

.offcanvas-admin .nav-link:hover,
.offcanvas-admin .nav-link.active {
    color: #ffffff !important;
    background: rgba(242, 194, 0, 0.10);
    border-left-color: var(--primary);
}

.offcanvas-admin .nav-link i {
    width: 25px;
    font-size: 1.1rem;
}

.admin-header {
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, #1a1a1a, #2a2005);
    border-bottom: 1px solid rgba(242, 194, 0, 0.15);
}

/* ─── ADMIN NAVBAR ─────────────────────────────────────────  */
body.admin-page .navbar-brand,
body.admin-page .drawer-btn {
    color: #ffffff !important;
}

body.admin-page .drawer-btn {
    background: rgba(242, 194, 0, 0.12) !important;
    border: 1px solid rgba(242, 194, 0, 0.3) !important;
    color: #F2C200 !important;
}

/* ─── SIDEBAR DROPDOWN ───────────────────────────────────── */
.sidebar-dropdown .dropdown-menu {
    background: #1e1e1e;
    border: none;
    padding: 0;
}

.sidebar-dropdown .dropdown-item {
    color: rgba(255, 255, 255, 0.6) !important;
    padding: 10px 25px 10px 55px;
}

.sidebar-dropdown .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary) !important;
}

/* ─── FEEDBACK & INTERACTIONS ────────────────────────────── */
.feedback-active:active {
    transform: scale(0.98);
}

/* Inline validation: red ring on grouped controls (tiles, chips, pickers) */
.field-group-invalid {
    outline: 2px solid #dc3545;
    outline-offset: 3px;
    border-radius: 12px;
}

/* ─── ACCESSIBILITY ──────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

/* iOS Safari auto-zooms the page when a focused input is under 16px.
   Force 16px on touch devices so the viewport stays put. */
@media (max-width: 991px) {
    .form-control,
    .form-select,
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    input[type="number"],
    input[type="date"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ─── MODAL & DROPDOWN Z-INDEX ───────────────────────────── */
.modal {
    z-index: 1060 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

.dropdown-menu {
    z-index: 2000 !important;
}

.custom-vehicle-dropdown {
    position: relative !important;
    z-index: 1050 !important;
}

.card,
.container,
.row,
.col-md-12 {
    overflow: visible !important;
}

.custom-vehicle-dropdown .btn-light {
    background: #fff !important;
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02) !important;
    width: 100% !important;
    text-align: left !important;
    padding: 12px 20px !important;
}

.custom-vehicle-dropdown .btn-light:hover,
.custom-vehicle-dropdown .btn-light:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(200, 160, 0, 0.15) !important;
}

.custom-vehicle-dropdown .dropdown-menu {
    border: none !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15) !important;
    border-radius: 15px !important;
    margin-top: 10px !important;
    padding: 8px !important;
    z-index: 2000 !important;
}

.custom-vehicle-dropdown .dropdown-item {
    border-radius: 10px !important;
    margin-bottom: 5px !important;
    border-bottom: none !important;
}

.custom-vehicle-dropdown .dropdown-item:last-child {
    margin-bottom: 0;
}

/* ─── MODAL FIELDSET READONLY ────────────────────────────── */
fieldset[disabled] .form-control,
fieldset[disabled] .form-select,
fieldset[disabled] .form-control:disabled,
fieldset[disabled] .form-select:disabled {
    background-color: #f8f9fa !important;
    color: #000 !important;
    font-weight: 700 !important;
    border: 1px solid #dee2e6 !important;
    opacity: 1 !important;
    cursor: default;
    -webkit-text-fill-color: #000;
}

/* ─── CLOCK PICKER ───────────────────────────────────────── */
.mdtp__wrapper .mdtp__hand {
    background: transparent !important;
    width: 0 !important;
    border-left: 1px solid var(--primary) !important;
    margin-left: -0.5px !important;
}

.mdtp__wrapper .mdtp__hand:after {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    width: 8px !important;
    height: 8px !important;
    margin-top: -4px !important;
    opacity: 1 !important;
}

.mdtp__wrapper .mdtp__digit.active:before {
    display: none !important;
}

/* ─── PWA INSTALL GUIDE ──────────────────────────────────── */
#pwa-install-guide-modal {
    z-index: 100001 !important;
}

#pwa-install-guide-modal+.modal-backdrop {
    z-index: 100000 !important;
}

/* ─── STAT/ACTION CARDS ──────────────────────────────────── */
.stat-card {
    transition: var(--transition);
}

.action-card {
    transition: var(--transition);
}

/* ─── TOP BAR / LOGOUT ───────────────────────────────────── */
.top-logout-btn {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.small-btn {
    padding: 4px 12px !important;
    font-size: 0.8rem !important;
}

/* ─── GOOGLE PLACES AUTOCOMPLETE ─────────────────────────── */
.pac-container .pac-icon,
.pac-container .pac-icon-marker {
    background-image: none !important;
    width: 18px !important;
    height: 20px !important;
    margin-right: 8px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

.pac-container .pac-icon::before,
.pac-container .pac-icon-marker::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23DDB100'%3E%3Cpath d='M8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10zm0-7a3 3 0 1 1 0-6 3 3 0 0 1 0 6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* ─── MOBILE RESPONSIVE ──────────────────────────────────── */
@media (max-width: 991px) {
    .navbar {
        width: 98%;
        border-radius: 24px;
        top: 32px;
        margin-top: 0;
    }

    .navbar-brand img {
        height: 36px;
    }

    .section-title {
        letter-spacing: 1px;
    }
}

@media (max-width: 767px) {
    :root {
        --section-padding: 40px;
    }

    .navbar {
        margin-top: 0;
        top: 32px;
        padding: 4px 12px !important;
        border-radius: 18px !important;
    }

    .mobile-logo {
        height: 36px !important;
    }

    .navbar-brand span {
        font-size: 1rem !important;
    }

    .navbar .btn-nav-white {
        padding-left: 10px !important;
        padding-right: 10px !important;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .stat-card {
        padding: 1rem !important;
    }

    .stat-card .h1 {
        font-size: 1.75rem !important;
    }

    .stat-card .small {
        font-size: 0.7rem !important;
    }

    .action-card {
        padding: 1rem !important;
    }

    .action-card i,
    .action-card svg {
        font-size: 1.5rem !important;
        width: 24px !important;
        height: 24px !important;
    }

    .action-card span {
        font-size: 0.8rem !important;
    }

    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .row {
        margin-left: -6px;
        margin-right: -6px;
    }

    .col-6,
    .col-12 {
        padding-left: 6px;
        padding-right: 6px;
    }

    .whatsapp-btn {
        width: 50px;
        height: 50px;
        bottom: calc(90px + env(safe-area-inset-bottom, 0px));
        right: 15px;
    }

    @media (max-width: 400px) {
        .admin-navbar .btn-primary {
            padding: 4px 10px !important;
            font-size: 0.75rem !important;
        }

        .admin-navbar .gap-2 {
            gap: 0.25rem !important;
        }
    }
}

/* Capitalize booking detail inputs */
#bookingForm input[type="text"]:not(.time-picker):not(.date-picker):not(#journey_time):not(#admin_journey_time),
#bookingForm textarea,
#bookingEditForm input[type="text"]:not(.time-picker):not(.date-picker):not(#journey_time):not(#admin_journey_time),
#bookingEditForm textarea,
.uppercase-form input[type="text"]:not(.time-picker):not(.date-picker):not(#journey_time):not(#admin_journey_time),
.uppercase-form textarea {
    text-transform: uppercase;
}

#bookingForm input[type="text"]::placeholder,
#bookingForm textarea::placeholder,
#bookingEditForm input[type="text"]::placeholder,
#bookingEditForm textarea::placeholder,
.uppercase-form input[type="text"]::placeholder,
.uppercase-form textarea::placeholder {
    text-transform: none;
}