.chauffeur-wizard {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    font-family: 'Inter', sans-serif;
}

.wizard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
}

.wizard-progress {
    display: flex;
    gap: 20px;
}

.currency-selector select {
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-weight: 600;
}

.wizard-progress .step {
    color: #ccc;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.wizard-progress .step span {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f0f0f0;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
}

.wizard-progress .step.active {
    color: #1a73e8;
}

.wizard-progress .step.active span {
    background: #1a73e8;
    color: #fff;
}

.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
}

.mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.mode-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #f0f0f0;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.mode-btn.active {
    border-color: #1a73e8;
    background: #e8f0fe;
    color: #1a73e8;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
    text-align: left;
}

#toggle-return-trip {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid #1a73e8;
    background: #fff;
    color: #1a73e8;
    margin-bottom: 20px;
}

#toggle-return-trip.active {
    background: #1a73e8;
    color: #fff;
}

/* Management Page & Mobile Responsiveness */
.chauffeur-manage-box {
    box-sizing: border-box !important;
    width: 95% !important;
    max-width: 600px !important;
    margin: 60px auto !important; /* Buffer for fixed headers */
    padding: 20px !important;
    word-wrap: break-word !important;
}

.chauffeur-manage-box button {
    max-width: 100% !important;
    white-space: normal !important;
    height: auto !important;
    line-height: 1.4 !important;
    padding: 15px !important;
}

@media (max-width: 600px) {
    .chauffeur-wizard {
        padding: 15px;
        margin: 20px auto;
    }
    .wizard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .form-row .form-group {
        min-width: 100%;
    }
    .chauffeur-manage-box h2 {
        font-size: 20px;
    }
}

#confirm-selection-btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 700;
    background: #f8f9fa;
    border: 2px solid #ddd;
    color: #333;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

#confirm-selection-btn.confirmed {
    background: #4caf50;
    border-color: #4caf50;
    color: #fff;
}

#confirm-selection-btn:hover:not(.confirmed) {
    background: #e8f0fe;
    border-color: #1a73e8;
    color: #1a73e8;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input:not([type="checkbox"]), .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}



.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    z-index: 100000;
    max-height: min(240px, 40vh);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: none;
}

.result-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.result-item:hover {
    background: #f8f9fa;
}
.saved-location {
    border-left: 4px solid #ffc107;
    background: #fffef0;
}
.saved-location strong {
    color: #856404;
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.vehicle-card {
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.vehicle-card[data-base^="0"] .v-price { display:none !important; }

.vehicle-card:hover {
    border-color: #1a73e8;
    transform: translateY(-5px);
}

.vehicle-card.vehicle-unavailable { opacity:0.55; cursor:not-allowed; }
.vehicle-card.vehicle-availability-loading { pointer-events:none; opacity:0.75; }
.vehicle-card.vehicle-unavailable:hover { transform:none; border-color:#f0f0f0; }
.vehicle-unavailable-label { margin-top:8px; color:#b32d2e; font-size:12px; font-weight:600; }

.vehicle-card.selected {
    border-color: #1a73e8;
    background: #e8f0fe;
}

.v-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    filter: none !important;
    opacity: 1 !important;
    mix-blend-mode: normal !important;
    border-radius: 8px;
    margin-bottom: 15px;
}
.v-img-placeholder {
    width: 100%;
    height: 120px;
    background: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 40px;
    border-radius: 8px;
    margin-bottom: 15px;
}
.v-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.v-specs {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.v-price {
    font-weight: 700;
    color: #1a73e8;
}

.extras-list {
    margin-top: 20px;
}

.extra-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.extra-item label {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.extra-info {
    display: flex;
    justify-content: space-between;
    flex: 1;
}

.summary-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.total-price-display {
    font-size: 24px;
    font-weight: 800;
    text-align: right;
    margin-top: 20px;
    color: #1a73e8;
}

.wizard-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.wizard-buttons button {
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.next-step, #submit-booking {
    background: #1a73e8;
    color: #fff;
}

.prev-step {
    background: #f0f0f0;
    color: #333;
}

.secondary-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 10px;
}

.stop-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.remove-stop {
    background: #ff4d4f;
    color: white;
    border: none;
    border-radius: 4px;
    width: 30px;
    cursor: pointer;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Hide Route Overlays */
.leaflet-routing-container, 
.leaflet-routing-alt, 
.leaflet-routing-geocoders {
    display: none !important;
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    text-align: left;
}

.form-row .form-group {
    flex: 1;
    min-width: 250px;
}

/* Coordination Chat Styles */
.chauffeur-chat-container {
    margin-top: 30px;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    text-align: left;
}
.chat-header {
    background: #1a73e8;
    color: #fff;
    padding: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: #f0f2f5;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
}
.message.customer {
    align-self: flex-end;
    background: #1a73e8;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.message.driver {
    align-self: flex-start;
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.message-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 5px;
    display: block;
    text-align: right;
}
.chat-input-area {
    padding: 15px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
}
.chat-input-area input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}
.chat-send-btn {
    background: #1a73e8;
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}



/* Final mobile overflow protection for the booking wizard */
.chauffeur-wizard,
.chauffeur-wizard * {
    box-sizing: border-box;
}

.chauffeur-wizard {
    width: min(100% - 24px, 800px);
    max-width: 800px;
    overflow-x: hidden;
}

.chauffeur-wizard .wizard-header {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    gap: 14px 20px;
}

.chauffeur-wizard .wizard-progress {
    min-width: 0;
    max-width: 100%;
    flex: 1 1 520px;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.chauffeur-wizard .wizard-progress .step {
    min-width: 0;
    white-space: nowrap;
}

.chauffeur-wizard .currency-info {
    flex: 0 1 auto;
    max-width: 100%;
    white-space: nowrap;
}

.chauffeur-wizard .mode-selector {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chauffeur-wizard .mode-selector .mode-btn {
    flex: 1 1 150px;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.chauffeur-wizard .form-row {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0 16px;
}

.chauffeur-wizard .form-row .form-group {
    min-width: 0;
    flex: 1 1 240px;
}

.chauffeur-wizard input,
.chauffeur-wizard select,
.chauffeur-wizard textarea,
.chauffeur-wizard button {
    max-width: 100%;
}

@media (max-width: 600px) {
    .chauffeur-wizard {
        width: calc(100% - 20px);
        margin: 12px auto;
        padding: 14px !important;
    }

    .chauffeur-wizard .wizard-header {
        align-items: stretch;
        margin-bottom: 24px;
        padding-bottom: 14px;
    }

    .chauffeur-wizard .wizard-progress {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
        flex-basis: 100%;
    }

    .chauffeur-wizard .wizard-progress .step {
        font-size: 13px;
        white-space: normal;
    }

    .chauffeur-wizard .wizard-progress .step span {
        flex: 0 0 28px;
        width: 28px;
        height: 28px;
        margin-right: 6px;
    }

    .chauffeur-wizard .currency-info {
        width: 100%;
        text-align: left;
        font-size: 13px;
    }

    .chauffeur-wizard .mode-selector .mode-btn {
        flex-basis: calc(50% - 4px);
        padding: 10px 8px;
        font-size: 13px;
    }

    .chauffeur-wizard .autocomplete-results {
        left: 0;
        right: 0;
        max-height: 42vh;
        font-size: 14px;
    }

    .chauffeur-wizard .result-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 10px 12px;
        touch-action: manipulation;
    }
}

.flatpickr-calendar {
    z-index: 100000 !important;
}

.flatpickr-confirm-btn {
    padding: 10px;
    border-top: 1px solid #eee;
    text-align: center;
}

.flatpickr-confirm-btn button {
    width: 100%;
    min-height: 42px;
    padding: 8px;
    background: #1a73e8;
    color: #fff;
    border: 0;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}

@media (max-width: 360px) {
    .chauffeur-wizard .wizard-progress {
        grid-template-columns: 1fr;
    }

    .chauffeur-wizard .mode-selector .mode-btn {
        flex-basis: 100%;
    }
}
