.modal-view {
    display: none;
}

.modal-view.active {
    display: block;
}

#booking-success-view {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-radius: 12px;
    height: 100%;
}

.success-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 50px 30px;
    text-align: center;
}

.success-icon {
    font-size: 80px;
    margin-bottom: 30px;
    animation: bounceIn 0.8s ease;
}

.success-content h3 {
    font-size: 28px;
    color: #155724;
    margin-bottom: 15px;
    font-weight: bold;
}

.success-content p {
    font-size: 18px;
    color: #155724;
    opacity: 0.9;
    line-height: 1.6;
}

.success-close-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 30px;
    transition: all 0.3s ease;
}

.success-close-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

#booking-error-view {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-radius: 12px;
    height: 100%;
}

.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 50px 30px;
    text-align: center;
}

.error-icon {
    font-size: 80px;
    margin-bottom: 30px;
    animation: shake 0.5s ease;
}

.error-content h3 {
    font-size: 28px;
    color: #721c24;
    margin-bottom: 15px;
    font-weight: bold;
}

.error-content p {
    font-size: 18px;
    color: #721c24;
    opacity: 0.9;
    line-height: 1.6;
}

.error-back-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 30px;
    transition: all 0.3s ease;
}

.error-back-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

#booking-otp-view {
    border-radius: 12px;
    height: 100%;
}

.otp-verification-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 30px;
    text-align: center;
}

.otp-icon {
    font-size: 80px;
    margin-bottom: 25px;
    animation: fadeIn 0.6s ease;
}

.otp-content h3 {
    font-size: 24px;
    color: #FF772C;
    margin-bottom: 15px;
    font-weight: bold;
}

.otp-content p {
    font-size: 16px;
    color: #1565c0;
    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: 10px;
}

.phone-number {
    font-weight: bold;
    color: #0d47a1;
}

.countdown-timer {
    font-size: 14px;
    color: #e65100;
    font-weight: bold;
}

.otp-form {
    width: 100%;
    max-width: 300px;
    margin-top: 25px;
}

.otp-form .form-row {
    margin-bottom: 20px;
}

.otp-form input {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 18px;
    text-align: center;
    font-weight: bold;
    letter-spacing: 1px;
    text-align: center;
    direction: ltr;
    transition: all 0.3s ease;
}

.otp-form input:focus {
    outline: none;
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
    transform: scale(1.02);
}

.otp-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.otp-actions .submit-btn {
    width: 100%;
    background: #FF772C;
}

.otp-actions .submit-btn:hover:not(:disabled) {
    background: #0d47a1;
}

.resend-btn {
    background: transparent;
    color: #1565c0;
    border: 2px solid #1565c0;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.resend-btn:hover:not(:disabled) {
    background: #1565c0;
    color: white;
    transform: translateY(-2px);
}

.resend-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.back-to-form {
    margin-top: 20px;
}

.otp-back-btn {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.otp-back-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.otp-message {
    margin-top: 20px;
    min-height: 50px;
}

.booking-message {
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
}

.booking-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.booking-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.tour-booking-modal {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: -1 !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tour-booking-modal.active {
    display: block !important;
    opacity: 1;
    visibility: visible;
    z-index: 999999 !important;
    pointer-events: auto;
}

.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 999998;
    display: none;
}

.tour-booking-modal.active .modal-overlay {
    display: block;
}

.modal-content {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 999999 !important;
    max-height: 85vh;
    overflow-y: auto;
    display: none;
    direction: rtl;
}

.tour-booking-modal.active .modal-content {
    display: block;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
    direction: rtl;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: bold;
}

.close-modal {
    cursor: pointer;
    font-size: 24px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: #666;
    background: transparent;
    border: none;
}

.close-modal:hover {
    background: #e9ecef;
    color: #333;
}

.modal-body {
    padding: 25px;
    direction: rtl;
}

.tour-booking-form {
    width: 100%;
    direction: rtl;
}

.form-section {
    margin-bottom: 25px;
}

.form-section h4 {
    margin: 0 0 15px 0;
    color: #FF772C;
    font-size: 16px;
    font-weight: bold;
    border-bottom: 2px solid #007cba;
    padding-bottom: 8px;
    text-align: right;
}

.form-row {
    margin-bottom: 15px;
}

.form-row input,
.form-row textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    font-family: inherit;
    direction: rtl;
    text-align: right;
}

.form-row input::placeholder,
.form-row textarea::placeholder {
    color: #999;
    opacity: 1;
    font-size: 14px;
}

.form-row input:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.form-row textarea {
    height: 80px;
    resize: vertical;
    min-height: 80px;
}

.passenger-types {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
    direction: rtl;
}

.passenger-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    background: white;
}

.passenger-item:last-child {
    border-bottom: none;
}

.passenger-info {
    flex: 1;
    text-align: right;
}

.passenger-item label {
    display: block;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
    font-size: 14px;
}

.passenger-desc {
    display: block;
    color: #666;
    font-size: 12px;
}

.counter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.counter-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    color: #333;
}

.counter-btn:hover:not(:disabled) {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.counter-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.counter input {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    background: #f8f9fa;
    font-weight: bold;
    font-size: 14px;
    direction: ltr;
}

.submit-btn {
    width: 100%;
    background: #FF772C;
    color: white;
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tour-booking-btn {
    background: #FF772C;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    position: relative;
    z-index: 1;
}

.tour-booking-btn:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

body.modal-open {
    overflow: hidden;
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translate(-50%, -60%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.tour-booking-modal.active .modal-content {
    animation: modalFadeIn 0.3s ease-out;
}

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-right-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .passenger-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .counter {
        align-self: flex-end;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    .otp-verification-container {
        padding: 30px 20px;
    }
    
    .otp-icon {
        font-size: 60px;
    }
    
    .otp-content h3 {
        font-size: 20px;
    }
    
    .otp-form input {
        font-size: 16px;
        padding: 12px;
    }
}