/* ========================================
   BOOKING MODAL - Split Screen Layout
   Matches Passenger App UI/UX
======================================== */

/* Main Booking Modal - Centered Fixed Size Layout */
.booking-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.booking-modal-overlay.active {
    display: flex;
}

.booking-modal-container {
    width: 90%;
    max-width: 1200px;
    height: 85vh;
    max-height: 700px;
    display: flex;
    background: white;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Left Section - Driver Search / Details */
.booking-left-section {
    width: 400px;
    background: white;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid #e0e0e0;
}

/* Right Section - Google Map */
.booking-right-section {
    flex: 1;
    position: relative;
}

#bookingMap {
    width: 100%;
    height: 100%;
}

/* Close Button */
.booking-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: all 0.3s ease;
}

.booking-modal-close:hover {
    background: #f5f5f5;
    transform: scale(1.1);
}

.booking-modal-close i {
    font-size: 20px;
    color: #212121;
}

/* ========================================
   STATE 1: SEARCHING FOR DRIVER
======================================== */

.searching-driver-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    text-align: center;
    flex: 1;
}

.searching-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 3px solid #FFC107;
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.pulse-ring:nth-child(2) {
    animation-delay: 0.5s;
}

.pulse-ring:nth-child(3) {
    animation-delay: 1s;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 0;
    }
}

.searching-animation .fa-car {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    color: #FFC107;
    z-index: 10;
}

.searching-driver-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: #212121;
    margin-bottom: 10px;
}

.searching-driver-state p {
    font-size: 14px;
    color: #757575;
    margin-bottom: 30px;
}

.cancel-ride-btn {
    width: 100%;
    padding: 14px;
    background: white;
    border: 2px solid #FFC107;
    color: #FFC107;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-ride-btn:hover {
    background: #FFF8E1;
}

/* ========================================
   STATE 2: DRIVER ASSIGNED
======================================== */

.driver-assigned-state {
    display: none;
    flex-direction: column;
    padding: 30px;
}

.driver-assigned-state.active {
    display: flex;
}

.driver-card {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.driver-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.driver-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #FFC107;
}

.driver-photo-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #FFC107;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    font-weight: 600;
}

.driver-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: #212121;
    margin-bottom: 4px;
}

.driver-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #757575;
}

.driver-rating i {
    color: #FFC107;
}

.driver-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.driver-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #757575;
}

.driver-detail-item i {
    color: #FFC107;
    width: 16px;
}

.driver-detail-item strong {
    color: #212121;
}

/* Route Details */
.route-details {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.route-point {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
}

.route-point:last-child {
    margin-bottom: 0;
}

.point-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.point-icon.pickup i {
    color: #4CAF50;
    font-size: 12px;
}

.point-icon.drop i {
    color: #E53935;
    font-size: 10px;
}

.point-text span {
    font-size: 12px;
    color: #757575;
    display: block;
    margin-bottom: 4px;
}

.point-text p {
    font-size: 14px;
    color: #212121;
    font-weight: 500;
}

.route-line-vertical {
    width: 2px;
    height: 20px;
    background: #e0e0e0;
    margin-left: 11px;
}

/* Ride Info Grid */
.ride-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.ride-info-item {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}

.ride-info-item i {
    font-size: 24px;
    color: #FFC107;
    margin-bottom: 8px;
}

.ride-info-item span {
    display: block;
    font-size: 12px;
    color: #757575;
    margin-bottom: 4px;
}

.ride-info-item p {
    font-size: 16px;
    font-weight: 600;
    color: #212121;
}

/* OTP Display */
.otp-display {
    background: #FFF8E1;
    border: 2px dashed #FFC107;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.otp-display span {
    display: block;
    font-size: 12px;
    color: #757575;
    margin-bottom: 8px;
}

.otp-display h2 {
    font-size: 32px;
    font-weight: 700;
    color: #FFC107;
    letter-spacing: 8px;
}

/* ========================================
   CONFIRMATION MODAL (After Driver Assigned)
======================================== */

.booking-confirmation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.booking-confirmation-modal.active {
    display: flex;
}

.confirmation-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.confirmation-icon {
    width: 80px;
    height: 80px;
    background: #4CAF50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.confirmation-icon i {
    font-size: 40px;
    color: white;
}

.confirmation-content h2 {
    font-size: 24px;
    font-weight: 600;
    color: #212121;
    margin-bottom: 10px;
}

.confirmation-content p {
    font-size: 14px;
    color: #757575;
    margin-bottom: 30px;
}

.confirmation-details {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: left;
}

.confirmation-ok-btn {
    width: 100%;
    padding: 14px;
    background: #FFC107;
    border: none;
    color: #212121;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirmation-ok-btn:hover {
    background: #FFA000;
}

/* ========================================
   PAYMENT MODAL (Cash Payment)
======================================== */

.payment-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10002;
    align-items: center;
    justify-content: center;
}

.payment-modal.active {
    display: flex;
}

.payment-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.3s ease;
}

.payment-icon {
    width: 80px;
    height: 80px;
    background: #FFC107;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.payment-icon i {
    font-size: 40px;
    color: white;
}

.payment-content h2 {
    font-size: 24px;
    font-weight: 600;
    color: #212121;
    margin-bottom: 10px;
}

.payment-amount {
    font-size: 48px;
    font-weight: 700;
    color: #FFC107;
    margin: 20px 0;
}

.payment-content p {
    font-size: 14px;
    color: #757575;
    margin-bottom: 30px;
}

.payment-buttons {
    display: flex;
    gap: 15px;
}

.payment-btn {
    flex: 1;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.payment-btn.confirm {
    background: #4CAF50;
    color: white;
}

.payment-btn.confirm:hover {
    background: #45a049;
}

.payment-btn.cancel {
    background: white;
    border: 2px solid #e0e0e0;
    color: #757575;
}

.payment-btn.cancel:hover {
    background: #f5f5f5;
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 768px) {
    .booking-modal-overlay {
        padding: 10px;
    }
    
    .booking-modal-container {
        flex-direction: column;
        width: 95%;
        height: 90vh;
        max-height: none;
    }
    
    .booking-left-section {
        width: 100%;
        max-height: 50%;
        min-height: 300px;
    }
    
    .booking-right-section {
        height: 50%;
        min-height: 250px;
    }
    
    .booking-modal-close {
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .booking-modal-container {
        border-radius: 12px;
    }
    
    .driver-card {
        padding: 15px;
    }
    
    .route-details {
        padding: 15px;
    }
}

/* ========================================
   CANCEL REASON MODAL
======================================== */

.cancel-reason-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.cancel-reason-modal-overlay.active {
    display: flex;
}

.cancel-reason-modal {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.cancel-reason-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
}

.cancel-reason-header h3 {
    flex: 1;
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.cancel-reason-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #757575;
    cursor: pointer;
    padding: 5px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.cancel-reason-close:hover {
    background: #f5f5f5;
}

.cancel-reason-divider {
    height: 1px;
    background: #e0e0e0;
}

.cancel-reason-content {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
}

.cancel-reason-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 16px;
}

.cancel-reason-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #FFC107;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.cancel-reason-item {
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cancel-reason-item:hover {
    background: #f9f9f9;
}

.cancel-reason-item.selected {
    background: rgba(255, 193, 7, 0.1);
}

.cancel-reason-radio {
    width: 24px;
    height: 24px;
    border: 2px solid #bdbdbd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.cancel-reason-item.selected .cancel-reason-radio {
    border-color: #FFC107;
    background: #FFC107;
}

.cancel-reason-radio i {
    font-size: 14px;
    color: #000;
    display: none;
}

.cancel-reason-item.selected .cancel-reason-radio i {
    display: block;
}

.cancel-reason-text {
    flex: 1;
    font-size: 15px;
    color: #333;
}

.cancel-reason-item.selected .cancel-reason-text {
    font-weight: 600;
}

.cancel-reason-footer {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
}

.cancel-reason-confirm-btn {
    width: 100%;
    padding: 16px;
    background: #E53935;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.cancel-reason-confirm-btn:disabled {
    background: #e0e0e0;
    color: #9e9e9e;
    cursor: not-allowed;
}

.cancel-reason-confirm-btn:not(:disabled):hover {
    background: #c62828;
}

/* ========================================
   UTILITY CLASSES
======================================== */

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
