/* =================== MODALS =================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #333;
    text-align: center;
}

.modal-content p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.modal-buttons button {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
}

.btn-modal-cancel {
    background: #f3f4f6;
    color: #4b5563;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-modal-cancel:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.btn-modal-confirm {
    background: linear-gradient(45deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-modal-confirm:disabled {
    background: linear-gradient(45deg, #93c5fd 0%, var(--accent-color) 100%);
    cursor: not-allowed;
    box-shadow: none;
}

/* Modal variants: confirm (booking-modal) */
#booking-modal .modal-content h3 {
    text-align: center;
    background: #dcfce7;
    color: #166534;
    padding: 0.75rem 1rem;
    margin: -1.5rem -1.5rem 1rem -1.5rem;
    border-radius: 12px 12px 0 0;
}

#booking-modal .btn-modal-confirm {
    background: var(--success);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

/* Modal variants: confirm warning (cancel/destructive) */
#booking-modal .modal-content.modal-confirm-warning h3 {
    background: #fef9c3;
    color: #854d0e;
}

#booking-modal .modal-content.modal-confirm-warning .btn-modal-confirm {
    background: #eab308;
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.25);
}

/* Modal variants: success */
.modal-content.modal-success h3 {
    text-align: center;
    background: #dcfce7;
    color: #166534;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin: -1.5rem -1.5rem 1rem -1.5rem;
    border-radius: 12px 12px 0 0;
}

.modal-content.modal-success .btn-modal-confirm {
    background: var(--success);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

/* Modal variants: error */
.modal-content.modal-error h3 {
    text-align: center;
    background: #fee2e2;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin: -1.5rem -1.5rem 1rem -1.5rem;
    border-radius: 12px 12px 0 0;
}

.modal-content.modal-error .btn-modal-confirm {
    background: var(--danger);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

/* =================== BOOKING MODAL FIELDS =================== */
.booking-modal-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #f0f9ff;
    border: 1.5px solid #bfdbfe;
    border-radius: 10px;
    color: #1e40af;
    font-size: 0.95rem;
    font-weight: 500;
}

.booking-modal-info i {
    font-size: 1.1rem;
    color: #2563eb;
}

.booking-modal-readonly {
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    color: #334155;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    min-height: 44px;
}

/* =================== BOOKING CONFIRMATION MODAL (Redesigned) =================== */
.booking-confirm-modal.active {
    display: flex;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.4);
}

.booking-confirm-content {
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
    background: var(--white);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.booking-confirm-header {
    background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary-color) 50%, var(--accent-color) 100%);
    padding: 2.5rem 1.5rem 1.5rem;
    border-radius: 20px 20px 0 0;
    text-align: center;
    position: relative;
}

/* Close button */
.booking-confirm-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.booking-confirm-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
}

/* Floating icon */
.booking-confirm-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--white);
    border: 4px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.booking-confirm-icon i {
    font-size: 1.8rem;
    color: var(--primary-color);
}

/* Title & subtitle */
.booking-confirm-title {
    color: var(--white);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.booking-confirm-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    margin: 0;
    font-weight: 400;
}

/* Body */
.booking-confirm-body {
    padding: 1.5rem;
}

/* Info card inside body */
.booking-confirm-card {
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
}

.booking-confirm-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.booking-confirm-row:last-child {
    border-bottom: none;
}

.booking-confirm-row-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1rem;
}

.booking-confirm-row-text {
    flex: 1;
    min-width: 0;
}

.booking-confirm-row-label {
    font-size: 0.72rem;
    color: var(--gray);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.booking-confirm-row-value {
    font-size: 0.92rem;
    color: var(--dark);
    font-weight: 600;
    margin-top: 0.1rem;
}

/* Actions */
.booking-confirm-actions {
    display: flex;
    gap: 0.75rem;
    padding: 0 1.5rem 1.75rem;
}

.booking-confirm-btn-cancel {
    flex: 1;
    padding: 0.85rem 1rem;
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.booking-confirm-btn-cancel:hover {
    background: #eff6ff;
}

.booking-confirm-btn-primary {
    flex: 1;
    padding: 0.85rem 1rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35), 0 0 20px rgba(37, 99, 235, 0.15);
}

.booking-confirm-btn-primary:hover {
    background: var(--primary-darker);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45), 0 0 30px rgba(37, 99, 235, 0.2);
    transform: translateY(-1px);
}

.booking-confirm-btn-primary:disabled {
    background: #93c5fd;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Security note */
.booking-confirm-security {
    text-align: center;
    padding: 1rem 1.5rem 1.25rem;
    font-size: 0.75rem;
    color: var(--gray-light);
    font-weight: 500;
}

.booking-confirm-security i {
    margin-right: 0.25rem;
}

/* Responsive */
@media (max-width: 420px) {
    .booking-confirm-content {
        max-width: 95%;
        border-radius: 16px;
    }

    .booking-confirm-header {
        border-radius: 16px 16px 0 0;
        padding: 2rem 1rem 1.25rem;
    }

    .booking-confirm-icon {
        width: 60px;
        height: 60px;
    }

    .booking-confirm-icon i {
        font-size: 1.5rem;
    }

    .booking-confirm-actions {
        flex-direction: column-reverse;
        padding: 0 1rem 1.5rem;
    }
}

/* =================== RESULT MODAL (Success/Error Redesigned) =================== */
.result-confirm-modal.active {
    display: flex;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.4);
}

.result-confirm-content {
    width: 100%;
    max-width: 380px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
    background: var(--white);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideUp 0.3s ease;
}

/* Header - Success (green) */
.result-confirm-header {
    background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
    padding: 2.5rem 1.5rem 1.5rem;
    border-radius: 20px 20px 0 0;
    text-align: center;
    position: relative;
}

.result-confirm-header.error {
    background: linear-gradient(135deg, #dc2626 0%, var(--danger) 50%, #f87171 100%);
}

/* Close button */
.result-confirm-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.result-confirm-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
}

/* Icon */
.result-confirm-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--white);
    border: 4px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.result-confirm-icon i {
    font-size: 1.8rem;
    color: #10b981;
}

.result-confirm-header.error .result-confirm-icon i {
    color: var(--danger);
}

/* Title & subtitle */
.result-confirm-title {
    color: var(--white);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.result-confirm-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    margin: 0;
    font-weight: 400;
}

/* Body */
.result-confirm-body {
    padding: 1.5rem;
    text-align: center;
}

/* Booking code display */
.result-booking-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.75rem 0;
    padding: 0.85rem 1rem;
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 12px;
}

.result-booking-code-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: #166534;
    letter-spacing: 0.5px;
}

.result-booking-code-copy {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1.5px solid #86efac;
    background: var(--white);
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.result-booking-code-copy:hover {
    background: #dcfce7;
    border-color: #059669;
}

.result-booking-code-copy.copied {
    background: #059669;
    color: var(--white);
    border-color: #059669;
}

.result-booking-msg {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 0.5rem;
}

/* Error body */
.result-error-msg {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.5;
}

/* Actions */
.result-confirm-actions {
    padding: 0 1.5rem 1.75rem;
}

.result-confirm-btn-close {
    width: 100%;
    padding: 0.85rem 1rem;
    background: #f1f5f9;
    color: #374151;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.result-confirm-btn-close:hover {
    background: #e2e8f0;
    border-color: var(--gray-light);
}

/* Responsive */
@media (max-width: 420px) {
    .result-confirm-content {
        max-width: 95%;
        border-radius: 16px;
    }

    .result-confirm-header {
        border-radius: 16px 16px 0 0;
        padding: 2rem 1rem 1.25rem;
    }

    .result-confirm-icon {
        width: 60px;
        height: 60px;
    }

    .result-confirm-icon i {
        font-size: 1.5rem;
    }

    .result-confirm-actions {
        padding: 0 1rem 1.5rem;
    }
}
