/**
 * Modern Gallery CSS - Erweiterte Version von modern-zoom.css
 * Für wombach.de - August 2025
 * 
 * Zusätzliche Features:
 * - Navigation-Buttons (Vor/Zurück)
 * - Bild-Counter
 * - Touch-optimierte Controls
 * - Responsive Navigation
 */

/* Basis zoom-fähige Bilder (unverändert) */
.zoomable {
    cursor: zoom-in;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.zoomable:hover {
    transform: scale(1.02) translateZ(0);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    filter: brightness(1.05);
}

.zoomable:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Modal Container (erweitert) */
.zoom-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: Arial, sans-serif;
}

.zoom-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    animation: modalFadeIn 0.3s ease-out;
}

/* Gezoomtes Bild */
.zoom-modal img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: imageZoomIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* === NEUE GALERIE-NAVIGATION === */

/* Navigation Buttons */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10002;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    user-select: none;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-50%) scale(1.1);
}

.nav-btn:active {
    transform: translateY(-50%) scale(0.9);
}

.prev-btn {
    left: 30px;
}

.next-btn {
    right: 30px;
}

/* Navigation Button Icons */
.nav-btn span {
    font-size: 30px;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Bild-Counter */
.image-counter {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    z-index: 10002;
    backdrop-filter: blur(10px);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    user-select: none;
}

/* Schließen-Button (verbessert) */
.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10003;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1;
    padding: 8px;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    color: #ff6b6b;
}

.close-btn:active {
    transform: scale(0.9);
}

/* Info-Text erweitert */
.zoom-info {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    pointer-events: none;
    opacity: 0;
    animation: infoFadeIn 0.5s ease 2s forwards;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.mobile-hint {
    display: none;
}

/* === RESPONSIVE DESIGN === */

/* Tablet */
@media (max-width: 1024px) {
    .zoom-modal img {
        max-width: 90%;
        max-height: 80%;
    }
    
    .nav-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .nav-btn span {
        font-size: 24px;
    }
    
    .prev-btn {
        left: 20px;
    }
    
    .next-btn {
        right: 20px;
    }
    
    .close-btn {
        top: 15px;
        right: 20px;
        font-size: 35px;
        width: 50px;
        height: 50px;
    }
    
    .image-counter {
        top: 20px;
        font-size: 13px;
        padding: 6px 12px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .zoomable:hover {
        /* Hover-Effekte auf Touch-Geräten reduzieren */
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        filter: none;
    }
    
    .zoom-modal img {
        max-width: 95%;
        max-height: 75%;
        border-radius: 4px;
    }
    
    /* Navigation für Touch optimieren */
    .nav-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
        /* Größere Touch-Targets */
        padding: 5px;
    }
    
    .nav-btn span {
        font-size: 20px;
    }
    
    .prev-btn {
        left: 15px;
    }
    
    .next-btn {
        right: 15px;
    }
    
    .close-btn {
        top: 10px;
        right: 15px;
        font-size: 30px;
        width: 45px;
        height: 45px;
    }
    
    .image-counter {
        top: 15px;
        font-size: 12px;
        padding: 5px 10px;
    }
    
    /* Mobile Info-Text */
    .desktop-hint {
        display: none;
    }
    
    .mobile-hint {
        display: inline;
    }
    
    .zoom-info {
        bottom: 20px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Extra kleine Bildschirme */
@media (max-width: 480px) {
    .zoom-modal img {
        max-width: 98%;
        max-height: 70%;
        border-radius: 0;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .nav-btn span {
        font-size: 18px;
    }
    
    .prev-btn {
        left: 10px;
    }
    
    .next-btn {
        right: 10px;
    }
    
    .close-btn {
        top: 5px;
        right: 10px;
        font-size: 25px;
        width: 40px;
        height: 40px;
    }
    
    .image-counter {
        top: 10px;
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* Landscape-Optimierung für Mobile */
@media (orientation: landscape) and (max-height: 600px) {
    .zoom-modal img {
        max-height: 80%;
    }
    
    .zoom-info {
        bottom: 10px;
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .image-counter {
        top: 10px;
    }
    
    .nav-btn {
        width: 35px;
        height: 35px;
    }
    
    .close-btn {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

/* === ANIMATIONEN === */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(5px);
    }
}

@keyframes imageZoomIn {
    from {
        opacity: 0;
        transform: scale(0.7) rotate(5deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes infoFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Button Hover-Animationen */
@keyframes buttonPulse {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
    100% { transform: translateY(-50%) scale(1); }
}

.nav-btn:hover {
    animation: buttonPulse 0.6s ease infinite;
}

/* === BARRIEREFREIHEIT === */

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .zoomable,
    .zoom-modal,
    .zoom-modal img,
    .nav-btn,
    .close-btn {
        transition: none;
        animation: none;
    }
    
    .zoom-modal.active {
        animation: none;
    }
    
    .nav-btn:hover {
        animation: none;
        transform: translateY(-50%) scale(1.05);
    }
}

/* High-Contrast Mode */
@media (prefers-contrast: high) {
    .zoom-modal {
        background-color: black;
    }
    
    .nav-btn,
    .close-btn {
        background-color: white;
        color: black;
        border: 2px solid black;
    }
    
    .image-counter,
    .zoom-info {
        background-color: white;
        color: black;
        border: 1px solid black;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .zoomable {
        box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
    }
    
    .zoomable:hover {
        box-shadow: 0 8px 25px rgba(255, 255, 255, 0.15);
    }
}

/* Focus-Styles für Keyboard-Navigation */
.zoomable:focus {
    outline: 3px solid #007cba;
    outline-offset: 2px;
}

.nav-btn:focus,
.close-btn:focus {
    outline: 3px solid white;
    outline-offset: 2px;
}

/* === GALERIE-SPEZIFISCHE STYLES === */

/* Galerie-Container Optimierung */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.gallery .zoomable {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Thumbnail-Modus für Galerien */
.gallery-thumbnail {
    position: relative;
}

.gallery-thumbnail::after {
    content: "??";
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 8px;
    border-radius: 15px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-thumbnail:hover::after {
    opacity: 1;
}

/* Loading-State für große Bilder */
.zoom-modal img[src=""] {
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    animation: loading 1s linear infinite;
}

@keyframes loading {
    0% { background-position: 0 0, 0 10px, 10px -10px, -10px 0px; }
    100% { background-position: 20px 20px, 20px 30px, 30px 10px, 10px 20px; }
}

/* === PRINT STYLES === */
@media print {
    .zoom-modal {
        display: none !important;
    }
    
    .zoomable {
        cursor: default;
    }
    
    .zoomable:hover {
        transform: none;
        box-shadow: none;
        filter: none;
    }
    
    .gallery-thumbnail::after {
        display: none;
    }
}

/* === WOMBACH.DE SPEZIFISCHE ANPASSUNGEN === */

/* Integration mit bestehenden wombach.de Styles */
.hauptinhalt .zoomable {
    margin: 10px 0;
}

/* Kompatibilität mit Tabellen-Layout */
table .zoomable {
    max-width: 100%;
    height: auto;
}

/* Integration mit bestehenden Bild-Styles */
.zoomable[width],
.zoomable[height] {
    max-width: 100%;
    height: auto;
}