/**
 * Airbnb Style Search Form CSS
 * Renk, font vb. temadan miras alır (inherit / tema sınıfları).
 */

/* ==========================================================================
   Base Wrapper – Tema font/renk
   ========================================================================== */

.airbnb-search-wrapper {
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    overflow: visible;
}

/* Sayfa içi arama (Elementor vb.): kompakt stil UYGULANMAZ – sadece header’daki sticky bar kompakt */

/* ==========================================================================
   Container – Sayfa içi (header dışı)
   ========================================================================== */

.airbnb-search-container {
    background: var(--airbnb-search-bg, #fff);
    border: 1px solid currentColor;
    border-radius: 50px;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease, border-color 0.2s ease;
    position: relative;
    overflow: visible;
}

.airbnb-search-container:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   Horizontal Layout – Sayfa içi (büyük bar)
   ========================================================================== */

.airbnb-horizontal .airbnb-search-fields {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: visible;
}

.airbnb-horizontal .airbnb-search-field {
    flex: 1;
    position: relative;
    min-width: 0;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    border-radius: 50px;
    overflow: visible;
}

.airbnb-horizontal .airbnb-search-field:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.airbnb-horizontal .airbnb-search-field.active {
    background-color: inherit;
    box-shadow: none;
    transform: none;
    z-index: 99998;
}

/* ==========================================================================
   Vertical Layout (Stacked)
   ========================================================================== */

.airbnb-vertical .airbnb-search-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.airbnb-vertical .airbnb-search-field {
    width: 100%;
    border-radius: 12px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.airbnb-vertical .airbnb-search-field:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.airbnb-vertical .airbnb-search-field.active {
    background-color: inherit;
    box-shadow: none;
}

/* ==========================================================================
   Field Content
   ========================================================================== */

.airbnb-field-content {
    padding: 14px 24px;
    position: relative;
    overflow: visible;
}

.airbnb-field-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.airbnb-field-text {
    flex: 1;
    min-width: 0;
}

.airbnb-field-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    color: currentColor;
    opacity: 0.85;
    margin-top: 2px;
}

.airbnb-field-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
}

.airbnb-search-field:hover .airbnb-field-icon,
.airbnb-search-field.active .airbnb-field-icon {
    opacity: 1;
}

.airbnb-field-label {
    display: block;
    font-size: 0.85em;
    font-weight: 700;
    color: inherit;
    margin-bottom: 2px;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    opacity: 0.9;
}

.airbnb-field-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.airbnb-field-input {
    border: none;
    background: transparent;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    padding: 0;
    margin: 0;
    outline: none;
    cursor: pointer;
    width: 100%;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.airbnb-field-input::placeholder {
    color: currentColor;
    opacity: 0.6;
    font-weight: 400;
}

.airbnb-field-input:focus {
    outline: none;
}

/* ==========================================================================
   Field Dividers
   ========================================================================== */

.airbnb-field-divider {
    width: 1px;
    height: 32px;
    background-color: currentColor;
    opacity: 0.15;
    align-self: center;
    flex-shrink: 0;
}

/* ==========================================================================
   Search Button
   ========================================================================== */

.airbnb-search-button-wrapper {
    padding: 7px;
    display: flex;
    align-items: center;
}

/* Tema .btn box-shadow'unu arama butonunda kaldır */
.airbnb-search-wrapper .airbnb-search-button,
.airbnb-search-wrapper .btn.red {
    box-shadow: none !important;
}

/* Buton: tema .btn .red stillerini kullanır; sadece boyut/şekil bizde */
.airbnb-search-button {
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.airbnb-search-button:hover {
    transform: scale(1.04);
}

.airbnb-search-button:active {
    transform: scale(0.98);
}

.airbnb-button-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.airbnb-button-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Sadece ikon; metin kaldırıldı */
.airbnb-button-text {
    display: none !important;
}

/* Mobil/tablette "Arama" metni gösterilir (WPML ile çevrilebilir) */
.airbnb-search-button-text {
    display: none;
}

/* ==========================================================================
   Dropdown Styles
   ========================================================================== */

.airbnb-field-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--airbnb-dropdown-bg, #fff);
    color: inherit;
    font-family: inherit;
    border-radius: 24px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12), 0 3px 6px rgba(0, 0, 0, 0.08);
    padding: 24px;
    min-width: 320px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.airbnb-search-field.active .airbnb-field-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Blok düzen: arama kutusu + liste dikey; yerler hiyerarşik (şehir › bölgeler) */
.airbnb-dropdown-content {
    display: block !important;
    width: 100%;
}

/* ==========================================================================
   Location Dropdown
   ========================================================================== */

.airbnb-location-dropdown {
    min-width: 320px;
}

.airbnb-dropdown-search {
    margin-bottom: 16px;
}

.airbnb-dropdown-search input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid currentColor;
    border-color: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    background: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

.airbnb-dropdown-search input:focus {
    border-color: currentColor;
    opacity: 1;
}

.airbnb-location-results {
    max-height: 300px;
    overflow-y: auto;
}

.airbnb-location-city {
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.airbnb-location-city:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.airbnb-location-city .airbnb-location-text {
    flex: 1;
}

.airbnb-location-chevron {
    font-size: 1.1em;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.airbnb-location-city.airbnb-location-expanded .airbnb-location-chevron {
    transform: rotate(90deg);
}

.airbnb-location-areas {
    padding-left: 12px;
    border-left: 2px solid rgba(0, 0, 0, 0.08);
    margin-left: 16px;
    margin-bottom: 4px;
}

.airbnb-location-areas .airbnb-location-item {
    padding: 8px 12px;
}

.airbnb-location-item {
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.airbnb-location-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.airbnb-location-icon {
    width: 32px;
    height: 32px;
    background-color: rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    opacity: 0.7;
    flex-shrink: 0;
}

.airbnb-location-text {
    flex: 1;
}

.airbnb-location-title {
    font-size: inherit;
    font-weight: 600;
    color: inherit;
    margin-bottom: 2px;
}

.airbnb-location-subtitle {
    font-size: 0.9em;
    color: inherit;
    opacity: 0.75;
}

/* ==========================================================================
   Calendar Dropdown
   ========================================================================== */

.airbnb-calendar-dropdown {
    min-width: 660px;
}

/* Ay önceki/sonraki navigasyon */
.airbnb-calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 8px;
}

.airbnb-calendar-prev,
.airbnb-calendar-next {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.airbnb-calendar-prev:hover,
.airbnb-calendar-next:hover {
    background-color: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.3);
}

.airbnb-calendar-wrapper {
    display: flex;
    gap: 24px;
}

/* Calendar placeholder - You can integrate your preferred calendar library */
.airbnb-calendar-month {
    flex: 1;
}

.airbnb-calendar-header {
    text-align: center;
    font-weight: 600;
    font-size: 1em;
    margin-bottom: 16px;
    color: inherit;
}

.airbnb-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.airbnb-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: inherit;
    color: inherit;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.airbnb-calendar-day:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

/* Seçili günler (check-in / check-out) – gri ton, beyaz yazı */
.airbnb-calendar-day.selected {
    background-color: #5c5c5c !important;
    color: #fff !important;
}

.airbnb-calendar-day.selected:hover {
    background-color: #4a4a4a !important;
    color: #fff !important;
}

/* İki tarih arası günler – açık gri ton */
.airbnb-calendar-day.in-range {
    background-color: #e8e8e8 !important;
    color: #404040 !important;
}

.airbnb-calendar-day.in-range:hover {
    background-color: #d8d8d8 !important;
    color: #404040 !important;
}

.airbnb-calendar-day.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ==========================================================================
   Guests Counter Dropdown
   ========================================================================== */

.airbnb-guests-dropdown {
    min-width: 360px;
}

.airbnb-guest-counter {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.airbnb-counter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px solid currentColor;
    border-color: rgba(0, 0, 0, 0.1);
}

.airbnb-counter-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.airbnb-counter-label {
    flex: 1;
}

.airbnb-counter-label strong {
    display: block;
    font-size: 1em;
    font-weight: 600;
    color: inherit;
    margin-bottom: 4px;
}

.airbnb-counter-label span {
    display: block;
    font-size: 0.9em;
    color: inherit;
    opacity: 0.8;
}

.airbnb-counter-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.airbnb-counter-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid currentColor;
    border-color: rgba(0, 0, 0, 0.25);
    background: inherit;
    color: inherit;
    opacity: 0.8;
    font-size: 18px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.airbnb-counter-btn:hover:not(:disabled) {
    border-color: currentColor;
    opacity: 1;
    transform: scale(1.05);
}

.airbnb-counter-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.airbnb-counter-value {
    font-size: inherit;
    font-weight: 400;
    color: inherit;
    min-width: 20px;
    text-align: center;
}

/* ==========================================================================
   Backdrop Overlay
   ========================================================================== */

/* Backdrop kaldırıldı – dışarı tıklanınca kapatma JS ile */

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

/* Tablet landscape – tam genişlik */
@media (max-width: 1024px) {
    .airbnb-search-wrapper {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }
    .airbnb-search-form,
    .airbnb-search-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
}

/* Tablet – tam genişlik + alan düzeni */
@media (max-width: 992px) {
    .airbnb-search-wrapper {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
        box-sizing: border-box;
    }

    .airbnb-search-form {
        width: 100%;
    }

    .airbnb-search-container {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .airbnb-horizontal .airbnb-search-fields {
        flex-wrap: wrap;
        width: 100%;
    }

    .airbnb-horizontal .airbnb-search-field {
        flex: 1 1 calc(50% - 4px);
        min-width: calc(50% - 4px);
    }

    .airbnb-field-divider {
        display: none;
    }

    .airbnb-calendar-dropdown {
        min-width: 100%;
    }

    .airbnb-calendar-wrapper {
        flex-direction: column;
    }
}

/* Tablet – arama butonu tam genişlik + "Arama" metni */
@media (max-width: 992px) {
    .airbnb-search-button-wrapper {
        width: 100%;
        padding-left: 20px;
        padding-right: 20px;
        box-sizing: border-box;
    }
    
    .airbnb-search-button {
        width: 100%;
        min-width: 0;
        border-radius: 25px;
        padding: 0 20px;
        gap: 10px;
    }
    
    .airbnb-search-button-text {
        display: inline;
        font-weight: 600;
    }
}

/* Mobile – tam genişlik (dikey yığılmış) */
@media (max-width: 768px) {
    .airbnb-search-wrapper {
        max-width: 100%;
        width: 100%;
        padding: 0;
        margin: 0;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    .airbnb-search-form {
        width: 100%;
        max-width: 100%;
    }

    .airbnb-search-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        border-radius: 50px;
        box-sizing: border-box;
    }
    
    .airbnb-horizontal .airbnb-search-fields {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }
    
    .airbnb-horizontal .airbnb-search-field {
        flex: 1 1 100%;
        width: 100%;
        min-width: 100%;
        border-radius: 0;
        box-sizing: border-box;
    }
    
    .airbnb-horizontal .airbnb-search-field:first-child {
        border-radius: 50px 50px 0 0;
    }
    
    .airbnb-horizontal .airbnb-search-field:last-of-type {
        border-radius: 0 0 50px 50px;
    }
    
    .airbnb-field-content {
        padding: 14px 20px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .airbnb-search-button-wrapper {
        padding: 12px 20px;
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }
    
    .airbnb-search-button {
        width: 100%;
        min-width: 0;
        height: 50px;
        min-height: 50px;
        border-radius: 25px;
        padding: 0 20px;
        gap: 10px;
    }
    
    .airbnb-search-button-text {
        display: inline;
        font-weight: 600;
    }
    
    .airbnb-field-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        max-height: 80vh;
        overflow-y: auto;
        transform: translateY(100%);
        box-sizing: border-box;
    }
    
    .airbnb-search-field.active .airbnb-field-dropdown {
        transform: translateY(0);
    }
    
    .airbnb-location-dropdown,
    .airbnb-guests-dropdown,
    .airbnb-calendar-dropdown {
        min-width: 100%;
        width: 100%;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .airbnb-field-label {
        font-size: 10px;
    }
    
    .airbnb-field-input {
        font-size: 13px;
    }
    
    .airbnb-search-button {
        width: 100%;
        height: 50px;
        min-height: 50px;
        padding: 0 20px;
    }
}

/* ==========================================================================
   Animation Utilities
   ========================================================================== */

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

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.airbnb-field-dropdown {
    animation: slideUp 0.3s ease;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.airbnb-search-button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.airbnb-search-button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.airbnb-search-field:focus-within {
    outline: none;
}

.airbnb-search-button:focus {
    outline: 2px solid #222222;
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .airbnb-search-wrapper {
        display: none;
    }
}
