/* Flight Search Styles */
.flight-search-container {
    max-width: 1100px;
    margin: 10px auto;
    font-family: 'YekanBakhFaNum2', sans-serif;
}

/* Trip Type Selector */
.trip-type-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.trip-type label {
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.trip-type input {
    display: none;
}

.trip-type input:checked+span {
    background-color: #ff3b30;
    color: #fff;
    font-weight: bold;
}

/* Radio buttons container */
.radio-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    text-align: right;
    gap: 10px;
}

.radio-item {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.radio-item input {
    display: none;
}

.radio-item label {
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    display: block;
    margin: 0;
    text-align: center;
}

.radio-item input:checked + label {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* Main Input Group */
.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.input-wrapper input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    text-align: right;
    box-sizing: border-box;
}

.input-wrapper input:focus {
    border-color: #28a745;
    box-shadow: 0px 0px 5px rgba(255, 59, 48, 0.4);
    outline: none;
}

.input-wrapper label {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: #666;
    font-size: 14px;
    transition: all 0.3s ease;
    pointer-events: none;
    background: transparent;
    text-align: right;
}

.input-wrapper input:focus+label,
.input-wrapper input:not(:placeholder-shown)+label {
    top: 0;
    font-size: 12px;
    color: #007bff;
    right: 15px;
    background: white;
    padding: 0 5px;
}

/* Swap Button */
.swap-btn {
    background: #f8f8f8;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    text-decoration: none;
}

.swap-btn:hover {
    background: #28a745;
    color: #fff;
}

/* Results Panel */
.results-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 1000;
    max-height: 180px;
    overflow-y: auto;
    display: none;
    margin-top: 2px;
}

.results-panel a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: #374151;
    transition: background-color 0.2s ease;
    font-size: 13px;
}

.results-panel a:hover {
    background-color: #f9fafb;
}

.results-panel a:last-child {
    border-bottom: none;
}

.results-panel a:first-child {
    border-radius: 8px 8px 0 0;
}

.results-panel a:last-child {
    border-radius: 0 0 8px 8px;
}

.airpodcode {
    font-weight: 600;
    color: #2563eb;
    background-color: #eff6ff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 8px;
    min-width: 35px;
    text-align: center;
}

.city-name {
    color: #1f2937;
    font-size: 13px;
    font-weight: 500;
    flex: 1;
}

/* Date and Passenger Container */
.date-passenger-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.date-passenger-container input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    min-width: 150px;
}

/* Input Wrapper 2 (for date and passenger fields) */
.input-wrapper2 {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.input-wrapper2 input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    text-align: right;
    box-sizing: border-box;
}

.input-wrapper2 input:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.input-wrapper2 label {
    position: absolute;
    top: -8px;
    right: 15px;
    color: #666;
    font-size: 12px;
    transition: all 0.3s ease;
    pointer-events: none;
    background: white;
    padding: 0 5px;
    text-align: right;
    z-index: 1;
}

.input-wrapper2 input:disabled + label {
    color: #999;
}

/* Passenger Container */
.passenger-container {
    color: black;
    font-size: small;
    font-weight: 400;
    position: relative;
    flex: 1;
    min-width: 200px;
}

.passenger-container input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    text-align: right;
    cursor: pointer;
}

.passenger-container label {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: #666;
    font-size: 14px;
    transition: all 0.3s ease;
    pointer-events: none;
    background: transparent;
    text-align: right;
}

.passenger-container input:focus+label,
.passenger-container input:not(:placeholder-shown)+label {
    top: 0;
    font-size: 12px;
    color: #007bff;
    right: 15px;
    background: white;
    padding: 0 5px;
}

/* Passenger Panel */
.passenger-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.passenger-type {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

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

.passenger-controls button {
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    background: #28a745;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
}

.passenger-controls span {
    width: 30px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
}

.passenger-controls button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.confirm-btn {
    width: 100%;
    padding: 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
}

.confirm-btn:hover {
    background: #0056b3;
}

/* Search Button */
.search-btn {
    padding: 10px 15px;
    background: #ff3b30;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.search-btn:hover {
    background: #cc2b20;
}

.search-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .flight-search-container {
        width: 100%;
        padding: 0 10px;
    }

    .radio-container {
        margin-bottom: 20px;
    }

    .radio-item label {
        font-size: 13px;
        padding: 6px 10px;
    }

    .input-group {
        flex-direction: column;
        gap: 8px;
        position: relative;
    }

    .input-wrapper,
    .input-wrapper2 {
        width: 100%;
        min-width: auto;
    }

    .swap-btn {
        position: absolute;
        top: 45%;
        left: 25%;
        transform: translate(-50%, -50%);
        z-index: 10;
        background: #f8f8f8;
        border: 1px solid #ddd;
        padding: 10px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        height: 40px;
        text-decoration: none;
    }

    .swap-btn:hover {
        background: #28a745;
        color: #fff;
    }

    .date-passenger-container {
        flex-direction: column;
        gap: 15px;
    }

    .date-passenger-container input,
    .search-btn {
        width: 100%;
        box-sizing: border-box;
    }

    .search-btn {
        margin-top: 10px;
    }

    .passenger-container {
        width: 100%;
    }
}

/* Loading Overlay Styles */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.loading-dialog {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    font-family: 'YekanBakhFaNum2', sans-serif;
}

.loading-dialog p {
    margin-top: 15px;
    font-size: 18px;
    color: #333;
    text-align: center;
}

.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4E8F61;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
