/**
 * Galerie Enhancement Styles
 * ✅ Animationen für Kategorie-Wechsel
 * ✅ Responsive Design
 * ✅ Hover-Effekte
 * Version: 2.0
 */

/* ============================================
   Galerie-Grid Animationen
   ============================================ */
#gallery-grid > div {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    opacity: 1;
}

#gallery-grid > div.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

/* ============================================
   Button Animationen
   ============================================ */
.gallery-filter-btn {
    position: relative;
    overflow: hidden;
    /* Flex-Layout für perfekte Ausrichtung */
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-filter-btn .badge-new {
    /* Badge darf nicht schrumpfen oder wachsen */
    flex-shrink: 0;
    flex-grow: 0;
}

.gallery-filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.gallery-filter-btn:active::before {
    width: 300px;
    height: 300px;
}

.gallery-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.gallery-filter-btn:active {
    transform: translateY(0);
}

/* ============================================
   NEU-Badge Styling
   ============================================ */
.badge-new {
    /* Kein Pulsieren mehr */
    animation: none !important;
    /* Position immer rechts neben Button-Text */
    flex-shrink: 0;
    margin-left: auto;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 640px) {
    .gallery-filter-btn {
        width: 100%;
        justify-content: flex-start !important;
    }
    
    .gallery-filter-btn span {
        align-items: flex-start !important;
    }
    
    .gallery-filter-btn .badge-new {
        margin-left: auto;
    }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1024px) {
    .gallery-filter-btn {
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
    }
    
    .gallery-filter-btn svg {
        width: 1rem;
        height: 1rem;
    }
}

/* ============================================
   Bild-Karten Hover-Effekt
   ============================================ */
#gallery-grid > .group {
    will-change: transform;
}

#gallery-grid > .group:hover {
    transform: translateY(-4px) scale(1.02);
}

/* ============================================
   Lightbox Animationen
   ============================================ */
#lightbox-modal {
    transition: opacity 0.3s ease-in-out;
}

#lightbox-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

#lightbox-modal:not(.hidden) {
    opacity: 1;
    animation: fadeIn 0.3s ease-in-out;
}

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

#lightbox-image img {
    animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   Lade-Animation
   ============================================ */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ============================================
   Smooth Scroll
   ============================================ */
html {
    scroll-behavior: smooth;
}

/* ============================================
   Counter Display
   ============================================ */
.count-display {
    min-width: 60px;
    text-align: left;
}

/* ============================================
   Accessibility
   ============================================ */
.gallery-filter-btn:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

#gallery-grid > .group:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 4px;
    border-radius: 0.5rem;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .gallery-filter-btn,
    .badge-new,
    #lightbox-modal {
        display: none !important;
    }
    
    #gallery-grid {
        display: block !important;
    }
    
    #gallery-grid > div {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

/* ============================================
   Dark Mode Support (für zukünftige Nutzung)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Kann später aktiviert werden */
    /* .gallery-filter-btn { ... } */
}
