/* 
* N.O. Immobilien - Verbesserte Bildergalerie
* Author: NAXII | ZamZob
* Version: 1.0
*/

/* Verbesserte Darstellung der Bilder in der Detailansicht */
.property-detail-hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    overflow: hidden;
    background-color: #f5f5f5;
}

/* Verbesserte Darstellung der Bilder im Slider */
.property-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ändert von cover zu contain, um das ganze Bild zu zeigen */
    background-color: rgba(0, 0, 0, 0.03);
}

/* Verbesserte Darstellung der Fullscreen-Galerie */
.fullscreen-gallery {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95); /* Dunklerer Hintergrund für besseren Kontrast */
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-overflow-scrolling: touch; /* Verbessert das Scrollverhalten auf iOS */
}

.fullscreen-gallery.active {
    opacity: 1;
    visibility: visible;
}

/* Verbesserte Darstellung des Galerie-Containers */
.gallery-container {
    position: relative;
    width: 90%; /* Erhöht von 80% auf 90% */
    height: 75%; /* Erhöht von 70% auf 75% */
    max-width: 1400px; /* Erhöht von 1200px auf 1400px */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Verbesserte Darstellung der Galerie-Slides */
.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.gallery-slide.active {
    opacity: 1;
}

/* Verbesserte Darstellung der Bilder in der Galerie */
.gallery-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Verbesserte Darstellung der Galerie-Pfeile */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-arrow:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.gallery-arrow.prev {
    left: 20px; /* Geändert von -70px auf 20px */
}

.gallery-arrow.next {
    right: 20px; /* Geändert von -70px auf 20px */
}

/* Ausblenden der Navigationselemente auf mobilen Geräten */
@media (max-width: 768px) {
    .gallery-arrow, 
    .slider-arrow,
    .fullscreen-toggle {
        display: none !important;
    }
}

/* Verbesserte Darstellung der Galerie-Thumbnails */
.gallery-thumbnails {
    display: flex;
    justify-content: center;
    gap: 10px; /* Erhöht von 0.5rem auf 10px */
    margin-top: 20px; /* Erhöht von 1.5rem auf 20px */
    overflow-x: auto;
    max-width: 90%; /* Erhöht von 80% auf 90% */
    padding: 10px 0; /* Erhöht von 0.5rem auf 10px */
    -webkit-overflow-scrolling: touch; /* Verbesserte Scrolling-Performance auf iOS */
}

.gallery-thumbnail {
    width: 100px; /* Erhöht von 80px auf 100px */
    height: 75px; /* Erhöht von 60px auf 75px */
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6; /* Erhöht von 0.5 auf 0.6 */
    transition: opacity 0.3s ease, transform 0.3s ease;
    flex-shrink: 0; /* Verhindert, dass Thumbnails schrumpfen */
}

.gallery-thumbnail:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.gallery-thumbnail.active {
    opacity: 1;
    box-shadow: 0 0 0 3px white; /* Erhöht von 2px auf 3px */
    transform: translateY(-3px);
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Verbesserte Darstellung des Galerie-Zählers */
.gallery-counter {
    position: absolute;
    bottom: 20px; /* Erhöht von 1.5rem auf 20px */
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
    background-color: rgba(0, 0, 0, 0.6); /* Erhöht von 0.5 auf 0.6 */
    padding: 8px 16px; /* Erhöht von 0.5rem 1rem auf 8px 16px */
    border-radius: 20px;
    z-index: 2;
}

/* Verbesserte Darstellung des Schließen-Buttons */
.close-gallery {
    position: absolute;
    top: 20px; /* Erhöht von 1.5rem auf 20px */
    right: 20px; /* Erhöht von 1.5rem auf 20px */
    width: 50px; /* Erhöht von 40px auf 50px */
    height: 50px; /* Erhöht von 40px auf 50px */
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem; /* Erhöht von 1.2rem auf 1.5rem */
    cursor: pointer;
    z-index: 3; /* Erhöht von 2 auf 3 */
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-gallery:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Verbesserte Darstellung des Fullscreen-Buttons */
.fullscreen-toggle {
    position: absolute;
    bottom: 20px; /* Erhöht von unspezifiziert auf 20px */
    right: 20px; /* Erhöht von unspezifiziert auf 20px */
    width: 50px; /* Erhöht von unspezifiziert auf 50px */
    height: 50px; /* Erhöht von unspezifiziert auf 50px */
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-toggle:hover {
    background-color: white;
    transform: scale(1.1);
}

/* Responsive Anpassungen */
@media (max-width: 992px) {
    .property-detail-hero {
        height: 50vh;
    }
    
    .gallery-container {
        width: 95%;
        height: 70%;
    }
    
    .gallery-thumbnails {
        max-width: 95%;
    }
    
    .gallery-thumbnail {
        width: 90px;
        height: 68px;
    }
}

@media (max-width: 768px) {
    .property-detail-hero {
        height: 40vh;
        min-height: 300px;
    }
    
    .gallery-container {
        width: 100%;
        height: 60%;
    }
    
    .gallery-thumbnails {
        max-width: 100%;
        padding: 10px;
        gap: 8px;
    }
    
    .gallery-thumbnail {
        width: 80px;
        height: 60px;
    }
    
    .gallery-arrow {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .gallery-arrow.prev {
        left: 10px;
    }
    
    .gallery-arrow.next {
        right: 10px;
    }
    
    .close-gallery {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .property-detail-hero {
        height: 35vh;
        min-height: 250px;
    }
    
    .gallery-container {
        height: 50%;
    }
    
    .gallery-thumbnail {
        width: 70px;
        height: 53px;
    }
    
    .gallery-counter {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
}

/* Touch-Geräte-Optimierungen */
@media (hover: none) and (pointer: coarse) {
    .gallery-slide img {
        max-width: 100%;
        max-height: 100%;
    }
    
    .gallery-thumbnail {
        width: 70px;
        height: 53px;
    }
    
    .gallery-arrow {
        opacity: 0.8;
        width: 45px;
        height: 45px;
    }
    
    .close-gallery {
        opacity: 0.8;
    }
    
    .fullscreen-toggle {
        opacity: 0.8;
    }
}