/* Modal Styles for Flight Search Form */

/* Modal Overlay */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 999999 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    animation: fadeIn 0.3s ease-out;
    overflow: hidden;
    margin: 0 !important;
}

.modal-overlay.active {
    display: flex !important;
    z-index: 999999 !important;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden !important;
}

body.modal-open .main-footer {
    z-index: 1 !important;
}

/* Modal Content */
.modal-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    max-width: 300px;
    width: 100%;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 999999 !important;
    margin: auto;
}

.modal-content.modal-sm {
    max-width: 280px;
}

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

/* Modal Header */
.modal-header {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    flex-shrink: 0;
    gap: 0.3rem;
}

.modal-header h3 {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    flex: 1;
    text-align: center;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    padding: 0.15rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-base);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: rotate(90deg);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Modal Body */
.modal-body {
    padding: 0.4rem 0.6rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(100vh - 150px);
}

.modal-body .passenger-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

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

.modal-body .passenger-item label {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Calendar Picker */
.calendar-picker {
    width: 100%;
}

.calendar-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.calendar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: scale(1.1);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.2rem;
    margin-bottom: 0.3rem;
}

.calendar-weekday {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.2rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-base);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.calendar-day.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
}

.calendar-day.today {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
}

.calendar-day.selected {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
    font-weight: 700;
    transform: scale(1.1);
}

.calendar-day:not(.empty):not(.disabled):hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

/* Modal Search Input */
.modal-search {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    font-size: 0.75rem;
    margin-bottom: 0.4rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    height: 32px;
    box-sizing: border-box;
}

.modal-search:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

/* Autocomplete List in Modal */
.autocomplete-list {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
}

.autocomplete-list .autocomplete-item {
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    border-radius: 4px;
    margin-bottom: 0.15rem;
}

.autocomplete-list .autocomplete-item:hover {
    background: rgba(255, 255, 255, 0.2);
    padding-left: 1rem;
    border-color: rgba(255, 255, 255, 0.3);
}

.autocomplete-list .autocomplete-item strong {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    font-size: 0.75rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.autocomplete-list .autocomplete-item small {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.7rem;
}

/* Cabin Options */
.cabin-options {
    display: flex;
    flex-direction: row;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

.cabin-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.35rem 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-base);
    background: rgba(255, 255, 255, 0.05);
    flex: 1;
    min-width: 0;
    text-align: center;
}

.cabin-option:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.cabin-option.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.cabin-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 5px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.cabin-info {
    flex: 0 0 auto;
    width: 100%;
}

.cabin-info strong {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.05rem;
    line-height: 1.2;
}

.cabin-info small {
    display: block;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.1;
}

/* Modal Footer */
.modal-footer {
    padding: 0.4rem 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    background: transparent;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.modal-footer .btn {
    padding: 0.35rem 0.7rem;
    font-size: 0.7rem;
    height: 26px;
}

/* Counter buttons in modal */
.modal-body .counter {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.modal-body .counter-btn {
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.95);
    transition: all var(--transition-base);
}

.modal-body .counter-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.modal-body .counter input {
    width: 32px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    padding: 0.2rem;
    font-weight: 600;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    height: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 0.4rem;
        z-index: 999999 !important;
    }
    
    .modal-content {
        max-width: 90%;
        max-height: calc(100vh - 1rem);
        border-radius: 8px;
        z-index: 999999 !important;
    }
    
    .modal-content.modal-sm {
        max-width: 85%;
    }
    
    .modal-header {
        padding: 0.35rem 0.55rem;
    }
    
    .modal-body {
        padding: 0.35rem 0.55rem;
    }
    
    .modal-footer {
        padding: 0.35rem 0.55rem;
    }
    
    .modal-header h3 {
        font-size: 0.7rem;
    }
    
    .cabin-options {
        gap: 0.2rem;
    }
    
    .cabin-option {
        padding: 0.3rem 0.2rem;
        min-width: calc(50% - 0.1rem);
    }
    
    .cabin-icon {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
    }
    
    .cabin-info strong {
        font-size: 0.65rem;
    }
    
    .cabin-info small {
        font-size: 0.6rem;
    }
    
    .autocomplete-list {
        max-height: 150px;
    }
}
