/* Stili specifici per la pagina delle palestre */
:root {
    --primary-color: #003580;
    --primary-hover: #00224f;
    --secondary-color: #0071c2;
    --accent-color: #ffb700;
    --text-dark: #1a1a1a;
    --text-light: #6b6b6b;
    --bg-light: #f2f7fc;
    --white: #ffffff;
}

/* Layout principale */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.d-flex.gap-4 {
    gap: 2rem !important;
}

/* Filtri */
.filters-container {
    width: 300px;
    flex-shrink: 0;
}

.filters-container .card {
    position: sticky;
    top: 2rem;
    background: var(--white);
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 12px;
}

/* Mini Mappa */
.mini-map {
    height: 200px;
    width: 100%;
    border-radius: 0 0 0.375rem 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.mini-map:hover {
    opacity: 0.9;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

/* Overlay trasparente per aprire il modal cliccando ovunque */
.mini-map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    cursor: pointer;
    z-index: 10;
    border-radius: 0 0 0.375rem 0.375rem;
    transition: background-color 0.2s ease;
}

.mini-map-overlay:hover {
    background: rgba(0, 123, 255, 0.05);
}

.mini-map-card {
    position: sticky;
    top: 2rem;
    margin-bottom: 1rem;
}

/* Risultati */
.results-container {
    flex: 1;
    min-width: 0;
}

/* Card palestra */
.gym-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem !important;
}

.gym-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    min-height: 250px !important;
    max-height: 250px !important;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s ease-in-out;
    background: white;
    overflow: hidden;
    position: relative;
}

.gym-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.gym-image {
    flex: 0 0 280px !important;
    height: 250px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    overflow: hidden;
    position: relative;
    border-radius: 1rem 0 0 1rem;
}

.gym-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center;
}

.gym-info {
    flex: 1 1 0%;
    padding: 1rem 1rem 1rem 1rem !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    height: 250px !important;
    overflow-y: auto;
}

.gym-header {
    margin-bottom: 0.2rem;
}

.gym-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0;
}

.gym-title-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.gym-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gym-title-rating .rating-score {
    font-weight: 600;
    color: #fff;
    background-color: #007bff;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stars-inline {
    display: flex;
    align-items: center;
    color: #ffc107;
    gap: 0rem;
    align-items: center;
    font-size: 0.8rem;
}

.stars-inline i {
    margin-right: -0.1rem;
}

.price {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2470dc;
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: flex-end;
}

.d-flex.mb-2 {
    margin-bottom: 0.18rem !important;
}

.location {
    color: #6c757d;
    margin-bottom: 0.15rem;
    font-size: 0.88rem;
    margin-top: 0;
}

.rating {
    margin-bottom: 0.15rem;
}

.stars {
    color: #ffc107;
    margin-bottom: 0.05rem;
    font-size: 0.85rem !important;
}

.stars i {
    margin-right: 0.05rem;
}

.review-count {
    color: #6c757d;
    font-size: 0.8rem;
}

.amount {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2470dc;
}

.period {
    color: #6c757d;
    font-size: 0.9rem;
}

.services {
    margin-bottom: 0.2rem;
    flex-wrap: wrap;
}

.service-tag {
    display: inline-block;
    padding: 0.12rem 0.45rem;
    margin: 0.06rem 0.06rem 0.06rem 0;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    font-size: 0.72rem;
    color: #495057;
}

.service-tag.more {
    background-color: #e9ecef;
    color: #6c757d;
}

.btn-details {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    width: auto;
    max-width: 180px;
    min-width: 100px;
    padding: 0.4rem 0.8rem;
    font-weight: 500;
    border-radius: 0.5rem;
    background-color: #2470dc;
    border-color: #2470dc;
    color: #fff;
    text-align: center;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-details:hover {
    background-color: #1a5bb8;
    border-color: #1a5bb8;
    color: #fff;
}

@media (max-width: 900px) {
    .gym-card {
        flex-direction: column;
    }
    .gym-image {
        flex: none;
        width: 100%;
        height: 200px;
        min-width: unset;
        border-radius: 1rem 1rem 0 0;
    }
    .gym-info {
        padding: 0.7rem;
    }
    .btn-details {
        position: static;
        width: 100%;
        max-width: none;
        margin-top: 0.5rem;
    }
}

/* Stili per la scrollbar dei servizi */
.service-checkboxes::-webkit-scrollbar {
    width: 8px;
}

.service-checkboxes::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.service-checkboxes::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.service-checkboxes::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Stili per il form dei filtri */
.filter-card {
    position: sticky;
    top: 2rem;
    margin-bottom: 3rem !important;
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 123, 255, 0.07);
    background: #fff;
    overflow: hidden;
}

.filter-header {
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
}

.filter-header:hover,
.filter-header[aria-expanded="true"] {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.filter-header .d-flex {
    width: 100%;
}

.filter-header h5 {
    margin: 0;
    font-size: 1.1rem;
    color: white !important;
    text-align: center;
    font-weight: 600;
}

.filter-header i {
    color: white !important;
    transition: transform 0.2s;
    font-size: 0.9rem;
}

.filter-header i.fa-chevron-up {
    transform: rotate(180deg);
}

.filter-body {
    padding: 1rem;
}

.form-select, .form-control {
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
}

.form-select:focus, .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-check {
    margin-bottom: 0.5rem;
}

.form-check-label {
    font-size: 0.9rem;
    color: #222;
    font-weight: 500;
}

.form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.form-check-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Stili per l'ordinamento */
.sort-container {
    display: flex;
    align-items: center;
}

.sort-wrapper {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 8px 16px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.sort-wrapper:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.15);
}

.sort-label {
    font-weight: 600;
    color: #495057;
    margin: 0;
    margin-right: 12px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.sort-select-wrapper {
    position: relative;
    min-width: 180px;
}

.sort-select {
    border: none;
    background: transparent;
    font-weight: 500;
    color: #495057;
    padding: 8px 35px 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-size: 0.9rem;
}

.sort-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.sort-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.sort-select:focus + .sort-icon {
    transform: translateY(-50%) rotate(180deg);
}

.sort-select option {
    padding: 8px 12px;
    font-weight: 500;
}

/* Stelle mobile - nascoste di default */
.stars-mobile {
    display: none;
}

.rating-score-mobile {
    margin-right: 0.3rem;
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    color: white !important;
}

/* Stelle overlay sull'immagine - nascoste di default */
.stars-overlay {
    display: none;
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.3rem 0.5rem;
    border-radius: 0.5rem;
    backdrop-filter: blur(2px);
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.rating-score-overlay {
    color: white !important;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    margin-right: 0.3rem;
}

.stars-overlay i {
    color: #ffc107;
    font-size: 0.8rem;
    margin-right: 0.05rem;
}

/* Mobile styles */
@media (max-width: 991.98px) {
    .filters-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: var(--white);
        z-index: 1050;
        padding: 1rem;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .filters-container.show {
        transform: translateX(0);
    }

    .mobile-filters-toggle {
        display: block;
        margin-bottom: 1rem;
    }

    .filters-close {
        display: block;
        position: absolute;
        top: 1rem;
        right: 1rem;
        z-index: 1;
    }
    
    /* Mini mappa su mobile */
    .mini-map {
        height: 150px;
    }
    
    .mini-map-card {
        position: static;
        margin-bottom: 1rem;
    }
}

@media (max-width: 767.98px) {
    .gym-card img {
        height: 200px;
        border-radius: 12px 12px 0 0 !important;
    }

    .sort-wrapper {
        padding: 6px 12px;
        border-radius: 8px;
    }
    
    .sort-label {
        font-size: 0.8rem;
        margin-right: 8px;
    }
    
    .sort-select-wrapper {
        min-width: 140px;
    }
    
    .sort-select {
        padding: 6px 30px 6px 10px;
        font-size: 0.8rem;
    }
    
    .sort-icon {
        right: 8px;
        font-size: 0.8rem;
    }

    .services-checkboxes {
        max-height: 200px;
    }

    .filter-header {
        padding: 0.8rem;
        border-radius: 12px;
        margin-bottom: 1rem;
        letter-spacing: 0.5px;
    }
    
    .filter-header:hover,
    .filter-header[aria-expanded="true"] {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
    }
    
    .filter-header h5 {
        font-size: 1rem;
        color: white !important;
        margin: 0 0.5rem;
        font-weight: 600;
    }

    .results-title {
        font-size: 1.3rem !important;
    }
    
    /* Migliora l'allineamento dell'header dei risultati su mobile */
    .results-header .d-flex.justify-content-between {
        align-items: flex-start !important;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .results-header .d-flex.justify-content-between > div:first-child {
        flex: 1;
        min-width: 0;
    }
    
    .results-header .sort-container {
        flex-shrink: 0;
        align-self: flex-start;
        margin-top: 0;
        display: flex;
        align-items: center;
    }
    
    .results-header .sort-container label {
        font-size: 0.9rem;
        font-weight: 500;
        color: #495057;
        margin-bottom: 0;
        line-height: 1;
    }
}

/* Scrollbar personalizzata */
.services-checkboxes::-webkit-scrollbar {
    width: 6px;
}

.services-checkboxes::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 3px;
}

.services-checkboxes::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 3px;
}

.services-checkboxes::-webkit-scrollbar-thumb:hover {
    background: var(--text-dark);
}

/* Desktop styles */
@media (min-width: 992px) {
    .filters-container {
        display: block !important;
    }
    
    .mobile-filters-toggle {
        display: none;
    }
    
    .gym-card {
        height: 300px;
    }
    
    .gym-card .row {
        height: 100%;
    }
    
    .gym-card .col-md-3 {
        height: 100%;
    }
    
    .gym-card img {
        height: 100%;
        border-radius: 12px 0 0 12px !important;
    }
}

/* Descrizione Card */
.description-card {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Media queries per mobile */
@media (max-width: 768px) {
    .container.mt-4 {
        margin-top: 2rem !important;
        padding-top: 1rem !important;
    }

    .gym-card {
        flex-direction: column !important;
        min-height: auto !important;
        max-height: none !important;
    }

    .gym-image {
        flex: none !important;
        width: 100% !important;
        height: 200px !important;
        min-width: 100% !important;
        max-width: 100% !important;
        border-radius: 1rem 1rem 0 0 !important;
    }

    .gym-info {
        height: auto !important;
        min-height: 200px !important;
        padding: 1rem !important;
    }

    .gym-info h3 {
        font-size: 1.2rem !important;
        margin-bottom: 0 !important;
    }

    .location {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem !important;
    }

    .price {
        font-size: 1.1rem !important;
        margin: 0.5rem 0 !important;
    }

    .amount {
        font-size: 1.3rem !important;
    }

    .services {
        margin: 0.5rem 0 !important;
    }

    .service-tag {
        font-size: 0.7rem !important;
        padding: 0.1rem 0.4rem !important;
        margin: 0.05rem !important;
    }

    .btn-details {
        position: static !important;
        width: 100% !important;
        margin-top: 0.5rem !important;
    }

    /* Rimuovo il truncate della descrizione su mobile */
    .description-card {
        display: block !important;
        -webkit-line-clamp: unset !important;
        -webkit-box-orient: unset !important;
        overflow: visible !important;
        text-overflow: unset !important;
        white-space: normal !important;
        margin-bottom: 0.5rem !important;
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
        color: #6c757d !important;
    }

    /* Filtri mobile */
    .filter-card {
        position: static !important;
        margin-bottom: 1.5rem !important;
    }

    .filter-card .card-body {
        padding: 1rem;
    }

    .collapse:not(.show) {
        display: none;
    }

    .collapse.show {
        display: block;
    }

    .filter-header {
        color: white;
    }

    .filter-toggle i {
        transition: transform 0.3s ease;
    }

    .filter-toggle i.fa-chevron-up {
        transform: rotate(180deg);
    }

    .form-select, .form-control {
        font-size: 0.9rem !important;
        padding: 0.5rem !important;
    }

    .form-check-label {
        font-size: 0.85rem !important;
    }

    /* Header mobile */
    .gym-title {
        font-size: 1.2rem !important;
        margin-bottom: 0 !important;
        overflow: visible !important;
        text-overflow: unset !important;
        white-space: normal !important;
        line-height: 1.2 !important;
    }

    .gym-location {
        font-size: 0.85rem !important;
        margin-top: 0 !important;
        margin-bottom: 0.5rem !important;
    }

    .stars-inline {
        font-size: 0.8rem !important;
    }

    /* Layout mobile specifico */
    .gym-info .d-flex.justify-content-between {
        flex-direction: row !important;
        align-items: flex-start !important;
        flex-wrap: wrap !important;
    }

    .gym-info .d-flex.justify-content-between > div:first-child {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }

    .gym-info .d-flex.justify-content-between > div:last-child {
        align-self: flex-end !important;
        margin-top: -2.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* Layout mobile corretto con due righe */
    .gym-info .d-flex.justify-content-between {
        flex-direction: row !important;
        align-items: flex-start !important;
        flex-wrap: wrap !important;
    }

    .gym-info-left {
        flex: 1 !important;
        min-width: 0 !important;
    }

    .gym-info-right {
        flex-shrink: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        gap: 0.3rem !important;
    }

    .gym-info-left .d-flex.align-items-center {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        margin-bottom: 0.3rem !important;
    }

    .gym-info-left .d-flex.align-items-center .gym-title {
        margin-bottom: 0 !important;
        flex: 1 !important;
    }

    .gym-info-left .d-flex.align-items-center .price {
        margin: 0 !important;
        text-align: right !important;
        flex-shrink: 0 !important;
    }

    .gym-info-left .stars-inline {
        display: none !important;
    }

    .gym-header .stars-inline {
        display: none !important;
    }

    /* Mostra stelle mobile */
    .stars-mobile {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        font-size: 0.8rem !important;
        color: #ffc107;
    }

    .stars-mobile i {
        margin-right: 0.05rem;
    }

    .rating-score-mobile {
        color: white !important;
        font-size: 0.7rem;
        font-weight: 500;
        margin-right: 0.3rem;
        display: inline-block;
    }

    /* Mostra stelle overlay sull'immagine su mobile */
    .stars-overlay {
        display: flex !important;
        align-items: center !important;
    }

    /* Nasconde stelle nella sezione info su mobile */
    .stars-mobile {
        display: none !important;
    }

    /* Nascondi rating accanto al nome su mobile */
    .gym-title-rating .rating-score,
    .gym-title-rating .stars-inline {
        display: none !important;
    }
    
    .gym-title-rating {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .gym-title {
        margin-bottom: 0;
    }

    .sort-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        background: transparent;
        border: none;
        padding: 0;
    }
    
    .sort-label {
        margin-right: 0;
        text-align: center;
        font-size: 0.9rem;
    }
    
    .sort-select-wrapper {
        min-width: auto;
    }
    
    .sort-select {
        width: 100%;
        border: 1px solid #ced4da;
        background: white;
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .sort-icon {
        display: none;
    }
}

/* Media query per schermi molto piccoli */
@media (max-width: 480px) {
    .gym-image {
        height: 180px !important;
    }

    .gym-info {
        min-height: 180px !important;
    }

    .gym-info h3 {
        font-size: 1.1rem !important;
    }

    .price {
        font-size: 1rem !important;
    }

    .amount {
        font-size: 1.2rem !important;
    }

    .service-tag {
        font-size: 0.65rem !important;
        padding: 0.08rem 0.3rem !important;
    }
}

/* ===== STILI INLINE MIGRATI DAL FILE PHP ===== */

/* Stili per i risultati */
.results-card-body {
    padding: 0.6rem;
}

.results-title {
    color: #2470dc !important;
    font-weight: 600 !important;
}

.results-count {
    font-size: 0.95rem;
}

/* Breadcrumb in stile Booking */
.booking-breadcrumb {
    border-bottom: 1px solid #e6e6e6;
    background: transparent;
    padding: 0.5rem 0 1rem 0;
    margin-top: -0.5rem;
}

/* Service checkboxes con scroll */
.service-checkboxes {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Media queries per mobile - stili migrati */
@media (max-width: 767.98px) {
    .results-title {
        font-size: 1.3rem !important;
    }
}

@media (max-width: 767px) {
    .booking-breadcrumb {
        padding: 0.5rem 0;
        margin-top: -0.25rem;
        margin-bottom: 1rem;
    }
    
    .container.mt-4 {
        margin-top: 1rem !important;
        padding-top: 0 !important;
    }
    
    /* Rimuove il position sticky della card filtri su mobile */
    .filter-card {
        position: static !important;
        top: auto !important;
        margin-top: 0 !important;
    }
    
    /* Assicura che il breadcrumb sia sopra tutto */
    .booking-breadcrumb {
        position: relative;
        z-index: 10;
    }
}

/* ===== STILI PER IL PULSANTE PREFERITI ===== */

/* Stili per il pulsante preferiti */
.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.favorite-btn:hover {
    background: white;
    transform: scale(1.1);
}

.favorite-btn i {
    color: #dc3545;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.favorite-btn[data-is-favorite="true"] i {
    color: #dc3545;
}

.favorite-btn[data-is-favorite="false"] i {
    color: #6c757d;
}

.favorite-btn[data-is-favorite="true"] i.far {
    display: none;
}

.favorite-btn[data-is-favorite="true"] i.fas {
    display: inline-block;
}

.favorite-btn[data-is-favorite="false"] i.far {
    display: inline-block;
}

.favorite-btn[data-is-favorite="false"] i.fas {
    display: none;
}

/* Stile per il titolo "Filtri" nella card */
.filter-card .card-title {
    color: white !important;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 12px;
    padding: 0.75rem 1rem !important;
    margin-bottom: 1.5rem;
}

/* Rimuove il gradiente su mobile per evitare l'alone visivo */
@media (max-width: 767.98px) {
    .filter-card .card-title {
        background: transparent !important;
        color: white !important;
        border-radius: 0;
        padding: 0.5rem 0 !important;
        margin-bottom: 1rem;
    }
} 