/* ============================================================
   ПОЛНОЭКРАННЫЙ ПРОСМОТРЩИК ФОТО
   ============================================================ */

.fullscreen-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
}

.fullscreen-viewer.open {
    opacity: 1;
}

/* ============================================================
   ФОТО
   ============================================================ */

.fullscreen-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fullscreen-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.fullscreen-image.changing img {
    opacity: 0.5;
}

/* ============================================================
   ВЕРХНЯЯ ПАНЕЛЬ
   ============================================================ */

.fullscreen-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
    z-index: 10;
}

/* Кнопка закрытия */
.fullscreen-close {
    position: absolute;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.fullscreen-close:hover {
    background: rgba(239, 68, 68, 0.8);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

/* Счетчик фото */
.fullscreen-counter {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 16px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   НАВИГАЦИОННЫЕ СТРЕЛКИ
   ============================================================ */

.fullscreen-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.fullscreen-nav:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.6),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.fullscreen-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.fullscreen-nav svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.fullscreen-nav.prev { left: 16px; }
.fullscreen-nav.next { right: 16px; }

/* ============================================================
   НИЖНЯЯ ПАНЕЛЬ
   ============================================================ */

.fullscreen-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 60px 24px 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
    z-index: 5;
}

/* Информация о фото */
.fullscreen-info {
    flex: 1;
    min-width: 0;
}

.fullscreen-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fullscreen-description {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Кнопки действий */
.fullscreen-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.fullscreen-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    cursor: pointer;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.fullscreen-action:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.fullscreen-action:active {
    transform: translateY(0);
}

.fullscreen-action.liked {
    background: rgba(239, 68, 68, 0.6);
    border-color: rgba(239, 68, 68, 0.8);
}

.action-icon {
    font-size: 18px;
}

.action-count {
    font-weight: 600;
}

/* ============================================================
   ПАНЕЛЬ КОММЕНТАРИЕВ
   ============================================================ */

.comments-panel {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 380px;
    max-width: 90%;
    background: #fff;
    border-radius: 16px 0 0 0;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 20;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.comments-panel.open {
    transform: translateY(0);
}

.comments-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.comments-panel-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    margin: 0;
}

.comments-panel-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f5f5f5;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.comments-panel-close:hover {
    background: #e0e0e0;
}

/* Список комментариев */
.comments-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 12px;
    min-height: 100px;
}

.no-comments {
    font-size: 13px;
    color: #aaa;
    text-align: center;
    padding: 20px;
}

/* Комментарий */
.comment-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-author {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.comment-text {
    font-size: 13px;
    color: #555;
    margin: 2px 0 0 0;
    line-height: 1.4;
}

.comment-date {
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}

/* Форма комментария */
.comment-form {
    display: flex;
    gap: 8px;
}

.comment-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 100px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.comment-input:focus {
    border-color: #111;
}

.comment-submit {
    padding: 10px 18px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.comment-submit:hover {
    background: #333;
}

/* ============================================================
   ИНДИКАТОР СВАЙПА
   ============================================================ */

.swipe-hint {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* ============================================================
   ОГРАНИЧЕНИЕ ПРОКРУТКИ
   ============================================================ */

body.no-scroll {
    overflow: hidden;
}

/* ============================================================
   АДАПТИВ ДЛЯ ПЛАНШЕТОВ
   ============================================================ */

@media (max-width: 1024px) {
    .fullscreen-nav {
        width: 44px;
        height: 44px;
    }
    
    .fullscreen-nav.prev { left: 10px; }
    .fullscreen-nav.next { right: 10px; }
    
    .comments-panel {
        width: 350px;
    }
}

/* ============================================================
   АДАПТИВ ДЛЯ МОБИЛЬНЫХ
   ============================================================ */

@media (max-width: 768px) {
    .fullscreen-top {
        padding: 10px;
    }
    
    .fullscreen-close {
        width: 36px;
        height: 36px;
        right: 8px;
        font-size: 20px;
    }
    
    .fullscreen-counter {
        font-size: 12px;
        padding: 4px 12px;
    }
    
    .fullscreen-nav {
        width: 40px;
        height: 40px;
        background: rgba(0, 0, 0, 0.6);
    }
    
    .fullscreen-nav.prev { left: 8px; }
    .fullscreen-nav.next { right: 8px; }
    
    .fullscreen-bottom {
        flex-direction: column;
        align-items: flex-start;
        padding: 40px 16px 16px;
        gap: 12px;
    }
    
    .fullscreen-title {
        font-size: 16px;
    }
    
    .fullscreen-description {
        font-size: 13px;
        -webkit-line-clamp: 1;
    }
    
    .fullscreen-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .fullscreen-action {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .comments-panel {
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 70vh;
        padding: 16px;
    }
}

/* ============================================================
   АДАПТИВ ДЛЯ МАЛЕНЬКИХ ТЕЛЕФОНОВ
   ============================================================ */

@media (max-width: 480px) {
    .fullscreen-nav {
        width: 36px;
        height: 36px;
    }
    
    .fullscreen-nav.prev { left: 4px; }
    .fullscreen-nav.next { right: 4px; }
    
    .fullscreen-nav svg {
        width: 18px;
        height: 18px;
    }
    
    .fullscreen-close {
        width: 32px;
        height: 32px;
        right: 4px;
    }
    
    .fullscreen-title {
        font-size: 14px;
    }
    
    .fullscreen-action {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .action-icon {
        font-size: 14px;
    }
}