/* Modern Gallery Styles for ZahnMedizinZentrum */

:root {
    --gallery-bg: #ffffff;
    --gallery-card-bg: #fafafa;
    --gallery-overlay-bg: rgba(209, 193, 173, 0.95);
    --gallery-text-primary: #333333;
    --gallery-text-secondary: #666666;
    --gallery-text-overlay: #ffffff;
    --gallery-border: #e0e0e0;
    --gallery-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    --gallery-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.15);
    --gallery-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gallery-radius: 12px;
    --gallery-spacing: 1.5rem;
}

/* Gallery Container */
.modern-gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--gallery-spacing);
}

/* Loading State */
.gallery-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #d1c1ad;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modern Gallery Grid */
.modern-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--gallery-spacing);
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .modern-gallery {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem;
    }
    
    .modern-gallery-container {
        padding: 1rem;
    }
}

/* Gallery Item */
.gallery-item {
    position: relative;
    background: var(--gallery-card-bg);
    border-radius: var(--gallery-radius);
    box-shadow: var(--gallery-shadow);
    overflow: hidden;
    transition: var(--gallery-transition);
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--gallery-shadow-hover);
}

.gallery-item-inner {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
}

/* Gallery Images */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--gallery-transition);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gallery-overlay-bg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    opacity: 0;
    transition: var(--gallery-transition);
    backdrop-filter: blur(4px);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* Gallery Info */
.gallery-info {
    color: var(--gallery-text-overlay);
}

.gallery-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.gallery-info p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    opacity: 0.9;
}

/* Gallery Actions */
.gallery-actions {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
}

.gallery-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--gallery-transition);
    color: var(--gallery-text-overlay);
}

.gallery-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.gallery-btn svg {
    width: 20px;
    height: 20px;
}

/* Modern Lightbox */
.modern-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--gallery-transition);
}

.modern-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
}

.lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: var(--gallery-bg);
    border-radius: var(--gallery-radius);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

/* Lightbox Header */
.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gallery-border);
    background: var(--gallery-card-bg);
}

.lightbox-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gallery-text-primary);
}

.lightbox-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--gallery-transition);
    color: var(--gallery-text-secondary);
}

.lightbox-close:hover {
    background: var(--gallery-border);
    color: var(--gallery-text-primary);
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
}

/* Lightbox Content */
.lightbox-content {
    display: flex;
    flex: 1;
    min-height: 0;
}

.lightbox-image-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gallery-card-bg);
    min-height: 400px;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.lightbox-info {
    width: 300px;
    padding: 2rem;
    background: var(--gallery-bg);
    border-left: 1px solid var(--gallery-border);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lightbox-image-title {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gallery-text-primary);
    line-height: 1.3;
}

.lightbox-image-description {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gallery-text-secondary);
}

/* Lightbox Navigation */
.lightbox-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gallery-border);
    background: var(--gallery-card-bg);
}

.lightbox-prev,
.lightbox-next {
    background: var(--gallery-bg);
    border: 1px solid var(--gallery-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--gallery-transition);
    color: var(--gallery-text-primary);
    font-size: 0.875rem;
    font-weight: 500;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--gallery-overlay-bg);
    color: var(--gallery-text-overlay);
    border-color: transparent;
}

.lightbox-prev:disabled,
.lightbox-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lightbox-prev svg,
.lightbox-next svg {
    width: 18px;
    height: 18px;
}

.lightbox-counter {
    font-size: 0.875rem;
    color: var(--gallery-text-secondary);
    font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .lightbox-container {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .lightbox-content {
        flex-direction: column;
    }
    
    .lightbox-info {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--gallery-border);
        padding: 1.5rem;
    }
    
    .lightbox-image-container {
        min-height: 250px;
    }
    
    .lightbox-navigation {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }
    
    .lightbox-counter {
        order: -1;
        width: 100%;
        text-align: center;
    }
}

/* Animation for gallery items on load */
.gallery-item {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }
.gallery-item:nth-child(7) { animation-delay: 0.7s; }
.gallery-item:nth-child(8) { animation-delay: 0.8s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus styles for accessibility */
.gallery-btn:focus,
.lightbox-close:focus,
.lightbox-prev:focus,
.lightbox-next:focus {
    outline: 2px solid #d1c1ad;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .gallery-item:hover {
        transform: none;
    }
    
    .gallery-item:hover img {
        transform: none;
    }
} 