/**
 * Modern Image Zoom Styles - FancyZoom Replacement
 * Für wombach.de - August 2025
 * 
 * Moderne, responsive Styles für Bildzoom-Funktionalität
 * Optimiert für alle Geräte und Browser
 */

/* Zoom-fähige Bilder */
.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 */
.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;
}

.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: 90%;
    max-height: 90%;
    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;
}

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

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

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

/* Info-Text */
.zoom-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    pointer-events: none;
    opacity: 0;
    animation: infoFadeIn 0.5s ease 1s forwards;
}

/* 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);
    }
}

/* Responsive Design - Tablet */
@media (max-width: 1024px) {
    .zoom-modal img {
        max-width: 95%;
        max-height: 85%;
    }
    
    .close-btn {
        top: 15px;
        right: 20px;
        font-size: 35px;
        width: 45px;
        height: 45px;
    }
    
    .zoom-info {
        bottom: 15px;
        font-size: 13px;
    }
}

/* Responsive Design - 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: 98%;
        max-height: 80%;
        border-radius: 4px;
    }
    
    .close-btn {
        top: 10px;
        right: 15px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }
    
    .zoom-info span {
        display: none;
    }
    
    .zoom-info::after {
        content: "Tippen zum Schließen";
    }
}

/* Extra kleine Bildschirme */
@media (max-width: 480px) {
    .zoom-modal img {
        max-width: 100%;
        max-height: 75%;
        border-radius: 0;
    }
    
    .close-btn {
        top: 5px;
        right: 10px;
        font-size: 25px;
        width: 35px;
        height: 35px;
    }
}

/* Hochformat-Optimierung */
@media (orientation: portrait) and (max-height: 800px) {
    .zoom-modal img {
        max-height: 70%;
    }
}

/* Querformat-Optimierung */
@media (orientation: landscape) and (max-height: 600px) {
    .zoom-modal img {
        max-height: 85%;
    }
    
    .zoom-info {
        bottom: 10px;
        font-size: 12px;
    }
}

/* Barrierefreiheit */
@media (prefers-reduced-motion: reduce) {
    .zoomable,
    .zoom-modal,
    .zoom-modal img,
    .close-btn {
        transition: none;
        animation: none;
    }
    
    .zoom-modal.active {
        animation: none;
    }
    
    .zoom-modal img {
        animation: none;
    }
}

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

/* 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;
}

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

/* 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;
    }
}