/* Basic styles for the Aviasales Flight Search */
.afs-form-container {
    max-width: 100%; /* <-- UPDATED */
    margin: 0;
    padding: 0;
    border: 0px solid #ddd;
    border-radius: 8px;
    font-family: "Noto Sans Hebrew", sans-serif; 
}

#afs-form {
    /*display: flex;*/
    flex-wrap: wrap;
    gap: 15px;
    font-family: "Noto Sans Hebrew", sans-serif; 
    display: none;
}

.afs-form-field {
    flex: 1 1 200px; 
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s;
}

.afs-form-field label {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

.afs-form-field input[type="text"],
.afs-form-field input[type="date"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    font-family: "Noto Sans Hebrew", sans-serif; 
}

.afs-form-field.afs-field-disabled {
    opacity: 0.5;
    pointer-events: none;
}
.afs-form-field.afs-field-disabled input {
    background-color: #f9f9f9;
}


/* --- Checkbox styles --- */
.afs-form-options {
    display: flex;
    flex-basis: 100%; 
    gap: 20px;
    margin-top: 5px;
}

.afs-checkbox-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.afs-checkbox-field label {
    margin-bottom: 0; 
    font-weight: 500;
    cursor: pointer;
}

.afs-checkbox-field input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* --- Submit Button Wrapper --- */
.afs-submit-wrapper {
    flex: 1 1 100%; 
    align-items: flex-end; 
    margin-top: 5px;
}

.afs-form-field button {
    padding: 12px 20px;
    background-color: #0073aa;
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    min-width: 150px; 
    font-family: "Noto Sans Hebrew", sans-serif; 
}

.afs-form-field button:hover {
    background-color: #005a87;
}

.afs-form-field button:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}

/* Results */
#afs-results-container {
    margin-top: 20px;
    font-family: "Noto Sans Hebrew", sans-serif; 
    width: 100%; /* Ensure container is full width */
}

.afs-loading {
    text-align: center;
    color: #555;
    font-style: italic;
}

.afs-error {
    text-align: center;
    color: #d93030;
    font-weight: 600;
}

/* --- Results Title (UPDATED) --- */
.afs-results-title {
    color: #212121;
    text-align: right;
    direction: rtl;
    margin-bottom: 20px;
    border-bottom: 1px solid #0073aa;
    padding: 15px;
    font-family: "Noto Sans Hebrew", Sans-serif;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 3.8px;
    background-color: #e0f8fb; /* <-- UPDATED */
}


/* --- "No Results" Box styling --- */
.afs-no-results-box {
    text-align: center;
    color: #212121;
    font-style: normal;
    padding: 10px;
    border: 1px dashed #ddd;
    border-radius: 8px;
    direction: rtl;
        overflow: hidden!important;
        -webkit-transition: All 0.4s ease;
-moz-transition: All 0.4s ease;
-o-transition: All 0.4s ease;
-ms-transition: All 0.4s ease;
transition: All 0.4s ease;
    background-color: #fff;
    z-index:2;

}

.afs-no-results-box p {
    margin: 0 0 15px;
    font-size: 1.1em;
}
.afs-no-results-box p:first-child {
    font-size: 1.3em;
    font-weight: 600;
    color: #1a1a1a;
}
.afs-no-results-box .afs-external-search-button { /* <-- RENAMED CLASS */
    display: inline-block;
    padding: 10px 20px;
    background-color: #0073aa;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.2s;
}
.afs-no-results-box .afs-external-search-button:hover { /* <-- RENAMED CLASS */
    background-color: #005a87;
    color: #ffffff;
}

/* --- External Search Link (after results) --- */
.afs-external-search-wrapper {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
    direction: rtl;
    display: none;
}
.afs-external-search-text-link { /* <-- RENAMED CLASS */
    font-size: 1.1em;
    font-weight: 600;
    color: #0073aa;
    text-decoration: none;
}
.afs-external-search-text-link:hover { /* <-- RENAMED CLASS */
    text-decoration: underline;
}


/* --- 4-COLUMN LAYOUT STYLES (for results AND new banner) --- */

.results_flights_box, .afs-standalone-banner-box { /* <-- ADDED .afs-standalone-banner-box */
    display: flex;
    direction: rtl; 
    width: 100%;
    justify-content: space-between;
    align-items: center; /* Changed to center for vertical alignment */
    padding: 15px 0px;
    border-bottom: 1px solid #eee; 
    margin-bottom: 0;
    border-radius: 0;
    box-shadow: none;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s;
}

.results_flights_box:hover, .afs-standalone-banner-box:hover { /* <-- ADDED .afs-standalone-banner-box */
    transform: scale(1.02)!important; /* Slightly reduced scale for banner */
    -webkit-transition: All 0.3s ease; /* Slightly faster transition */
    -moz-transition: All 0.3s ease;
    -o-transition: All 0.3s ease;
    -ms-transition: All 0.3s ease;
    transition: All 0.3s ease;
    background-color: #e1f8fb;
    z-index:3;
    overflow: inherit!important;
}

.afs-col {
    display: flex;
    flex-direction: column;
    padding: 0 10px;
    box-sizing: border-box; 
    direction: rtl; 
    align-items: flex-start; 
}

/* Right-most Column: Image */
.afs-col-image {
    flex-basis: 12.5%;
    flex-shrink: 0;
    align-items: flex-start; 
}
.afs-col-image img {
    border: none;
    border-radius: 5px !important;
    box-shadow: none;
    height: auto;
    max-width: 100%;
    width: 110px;
    height: 90px !important;
    object-fit: cover;
    opacity: 0.9;
}

/* Second from Right: Destination */
.afs-col-dest {
    flex-basis: 30%;
    font-weight: 600;
    text-align: right;
}
.afs-dest-origin-name {
    font-size: 18px;
    font-weight: 400;
    color: #212121;
    margin-bottom: -8px;
    margin-top: -10px;
}
.afs-dest-name {
    font-size: 22px;
    font-weight: 700;
    color: #212121;
    line-height: 1.2;
}
.afs-dest-dates {
    font-size: 14px;
    color: #212121;
    margin-top: 4px;
    font-weight: 500;
    direction: ltr; /* Dates should be LTR */
}

/* Third from Right: Details */
.afs-col-details {
    flex-basis: 35%;
    text-align: right;
    gap: 4px;
}
.afs-details-top {
    font-size: 17px;
    font-weight: 600;
    color: #212121;
}
.afs-details-mid {
    font-size: 13px;
    font-weight: 500;
    color: #757575;
}
.afs-details-bottom {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 5px;
    flex-wrap: wrap; /* Allow badges to wrap */
}
.afs-result-weekend {
    font-size: 12px;
    font-weight: 600;
    color: #4CAF50;
    background-color: #f0fff0;
    padding: 2px 8px;
    border-radius: 12px;
}
.afs-result-stops {
    font-size: 12px;
    color: #333;
    background-color: #f4f4f4;
    padding: 2px 8px;
    border-radius: 12px;
}


/* Left-most Column: Price */
.afs-col-price {
    flex-basis: 20%;
    align-items: flex-end;
    text-align: left;
}
.afs-price-prefix {
    font-size: 13px;
    color: #0073AA;
    font-weight: 400;
}
.afs-price-amount {
    font-family: "Anton", Sans-serif; 
    font-size: 28px; 
    font-weight: 400; 
    color: #0073AA; 
    line-height: 1.1;
}
.afs-price-suffix {
    font-size: 12px;
    color: #555;
}

/* --- NEW: Styles for the Standalone Banner Shortcode --- */
.afs-standalone-banner-wrapper {
    margin-bottom: 20px;
    direction: rtl;
    position: relative; 
    margin-top: 20px;
}

.afs-standalone-banner-box {
    padding: 15px 5px 10px;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    background-color: #f0fff0; /* <-- ADDED BG COLOR */
    position: relative;
    overflow: hidden;
}
.afs-standalone-banner-box:hover {
    background-color: #e1f8fb; /* Lighten the hover */
}

/* Specific button in the banner */
.afs-col-button-wrap {
    flex-basis: 20%; /* Ensure it takes the full price column space */
    align-items: center; /* Center the button vertically */
    justify-content: center; /* Center horizontally if button is smaller */
    gap: 10px; /* Add space between badge and button */
}

/* --- UPDATED: Button (now a span) --- */
.afs-standalone-view-flights-button {
    display: inline-block; /* Make span behave like a block */
    text-align: center; /* Center text */
    padding: 10px 15px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    font-family: "Noto Sans Hebrew", sans-serif;
    min-width: 100%; 
    box-sizing: border-box; 
    line-height: 1.2;
    background-color: #0373ab; /* Merged from 'button.' rule */
    border-radius: 10px; /* Merged from 'button.' rule */
}

.afs-standalone-view-flights-button:hover {
    background-color: #005a87;
    transform: scale(1.03);
}

/* --- RE-ADDED: The "Stamp" --- */
.afs-standalone-stamp {
    background-color: #ffeb3b; /* Yellow background */
    color: #333; /* Black text */
    padding: 2px 8px; /* Match other badges */
    font-size: 12px; /* Match other badges */
    font-weight: 700;
    text-align: center;
    border-radius: 12px; /* Match other badges */
    white-space: nowrap; /* Prevent text wrapping */
    direction: rtl;
    /* Stamp is now in .afs-details-bottom, so no position needed */
}


/* --- UPDATED: Responsive styles --- */
@media (max-width: 700px) {

    /* --- UPDATED: Layout for BANNERS (Exact Date / No Results) --- */
    .afs-standalone-banner-box {
        display: grid;
        grid-template-columns: 2fr 1fr; /* 2/3 details, 1/3 price */
        grid-template-rows: auto auto auto; /* Image, dest, details */
        grid-template-areas: 
            "image   image"
            "dest    price"
            "details price";
        border: 1px solid #eee; 
        border-radius: 8px;
        margin-bottom: 15px;
        overflow: hidden;
        padding: 0;
        gap: 0; /* Remove gap for grid */
    }
    
    /* Make all cols in BANNERS stack */
    .afs-standalone-banner-box .afs-col {
        padding: 0;
        align-items: stretch;
        text-align: right;
        flex-basis: auto; /* Reset flex-basis */
    }

    /* Order for BANNERS */
    .afs-standalone-banner-box .afs-col-image   { grid-area: image; height: 100px; max-width: 100%; }
    .afs-standalone-banner-box .afs-col-dest    { grid-area: dest; padding: 15px 15px 5px 15px; }
    .afs-standalone-banner-box .afs-col-details { grid-area: details; padding: 5px 15px 15px 15px; }
    
    .afs-standalone-banner-box .afs-col-button-wrap {
        grid-area: price;
        display: flex;
        flex-direction: column;
        align-items: flex-end; /* Align text to the start (left) */
        justify-content: flex-start; /* Align to top */
        text-align: left;
        border-right: 1px solid #eee; /* RTL: right border */
        padding: 15px 10px;
    }
    .afs-standalone-banner-box .afs-col-price { /* Price col in banner */
        grid-area: price; 
        display: flex;
        flex-direction: column;
        align-items: flex-end; /* Align text to the start (left) */
        justify-content: flex-start; /* Align to top */
        text-align: left;
        border-right: 1px solid #eee; /* RTL: right border */
        padding: 15px 10px;
    }

    /* Keep banner image size */
    .afs-standalone-banner-box .afs-col-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 0 !important;
        max-width: 100%;
    }

    /* --- NEW Layout for FLIGHT RESULTS --- */
    .results_flights_box {
        display: grid;
        grid-template-columns: 2fr 1fr; /* 2/3 details, 1/3 price */
        grid-template-rows: auto auto auto; /* Image, dest, details */
        grid-template-areas: 
            "image   image"
            "dest    price"
            "details price";
        border: 1px solid #eee; 
        border-radius: 8px;
        margin-bottom: 15px;
        overflow: hidden;
        padding: 0;
        gap: 0; /* Remove gap for grid */
    }
    
    /* Reset child columns for grid */
    .results_flights_box .afs-col {
        padding: 0;
        align-items: stretch;
        text-align: right;
        flex-basis: auto; /* Reset flex-basis */
    }

    .results_flights_box .afs-col-image { 
        grid-area: image; 
        height: 100px;
        max-width: 100%;
    }
    .results_flights_box .afs-col-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 0 !important;
        max-width: 100%;
    }
    
    .results_flights_box .afs-col-dest { 
        grid-area: dest; 
        padding: 15px 15px 5px 15px;
        align-items: flex-start; /* Align text to the start (right) */
    }
    
    .results_flights_box .afs-col-details { 
        grid-area: details; 
        padding: 5px 15px 15px 15px;
        align-items: flex-start; /* Align text to the start (right) */
    }
    
    .results_flights_box .afs-col-price { 
        grid-area: price; 
        display: flex;
        flex-direction: column;
        align-items: flex-end; /* Align text to the start (left) */
        justify-content: flex-start; /* Align to top */
        text-align: left;
        border-right: 1px solid #eee; /* RTL: right border */
        padding: 15px 10px;
    }

    /* --- HIDE details mid on mobile results --- */
    .results_flights_box .afs-details-mid,
    .afs-standalone-banner-box .afs-details-mid { /* Hide for banners too */
        display: none;
    }
    
    /* Align badges to the start (right) for both */
    .afs-details-bottom {
        justify-content: flex-start; 
    }
    
    /* Align result details to right */
    .results_flights_box .afs-col-dest,
    .results_flights_box .afs-col-details,
    .afs-standalone-banner-box .afs-col-dest,
    .afs-standalone-banner-box .afs-col-details {
        align-items: flex-start;
        text-align: right;
    }

    /* --- Other Mobile Styles --- */
    .afs-standalone-view-flights-button {
         font-size: 16px; /* Slightly larger button text on mobile */
    }
    
    .afs-col-button-wrap {
        gap: 15px; /* More space on mobile */
    }
}