/* Stili per la pagina di dettaglio palestra */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --accent-color: #ffc107;
    --text-color: #212529;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
}

/* Mappa Google */
.gym-map {
    width: 100%;
    height: 300px;
    border-radius: 0 0 0.375rem 0.375rem;
}

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

/* Container pulsante sotto il marker Google Maps */
.booking-map-button-container {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.booking-map-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    white-space: nowrap;
    backdrop-filter: blur(5px);
}

.booking-map-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.booking-map-btn:active {
    transform: translateY(0);
}

/* Responsive per il pulsante */
@media (max-width: 768px) {
    .booking-map-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .booking-map-button-container {
        top: 65%;
    }
}

/* Sidebar */
.gym-sidebar {
    margin-top: 1.5rem;
    position: relative;
    top: 0;
    height: 100%;
}

.gym-action-btn {
    transition: all 0.2s ease;
}

.gym-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Galleria immagini */
.main-image {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gym-main-image {
    height: 400px;
    object-fit: cover;
}

.gym-thumbnails-container {
    gap: 0.5rem;
}

.gym-thumbnail-wrapper {
    height: calc(50% - 0.25rem);
    position: relative;
}

.gym-thumbnail {
    object-fit: cover;
    cursor: pointer;
}

.small-thumb {
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.small-thumb:hover {
    box-shadow: 0 0 0 2px var(--primary-color);
}

.overlay-more-photos {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.overlay-more-photos:hover {
    background: rgba(0, 0, 0, 0.7);
}

.overlay-more-photos i {
    display: block;
    margin-bottom: 0.5rem;
}

.overlay-icon {
    font-size: 1.5rem;
}

/* Modal Galleria */
#galleryModal .modal-content {
    background-color: rgba(0, 0, 0, 0.9);
    border-radius: 0.5rem;
}

#galleryModal .modal-dialog {
    margin: 0;
    max-width: 100%;
    height: 100vh;
}

#galleryModal .btn-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    z-index: 1050;
}

#galleryModal .btn-light {
    opacity: 0.8;
    transition: opacity 0.2s;
}

#galleryModal .btn-light:hover {
    opacity: 1;
}

.gallery-main-container {
    height: 100vh;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.gallery-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
    transition: opacity 0.3s ease-in-out;
}

.gallery-main-image.loading {
    opacity: 0;
}

.gallery-main-container img {
    max-height: calc(100vh - 4rem);
    width: auto;
    max-width: 100%;
    margin: auto;
}

.gallery-thumbs-container {
    height: 100%;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.8);
}

.gallery-thumbs-container .row {
    margin: 0;
    height: auto;
}

.gallery-thumb-container {
    position: relative;
    padding-bottom: 100%;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
}

.gallery-thumb-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-thumb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease;
}

.gallery-thumb-container:hover .gallery-thumb-image {
    transform: scale(1.1);
}

.gallery-thumb-container:hover .gallery-thumb-overlay {
    background: rgba(0, 0, 0, 0.1);
}

.gallery-thumb-container.active .gallery-thumb-overlay {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--primary);
}

/* Stili per il modal della galleria */
.gym-gallery-modal .modal-dialog {
    max-width: 100%;
    height: 100vh;
    margin: 0;
}

.gym-gallery-modal .modal-content {
    height: 100%;
    background: #000;
    border: none;
    border-radius: 0;
}

.gym-gallery-modal .modal-body {
    padding: 0;
    height: calc(100% - 56px);
}

.gallery-main-container {
    position: relative;
    height: 100%;
    background: #000;
}

.gallery-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    transition: all 0.3s ease;
}

.gallery-nav-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.gallery-counter {
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

/* Stili per il touch su mobile */
.gym-gallery-touch {
    z-index: 1;
}

.gym-gallery-touch > div > div {
    cursor: pointer;
}

/* Stili per i dots su mobile */
.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-dot.active {
    background: #fff;
    transform: scale(1.2);
}

/* Media query per desktop */
@media (min-width: 992px) {
    .gym-gallery-modal .modal-dialog {
        max-width: 90%;
        height: 90vh;
        margin: 5vh auto;
    }

    .gym-gallery-modal .modal-content {
        border-radius: 8px;
    }

    .gym-gallery-modal .modal-body {
        height: calc(100% - 56px);
    }

    .gallery-main-container {
        border-radius: 0 0 0 8px;
    }

    .gallery-thumbs-container {
        border-radius: 0 0 8px 0;
    }
}

/* Rating e indirizzo */
.rating-stars {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    min-width: 100px;
}

.rating-stars i {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.address-text {
    font-size: 0.95rem;
    color: var(--text-light);
}

.address-text i {
    color: var(--primary-color);
}

/* Orari popolari */
.popular-times .day-schedule {
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

.popular-times .current-day {
    background-color: var(--bg-light);
    border-radius: 0.5rem;
}

.popular-times .time-slot {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.popular-times .progress {
    height: 0.5rem;
    background-color: var(--bg-light);
    border-radius: 1rem;
    overflow: hidden;
}

.popular-times .progress-bar {
    background-color: var(--primary-color);
    border-radius: 1rem;
}

/* Grafico affluenza */
.chart-container {
    height: 200px;
    margin: 1rem 0;
}

#daySelect {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .gym-main-image {
        height: 250px;
    }

    .gallery-main-container {
        padding: 1rem;
    }

    .gallery-thumbs-container {
        width: 100%;
    }

    #galleryModal .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100vh;
    }

    .gallery-main-container {
        height: calc(100vh - 2rem);
        padding: 1rem;
    }

    .gallery-main-image {
        max-height: calc(100vh - 4rem);
    }

    .gallery-dot {
        width: 8px;
        height: 8px;
        margin: 0 3px;
    }

    .gallery-dot.active {
        background-color: var(--primary-color);
        transform: scale(1.2);
    }

    #galleryModal .modal-header {
        padding: 0.5rem;
    }

    #galleryModal .btn-close {
        font-size: 1.2rem;
    }

    .rating-stars {
        font-size: 0.8rem;
    }

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

    .address-text {
        font-size: 0.9rem;
    }

    .address-text i {
        font-size: 0.8rem;
    }

    .popular-times .time-slot {
        font-size: 0.8rem;
        padding: 0.3rem;
    }

    .chart-container {
        height: 200px;
    }

    /* Compatta punteggio e stelle su mobile */
    .text-end .d-flex.align-items-center {
        gap: 0.3rem;
    }

    .text-end .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
        display: none; /* Nasconde il punteggio su mobile */
    }

    .text-end .badge + div i {
        font-size: 0.8rem !important;
        margin-right: 0.05rem;
    }

    /* Padding per badge distanza su mobile */
    #userDistance {
        margin-bottom: 1rem !important;
    }
    
    /* Comprimi scritta "Vedi altre X foto" su mobile */
    .overlay-more-photos {
        padding: 0.5rem;
    }
    
    .overlay-more-photos .text-center {
        font-size: 0.8rem;
        line-height: 1.2;
    }
    
    .overlay-more-photos i {
        font-size: 1.2rem;
        margin-bottom: 0.3rem;
    }
}

@media (max-width: 575.98px) {
    .popular-times .time-slot {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Padding per badge distanza su mobile */
    #userDistance {
        margin-bottom: 1rem !important;
    }
    
    /* Forza testo "Vedi altre X foto" su due righe su schermi piccoli */
    .overlay-more-photos .text-center {
        font-size: 0.75rem;
        line-height: 1.1;
        white-space: normal;
        word-wrap: break-word;
        max-width: 80%;
        margin: 0 auto;
    }
    
    .overlay-more-photos i {
        font-size: 1rem;
        margin-bottom: 0.2rem;
    }
}

@media (max-width: 360px) {
    .address-text {
        font-size: 0.85rem;
    }
}

@media (hover: none) {
    .gallery-thumb-container:hover {
        transform: none;
    }

    .gallery-thumb-container:active {
        transform: scale(0.98);
    }
}

.gallery-dot:focus,
.gallery-dot:active {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-color);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gallery-main-image {
    animation: fadeIn 0.3s ease-in-out;
}

@media (min-width: 768px) {
    #galleryModal .modal-dialog {
        margin: 1.75rem auto;
        max-width: 90%;
        height: 90vh;
    }

    .gallery-main-container {
        height: 90vh;
    }

    .gallery-main-container img {
        max-height: calc(90vh - 4rem);
    }

    .gallery-thumbs-container {
        max-height: 90vh;
    }
} 