/**
 * Contact Form 7 Modal Styles
 * Modal wrapper for displaying CF7 forms in flight cards
 */

/* Modal wrapper */
.srm-cf7-modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.srm-cf7-modal-wrapper.active {
    opacity: 1;
}

/* Overlay */
.srm-cf7-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

/* Modal container */
.srm-cf7-modal-container {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 2;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Close button */
.srm-cf7-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.3s ease;
    border-radius: 50%;
    z-index: 10;
}

.srm-cf7-modal-close:hover {
    background: #f3f4f6;
    color: #111112;
}

/* Modal header */
.srm-cf7-modal-header {
    margin-bottom: 30px;
}

.srm-cf7-modal-title {
    font-size: 28px;
    font-weight: 600;
    color: #111112;
    margin: 0;
    padding-right: 40px;
}

/* Modal content */
.srm-cf7-modal-content {
    position: relative;
}

/* Loading state */
.srm-cf7-modal-content.loading {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.srm-cf7-modal-content.loading::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #23388e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Booking button in flight cards */
.srm-flight-card__booking-btn {
    display: inline-block;
    background: #23388e;
    color: #ffffff;
    border: none;
    border-radius: 0.63rem;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 16px;
    width: fit-content;
}

.srm-flight-card__booking-btn:hover {
    background: #1a2a6b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(35, 56, 142, 0.3);
}

.srm-flight-card__booking-btn:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .srm-cf7-modal-container {
        width: 95%;
        padding: 30px 20px;
        max-height: 95vh;
    }
    
    .srm-cf7-modal-title {
        font-size: 22px;
    }
    
    .srm-cf7-modal-close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
    }
    
    .srm-flight-card__booking-btn {
        width: 100%;
        text-align: center;
    }
}

/* Ensure CF7 form styles work inside modal */
.srm-cf7-modal-content .wpcf7 {
    margin: 0;
}

.srm-cf7-modal-content .wpcf7-form {
    margin: 0;
}

/* CF7 Date and Number inputs inside modal */
.srm-cf7-modal-content input[type="date"],
.srm-cf7-modal-content input[type="number"] {
    font-family: inherit;
    font-size: 15px;
    color: #222;
}

.srm-cf7-modal-content input[type="date"] {
    position: relative;
    cursor: pointer;
}

.srm-cf7-modal-content input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}

.srm-cf7-modal-content input[type="date"]::-webkit-inner-spin-button,
.srm-cf7-modal-content input[type="date"]::-webkit-clear-button {
    display: none;
}

.srm-cf7-modal-content input[type="date"]::-webkit-datetime-edit {
    padding: 0;
    color: #222;
}

.srm-cf7-modal-content input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

.srm-cf7-modal-content input[type="date"]::-webkit-datetime-edit-text {
    padding: 0 2px;
    color: #222;
}

.srm-cf7-modal-content input[type="date"]::-webkit-datetime-edit-month-field,
.srm-cf7-modal-content input[type="date"]::-webkit-datetime-edit-day-field,
.srm-cf7-modal-content input[type="date"]::-webkit-datetime-edit-year-field {
    padding: 0 2px;
    color: #222;
}

.srm-cf7-modal-content input[type="date"]::-webkit-datetime-edit-month-field:focus,
.srm-cf7-modal-content input[type="date"]::-webkit-datetime-edit-day-field:focus,
.srm-cf7-modal-content input[type="date"]::-webkit-datetime-edit-year-field:focus {
    background-color: rgba(35, 56, 142, 0.1);
    color: #23388e;
}

.srm-cf7-modal-content input[type="number"] {
    -moz-appearance: textfield;
}

.srm-cf7-modal-content input[type="number"]::-webkit-outer-spin-button,
.srm-cf7-modal-content input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Smooth scrollbar for modal */
.srm-cf7-modal-container::-webkit-scrollbar {
    width: 8px;
}

.srm-cf7-modal-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.srm-cf7-modal-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.srm-cf7-modal-container::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
