/* NextLabs Booking - Frontend Styles */

/* Archive Layout */
.nlb-archive-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.nlb-archive-header {
    text-align: center;
    margin-bottom: 3rem;
}

.nlb-archive-title {
    font-size: 2.5rem;
    margin: 0;
}

.nlb-archive-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .nlb-archive-container {
        grid-template-columns: 1fr;
    }

    .nlb-sidebar {
        margin-bottom: 2rem;
        padding: 1rem;
    }

    .nlb-filter-group {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .nlb-filter-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .nlb-filter-select {
        padding: 0.75rem;
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .nlb-checkbox-label {
        padding: 0.5rem 0;
    }
}

/* Sidebar Filters */
.nlb-sidebar {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.nlb-filter-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.nlb-filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.nlb-filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #333;
}

.nlb-filter-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.nlb-filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nlb-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem 0;
}

.nlb-checkbox-label:hover {
    color: #0066cc;
}

.nlb-checkbox-label input[type="checkbox"] {
    margin: 0;
}

.nlb-checkbox-label img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.nlb-filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.nlb-filter-submit,
.nlb-filter-reset {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nlb-filter-submit {
    background: #0066cc;
    color: white;
}

.nlb-filter-submit:hover {
    background: #0052a3;
}

.nlb-filter-reset {
    background: #e0e0e0;
    color: #333;
}

/* Campi date nella sidebar */
.nlb-date-inputs-filter {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nlb-date-input-wrapper input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    opacity: 1 !important;
}

.nlb-date-input-wrapper input:focus {
    outline: none;
    border-color: #0066cc;
}

.nlb-filter-reset:hover {
    background: #d0d0d0;
}

/* Main Content */
.nlb-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.nlb-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nlb-toolbar-left>* {
    vertical-align: middle;
}

.nlb-toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Nascondi elementi mobile su desktop */
.nlb-toolbar-controls {
    display: none;
}

.nlb-results-row {
    display: none;
}

.nlb-results-count {
    color: #666;
    display: inline-flex;
    align-items: center;
}

.nlb-count {
    font-weight: 600;
    color: #333;
}

.nlb-sorting-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nlb-sort-select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

/* Listings Grid */
.nlb-listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Listing Card */
.nlb-listing-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.nlb-listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.nlb-card-image {
    position: relative;
    padding-bottom: 66.67%;
    overflow: hidden;
}

.nlb-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nlb-no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.nlb-card-price {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
}

.nlb-card-price span {
    font-size: 0.875rem;
    font-weight: 400;
}

.nlb-card-content {
    padding: 1.5rem;
}

.nlb-card-title {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    line-height: 1.4;
}

.nlb-card-title a {
    color: #333;
    text-decoration: none;
}

.nlb-card-title a:hover {
    color: #0066cc;
}

.nlb-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    color: #666;
    font-size: 0.875rem;
}

.nlb-guests {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nlb-guests svg {
    width: 16px;
    height: 16px;
}

.nlb-card-amenities {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nlb-amenity {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 0.75rem;
}

.nlb-amenity img {
    width: 20px;
    height: 20px;
}

.nlb-more-amenities {
    color: #666;
    font-size: 0.75rem;
}

/* Pagination */
.nlb-pagination {
    margin-top: 3rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nlb-pagination ul,
.nlb-pagination .page-numbers {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
    align-items: center;
}

.nlb-pagination li {
    margin: 0;
}

.nlb-pagination a,
.nlb-pagination span,
.nlb-pagination .page-numbers,
.nlb-pagination .current {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none !important;
    color: #333;
    font-weight: 500;
    font-size: 0.95rem;
    background: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nlb-pagination a:hover,
.nlb-pagination span:not(.current):hover {
    background: #f5f5f5;
    border-color: #0c4a6e;
    color: #0c4a6e;
}

.nlb-pagination .current,
.nlb-pagination span.current {
    background: #0c4a6e;
    color: white !important;
    border-color: #0c4a6e;
    cursor: default;
}

.nlb-pagination .prev,
.nlb-pagination .next {
    font-size: 1.2rem;
    padding: 0.5rem 0.75rem;
}

.nlb-pagination .dots {
    border: none;
    background: transparent;
    cursor: default;
    min-width: auto;
    padding: 0 0.25rem;
}

/* No Results */
.nlb-no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.125rem;
}

/* Loading State */
.nlb-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Helper Classes */
.nlb-mobile-only {
    display: none;
}

.nlb-desktop-only {
    display: block;
}

/* Sorting Mobile */
.nlb-sort-mobile {
    display: none;
}

@media (max-width: 768px) {
    .nlb-mobile-only {
        display: block;
    }

    .nlb-desktop-only {
        display: none;
    }

    .nlb-sort-mobile {
        display: flex;
    }

    .nlb-toolbar-controls {
        display: block;
    }

    .nlb-results-row {
        display: flex;
    }
}

.nlb-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0066cc;
    border-radius: 50%;
    animation: nlb-spin 1s linear infinite;
}

@keyframes nlb-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* View Switcher */
.nlb-view-switcher {
    display: flex;
    gap: 0.25rem;
    border: none;
    border-radius: 4px;
    overflow: hidden;
}

.nlb-view-btn {
    background: white;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nlb-view-btn:hover {
    background: #f0f0f0;
}

.nlb-view-btn.active {
    background: #0066cc;
    color: white;
}

.nlb-view-btn svg {
    width: 20px;
    height: 20px;
}

/* List View */
.nlb-listings-list .nlb-listing-card {
    display: grid;
    grid-template-columns: 300px 1fr;
    margin-bottom: 1.5rem;
}

.nlb-listings-list .nlb-card-image {
    padding-bottom: 0;
    height: 200px;
}

.nlb-listings-list .nlb-card-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Nascondi prezzo nel contenuto per vista griglia */
.nlb-listings-grid .nlb-price-in-content {
    display: none;
}

/* Nascondi prezzo sull'immagine per vista lista */
.nlb-listings-list .nlb-price-on-image {
    display: none;
}

/* List View Mobile */
@media (max-width: 768px) {
    .nlb-listings-list {
        margin-bottom: 2rem;
    }

    .nlb-listings-list .nlb-listing-card {
        display: grid;
        grid-template-columns: 100px 1fr;
        grid-template-rows: auto 1fr;
        gap: 0.75rem;
        margin-bottom: 1rem;
        padding: 0.75rem;
        background: white;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .nlb-listings-list .nlb-card-image {
        grid-row: 1 / -1;
        width: 100px;
        height: 80px;
        position: relative;
        overflow: hidden;
        border-radius: 4px;
    }

    .nlb-listings-list .nlb-card-image img {
        height: 100%;
        width: 100%;
        object-fit: cover;
    }

    /* Badge prezzo nella vista lista mobile - piccolo in alto a destra */
    .nlb-listings-list .nlb-card-price.nlb-price-in-content {
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        left: auto !important;
        background: #024E72 !important;
        color: white !important;
        padding: 2px 6px !important;
        font-size: 0.65rem !important;
        font-weight: 600 !important;
        border-radius: 4px !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        display: inline-block !important;
        width: auto !important;
        height: auto !important;
    }

    /* Mostra il /notte nel badge lista */
    .nlb-listings-list .nlb-card-price span {
        display: inline;
        font-size: 0.65rem;
        font-weight: 400;
    }

    .nlb-listings-list .nlb-card-content {
        grid-column: 2;
        grid-row: 1;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        text-align: left;
        position: relative;
    }

    .nlb-listings-list .nlb-card-title {
        font-size: 0.95rem;
        margin: 0;
        line-height: 1.2;
        padding-top: 1.2rem;
        /* Spazio per il badge prezzo */
    }

    .nlb-listings-list .nlb-card-title a {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nlb-listings-list .nlb-card-meta {
        font-size: 0.75rem;
        margin: 0;
        color: #666;
    }

    /* Icone servizi nel box sotto tutto, da sinistra */
    .nlb-listings-list .nlb-card-amenities {
        grid-column: 1 / -1;
        grid-row: 2;
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        overflow: visible;
        padding-top: 0.5rem;
        margin-top: auto;
    }


    .nlb-listings-list .nlb-amenity {
        padding: 0.1rem 0.3rem;
        font-size: 0.6rem;
        flex: 0 0 auto;
        white-space: nowrap;
        background: #D6EAF3;
        /* Stesso sfondo della vista griglia */
        border-radius: 4px;
    }

    .nlb-listings-list .nlb-amenity img {
        width: 12px;
        height: 12px;
        vertical-align: middle;
        margin-right: 2px;
    }
}

/* Map View */
.nlb-listings-map {
    height: 600px;
    position: relative;
}

.nlb-map-container {
    width: 100%;
    height: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f0f0f0;
}

/* InfoWindow personalizzato */
.nlb-map-popup {
    max-width: 300px;
}

.nlb-map-popup-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.nlb-map-popup-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 5px;
}

.nlb-map-popup-price {
    color: #0066cc;
    font-weight: 600;
    margin-bottom: 5px;
}

.nlb-map-popup-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.nlb-map-popup-link {
    display: inline-block;
    background: #0066cc;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.nlb-map-popup-link:hover {
    background: #0052a3;
    color: white;
}

/* Custom Map Markers */
.nlb-map-marker {
    position: relative;
    cursor: pointer;
}

.nlb-marker-pin {
    width: 30px;
    height: 30px;
    background: #0066cc;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.nlb-marker-pin::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.nlb-map-marker:hover .nlb-marker-pin {
    background: #0052a3;
    transform: rotate(-45deg) scale(1.1);
}

/* Search Banner */
.nlb-search-banner {
    background: linear-gradient(135deg, #007ba3 0%, #005f82 100%);
    border-radius: 8px;
    margin: 1rem 0 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 123, 163, 0.2);
}

.nlb-search-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.5rem;
    color: white;
}

.nlb-search-banner-content svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.nlb-search-banner-text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.4;
}

.nlb-search-banner-text strong {
    font-weight: 600;
}

.nlb-search-banner-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nlb-search-banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

@media (max-width: 768px) {
    .nlb-search-banner-content {
        padding: 0.875rem 1rem;
        gap: 10px;
    }

    .nlb-search-banner-text {
        font-size: 0.875rem;
    }

    .nlb-search-banner-close {
        width: 26px;
        height: 26px;
        font-size: 18px;
    }
}