/**
 * Gnarly Booking Engine - Copyright (c) 2025 Brand Wars LLC
 * Licensed under proprietary license. See LICENSE.txt for details.
 */


.inner-container > .content-editor {
    width: 100% !important;
}
    
/* Ensure full width search bar */
.hostapi-search-bar-container {
    width: 100%;
    margin: 0 auto; /* Center horizontally */
    padding: 15px 20px;
    background: white;
    z-index: 1;
    position: relative; /* Remove fixed positioning */
}

.hostapi-listings-wrapper {
    width: 100vw !important;  /* Force full width */
    max-width: 100% !important;
    padding: 0;
    margin: 0;
}

/* Remove focus outline from listing items */
.hostapi-listing-item a,
.hostapi-listing-item a:focus,
.hostapi-listing-item > a:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

/* Optional: Add a subtle hover effect instead */
.hostapi-listing-item:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Override theme container constraints */
.hostapi-listings-wrapper .content-editor {
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 0 !important;
    margin: 0 !important;
}

.hostapi-listings-container {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Main layout for listings and map */
.hostapi-listings-map-container {
    display: flex;
    width: 100%; /* ✅ Ensure the section spans full width */
    max-width: 100vw;
    height: calc(100vh - 100px); /* Adjust height based on header */
    margin: 0; /* ✅ Remove excess spacing */
}

/* Left column: Listings */
.hostapi-listings-content {
    flex: 0 0 55%; 
    height: 100%;
    overflow-y: auto;
    background: white;
    border-radius: 8px;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 20px;
}

/* Right column: Map */
.hostapi-map-container {
    flex: 0 0 45%; 
    height: 100%;
}

/* Ensure the map fills its container */
#hostapi-map {
    width: 100%;
    height: 100%;
}

/* Details */
.hostapi-listing__details {
    flex: 1;
    flex-grow: 1; /* Expands to fill the rest of the space */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-left: 20px;
}

.hostapi-listings-header {
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white; /* ✅ Fixes background issue */
    padding-top: 20px;
    padding-bottom: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #ddd;
    z-index: 10; /* Ensures it stays above other content */
}

.hostapi-sort__label {
    display: none;
}

/* Divider */
.hostapi-listings-divider {
    border: 1px solid #ddd;
    margin: 20px 0;
}

/* Listing Item */
.hostapi-listing-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
}

/* Thumbnail */
.hostapi-listing__thumbnail {
    position: relative;
    min-width: 280px;
    width: 280px;
    height: 200px;
    overflow: hidden;
    border-radius: 10px;
    flex-shrink: 0;
}

.hostapi-carousel {
    position: relative;
    overflow: hidden;
    height: 100%;
    width: 100%;
}

.hostapi-carousel__images {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
    height: 100%;
}

.hostapi-carousel__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hostapi-carousel__left,
.hostapi-carousel__right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 30px;
    cursor: pointer;
}

.hostapi-carousel__left {
    left: 10px;
}

.hostapi-carousel__right {
    right: 10px;
}

.hostapi-listing__title {
    font-size: 20px;
    font-weight: bold;
    margin: 0 0 10px;
}

.hostapi-listings__title {
    font-size: 18px;
    margin-left: 10px;
}

.hostapi-listing__location,
.hostapi-listing__price {
    margin: 0;
    font-size: 16px;
    color: #555;
}

.hostapi-listing__price {
    margin: 5px 0;
}

.hostapi-info-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.hostapi-listing__info {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #555;
    align-items: center;
    margin: 21px 0;
}

.hostapi-listing__info i {
    margin-right: 5px;
    color: #999;
}

.hostapi-listings-title-container {
    display: flex;
    justify-content: space-between; /* Align the title and sort dropdown */
    align-items: center;
    margin-bottom: 16px; /* Add spacing below the title and sort dropdown */
}

/* 1) Add bottom border and spacing */
.hostapi-listing-item:not(#hostapi-listing-template) {
    border-bottom: 1px solid #ddd;  /* The 2px #ddd divider */
    padding-bottom: 20px;          /* Some spacing before the line */
    margin-bottom: 20px;           /* Space after the line */
}

/* 2) Remove the border on the last listing so it doesn't show an extra line */
.hostapi-listing-item:not(#hostapi-listing-template):last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Calendar popup customizations */
.litepicker {
    font-size: 14px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* General improvements - Apply to all device sizes */
html, body {
    max-width: 100%;
    overflow-x: hidden !important;
    width: 100%;
    position: relative;
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Mobile Styles (up to 934px) */
@media (max-width: 934px) {
    /* Make listings container full width */
    .hostapi-listings-content {
        width: 100% !important;
        flex: none !important;
        overflow-x: hidden !important;
        box-sizing: border-box;
    }

    /* Listing Items */
    .hostapi-listing-item {
        width: 100%;
        padding: 15px;
        margin-bottom: 20px;
        border-bottom: 1px solid #ddd;
        box-sizing: border-box;
        max-width: 100%;
        overflow-x: hidden !important;
    }

    /* Make thumbnail full width */
    .hostapi-listing__thumbnail {
        width: 100% !important;
        height: 250px;
        position: relative;
        border-radius: 10px;
        overflow: hidden !important;
        margin-bottom: 15px;
        max-width: 100% !important;
    }

    /* Header and Sort */
    .hostapi-listings-header {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .hostapi-listings-title-container {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .hostapi-carousel {
        width: 100% !important;
        height: 100%;
        position: relative;
        overflow: hidden !important; /* Force hide overflow */
    }

    .hostapi-carousel__images {
        width: 100% !important;
        height: 100%;
        display: flex;
        position: relative;
    }

    .hostapi-carousel__image {
        width: 100% !important;
        height: 100%;
        object-fit: cover;
        flex: 0 0 100% !important; /* Ensure each image takes exactly 100% width */
        display: none; /* Hide all images by default */
    }

    /* Only show the active image */
    .hostapi-carousel__image[style*="display: block"] {
        display: block !important;
    }
    
    .hostapi-carousel__left,
    .hostapi-carousel__right {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        background-color: rgba(0, 0, 0, 0.5);
        color: white;
        border: none;
        border-radius: 50%;
        display: flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10;
        font-size: 20px;
    }

    .hostapi-carousel__left {
        left: 10px;
    }

    .hostapi-carousel__right {
        right: 10px;
    }

    .hostapi-listing__details {
        width: 100%;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        max-width: 100%;
        overflow-x: hidden !important;
    }

    .hostapi-listing__title {
        font-size: 20px;
        font-weight: bold;
        color: #333;
        margin: 0 0 8px 0;
        display: block;
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hostapi-listing__location {
        font-size: 16px;
        color: #666;
        margin: 0 0 12px 0;
        display: block;
    }

    .hostapi-listing__info {
        display: flex;
        gap: 15px;
        margin: 12px 0;
        width: 100%;
    }

    .hostapi-listing__price {
        font-size: 22px;
        font-weight: 500;
        color: #333;
        margin: 12px 0 0 0;
        display: block;
        margin-bottom: 25px;
    }

    .hostapi-info-item {
        display: flex;
        align-items: center;
        gap: 5px;
        color: #666;
    }

    .hostapi-info-item i {
        font-size: 16px;
        color: #888;
    }

    /* Fix header spacing */
    .hostapi-listings-header {
        padding: 15px;
    }
    
    .inner-container > .content-editor {
        margin: 0 auto !important;
        width: 100% !important;
    }
    
    .hostapi-listings-container {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .hostapi-listings-map-container {
        display: grid;
        grid-template-rows: auto 1fr;
        width: 100%;
        max-width: 100vw;
        height: 100% !important;
        overflow-y: auto;
        overflow-x: hidden !important;
        margin: 0 !important;
    }

    .hostapi-map-container {
        width: 100% !important;
        height: 300px !important;
        display: block !important;
        order: -1;
        margin-bottom: 20px;
        overflow: hidden !important;
    }

    #hostapi-map {
        width: 100% !important;
        height: 100% !important;
    }
    
    .hostapi-listing-item > a {
        display: flex !important;
        flex-direction: column !important;
        width: 100%;
        text-decoration: none;
        color: inherit;
        overflow-x: hidden !important;
    }
    
    /* Ensure all elements in the listings wrapper don't cause horizontal overflow */
    .hostapi-listings-wrapper,
    .hostapi-listings-wrapper .content-editor {
        overflow-x: hidden !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
}

/* Tablet Styles (935px - 1200px) */
@media (min-width: 935px) and (max-width: 1200px) {
    .inner-container > .content-editor {
        width: 100% !important;
    }
    
    .hostapi-listings-container {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .hostapi-listings-map-container {
        display: grid;
        grid-template-rows: auto 1fr;
        width: 100%;
        max-width: 100vw;
        height: calc(100vh - 100px) !important;
        overflow-y: auto;
        overflow-x: hidden !important;
    }

    .hostapi-map-container {
        width: 100% !important;
        height: 300px !important;
        display: block !important;
        order: -1;
        margin-bottom: 20px;
        overflow: hidden !important;
    }

    #hostapi-map {
        width: 100% !important;
        height: 100% !important;
    }

    .hostapi-listings-content {
        width: 100% !important;
        padding: 20px;
        overflow-x: hidden !important;
        box-sizing: border-box;
    }

    .hostapi-listing-item {
        display: flex;
        gap: 20px;
        width: 100% !important;
        box-sizing: border-box;
        overflow-x: hidden !important;
    }

    .hostapi-listing__thumbnail {
        width: 280px;
        height: 200px;
        flex-shrink: 0;
        overflow: hidden !important;
    }
    
    .hostapi-listing__details {
        flex: 1 !important;
        overflow-x: hidden !important;
    }
    
    /* Ensure wrapper elements don't cause horizontal overflow */
    .hostapi-listings-wrapper,
    .hostapi-listings-wrapper .content-editor {
        overflow-x: hidden !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
}

/* Desktop Styles (1024px - 1200px) */
@media (min-width: 1024px) and (max-width: 1200px) {
    .hostapi-listings-map-container {
        flex-direction: row;
        overflow-x: hidden !important;
    }

    .hostapi-map-container {
        display: block !important;
        flex: 0 0 35%;
        overflow: hidden !important;
    }

    .hostapi-listings-content {
        flex: 0 0 65%;
        overflow-x: hidden !important;
    }
}

/* Large Desktop Styles (1201px and up) */
@media (min-width: 1201px) {
    .hostapi-listings-map-container {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: hidden !important;
    }
    
    .hostapi-listings-content {
        flex: 0 0 65% !important;
        overflow-x: hidden !important;
    }
    
    .hostapi-map-container {
        flex: 0 0 35% !important;
        overflow: hidden !important;
    }
    
    /* Ensure even on large screens there's no horizontal scrolling */
    .hostapi-listings-wrapper,
    .hostapi-listings-wrapper .content-editor {
        overflow-x: hidden !important;
        box-sizing: border-box;
    }
}

/* Hide '15 rentals' text on mobile devices */
@media (max-width: 767px) {
  #hostapi-total-rentals,
  .hostapi-listings__title {
    display: none !important;
  }
  /* Ensure the listings header has proper spacing */
  .hostapi-listings-header {
    padding: 15px 15px 5px 15px;
    width: 100%;
    box-sizing: border-box;
  }
}

/* For smaller mobile devices, additional optimization */
@media (max-width: 480px) {
  .hostapi-filter-button {
    height: 56px; /* Even taller on very small screens */
    font-size: 16px; /* Slightly larger text */
  }
}

/* Small mobile devices */
@media (max-width: 390px) {
    .hostapi-listing__info {
        font-size: 10px;
    }
    
    /* Further optimizations for very small screens */
    .hostapi-listing-item {
        padding: 10px !important;
    }
    
    .hostapi-carousel__left,
    .hostapi-carousel__right {
        width: 30px !important;
        height: 30px !important;
    }
}
/* --- Review rating on listing cards --- */
.hostapi-review-rating {
    margin: 4px 0;
    font-size: 14px;
    color: #222;
    display: flex;
    align-items: center;
    gap: 4px;
}
.hostapi-review-rating i.fa-star {
    color: #ff385c;
}
.hostapi-review-rating .hostapi-rating-count {
    color: #717171;
}

/* ---------------------------------------------------------------------------
 * AI Search — first segment in the search bar, with a dropdown + suggestions
 * ------------------------------------------------------------------------- */
.hostapi-nl-segment {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 400px;
  display: flex;
  align-items: stretch;   /* fill the bar height so the cell sits flush */
  align-self: stretch;
  height: 82px;
  z-index: 1001;
}
/* The trigger cell matches the City/Dates cell look (82px tall, 15px padding),
   label over value, left-rounded since it's now the first segment in the bar. */
.hostapi-nl-trigger {
  width: 100%;
  height: 82px;
  box-sizing: border-box;
  padding: 15px 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px 0 0 8px;
  cursor: text;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  transition: border-color .2s ease;
}
.hostapi-nl-trigger:hover,
.hostapi-nl-segment.open .hostapi-nl-trigger { border-color: #cbd5e1; }
.hostapi-nl-label { font-size: 13px; color: #6b7280; line-height: 1.2; }
.hostapi-nl-value { font-size: 16px; color: #1a1a1a; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hostapi-nl-value.has-query { color: #1a1a1a; font-weight: 500; }

/* Dropdown panel (input + suggestions), opened on focus/click. */
.hostapi-nl-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(620px, 92vw);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(40,20,60,.16);
  padding: 14px;
  z-index: 2000;
  display: none;
}
.hostapi-nl-segment.open .hostapi-nl-dropdown { display: block; }
#hostapi-nlsearch {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 15px;
  color: #1e293b;
  outline: none;
}
#hostapi-nlsearch:focus { border-color: #B43DC5; }
#hostapi-nlsearch::placeholder { color: #94a3b8; }

.hostapi-nl-suggestions { margin-top: 8px; }
.hostapi-nl-suggestions-head {
  font-size: 13px; color: #6b7280; font-weight: 600;
  padding: 10px 4px 6px;
}
.hostapi-nl-suggestion {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; cursor: pointer;
  padding: 11px 6px; font-size: 15px; color: #1e293b;
  border-radius: 8px;
}
.hostapi-nl-suggestion:hover { background: #f5f3ff; color: #7a1f87; }
.hostapi-nl-empty { padding: 10px 6px; color: #94a3b8; font-size: 14px; }

@media (max-width: 768px) {
  .hostapi-nl-segment { min-width: 0; max-width: none; width: 100%; }
  .hostapi-nl-dropdown { width: 92vw; left: 0; }
}
