/**
 * Универсальный просмотрщик фотографий
 */

.photo-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

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

/* Затемнение фона */
.photo-viewer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1;
}

/* Контейнер */
.photo-viewer-container {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: var(--spacing-xl);
}

/* Изображение */
.photo-viewer-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1400px;
}

.photo-viewer-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Кнопка закрытия */
.photo-viewer-close {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.photo-viewer-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Навигация */
.photo-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.photo-viewer-prev {
    left: var(--spacing-lg);
}

.photo-viewer-next {
    right: var(--spacing-lg);
}

.photo-viewer-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

/* Счетчик */
.photo-viewer-counter {
    position: absolute;
    top: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    padding: var(--spacing-xs) var(--spacing-md);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    color: white;
    font-size: var(--font-size-sm);
    font-weight: 600;
    z-index: 10;
}

/* Действия (ненавязчиво в углу) */
.photo-viewer-actions {
    position: absolute;
    top: var(--spacing-lg);
    right: calc(var(--spacing-lg) + 48px + var(--spacing-sm));
    display: flex;
    gap: var(--spacing-xs);
    z-index: 10;
}

.photo-viewer-actions .gc-btn {
    min-width: auto;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: var(--radius-lg);
    border: none;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.8);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.photo-viewer-actions .gc-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    transform: scale(1.05);
}

.photo-viewer-actions .gc-btn i {
    margin: 0 !important;
}

/* Адаптив */
@media (max-width: 767px) {
    .photo-viewer-container {
        padding: var(--spacing-md);
    }
    
    .photo-viewer-image {
        max-height: 70vh;
        border-radius: var(--radius-md);
    }
    
    .photo-viewer-close {
        width: 40px;
        height: 40px;
        font-size: 20px;
        top: var(--spacing-md);
        right: var(--spacing-md);
    }
    
    .photo-viewer-nav {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    
    .photo-viewer-prev {
        left: var(--spacing-sm);
    }
    
    .photo-viewer-next {
        right: var(--spacing-sm);
    }
    
    .photo-viewer-counter {
        top: var(--spacing-md);
        font-size: 12px;
    }
    
    .photo-viewer-actions {
        top: var(--spacing-md);
        right: calc(var(--spacing-md) + 40px + var(--spacing-xs));
    }
    
    .photo-viewer-actions .gc-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}
