/* Image Fade Gallery Styles */

.image-fade-gallery {
    width: 100%;
    max-width: 800px;
    margin: var(--spacing-lg) auto;
    position: relative;
    background: var(--color-surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
}

.gallery-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9; /* Responsive aspect ratio */
    background: var(--color-surface-secondary);
}

.gallery-images {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity var(--transition-fast) ease-in-out;
    z-index: 1;
}

.gallery-image.active {
    opacity: 1;
    z-index: 2;
}

.gallery-image.loading {
    opacity: 0.3;
}

/* Gallery Controls */
.gallery-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
    z-index: 10;
    pointer-events: none;
}

.gallery-btn {
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
    pointer-events: auto;
    backdrop-filter: blur(4px);
}

.gallery-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.gallery-btn:active {
    transform: scale(0.95);
}

.gallery-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

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

/* Progress Indicators */
.gallery-indicators {
    position: absolute;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--spacing-sm);
    z-index: 10;
}

.gallery-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all var(--transition-fast) ease;
}

.gallery-indicator:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.gallery-indicator.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    transform: scale(1.2);
}

/* Gallery Info */
.gallery-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: var(--spacing-xl) var(--spacing-lg) var(--spacing-lg);
    z-index: 10;
}

.gallery-counter {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.gallery-title {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-accent);
}

/* Responsive Design */
@media (max-width: 768px) {
    .image-fade-gallery {
        margin: var(--spacing-md) auto;
        border-radius: var(--border-radius);
    }
    
    .gallery-container {
        aspect-ratio: 4/3; /* More square on mobile */
    }
    
    .gallery-btn {
        width: 40px;
        height: 40px;
    }
    
    .gallery-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .gallery-indicators {
        bottom: var(--spacing-md);
    }
    
    .gallery-indicator {
        width: 10px;
        height: 10px;
    }
    
    .gallery-info {
        padding: var(--spacing-lg) var(--spacing-md) var(--spacing-md);
    }
    
    .gallery-title {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .gallery-controls {
        padding: 0 var(--spacing-sm);
    }
    
    .gallery-btn {
        width: 36px;
        height: 36px;
    }
    
    .gallery-btn svg {
        width: 14px;
        height: 14px;
    }
}

/* Loading State */
.gallery-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-text);
    font-size: 1.1rem;
}

.gallery-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-primary);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: var(--spacing-sm);
}

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

/* Error State */
.gallery-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-text);
    text-align: center;
    padding: var(--spacing-lg);
}

.gallery-error-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
    opacity: 0.6;
}

/* Accessibility */
.gallery-btn:focus,
.gallery-indicator:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .gallery-image {
        transition: none;
    }
    
    .gallery-btn,
    .gallery-indicator {
        transition: none;
    }
    
    .gallery-loading::after {
        animation: none;
    }
}