/* --- Стили для страницы одного отзыва (view_review.css) --- */
/* --- Версия: 5.3 (Modern SVG Gallery Navigation, Perfect Alignment & CSP Compliance) --- */
/* --- Расположение файла: /assets/css/view_review.css --- */

/* НОВЫЙ БЛОК: Глобальное правило для корректного расчета размеров элементов. */
/* Это исправляет проблему с центрированием на мобильных устройствах. */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* --- Стили для страницы одного отзыва (view_review.php) --- */
.view-review-page .container {
    padding-top: 40px;
    padding-bottom: 60px;
}

.review-full-item {
    max-width: 800px;
    margin: 0 auto;
    background-color: #fff;
}

.review-full-header h1 {
    font-size: 2em;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.3;
}

/* Делаем перенос строк для мобилок, если мета-данные не влезают в 1 строку */
.review-meta {
    display: flex;
    flex-wrap: wrap; 
    align-items: center; /* Центрируем элементы по вертикали */
    gap: 20px;
    color: #777;
    font-size: 0.9em;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.review-full-text p {
    font-size: 1.1em;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #444;
}

.review-full-photos {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.review-photo-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.review-photo-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.back-link-container {
    max-width: 800px;
    margin: 40px auto 0;
}

.back-link {
    display: inline-block;
    color: #009900;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: background-color 0.2s, border-color 0.2s;
}

.back-link:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
}


/* --- Стили для модального окна фотографий --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 10px; /* Отступ от краев экрана */
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-image-container {
    position: relative;
    line-height: 0; /* Убирает лишний отступ под изображением */
}

.modal-overlay.is-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Крестик жестко зафиксирован относительно окна браузера с равными отступами */
.modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px;
    background: transparent;
    border: none;
    color: white;
    font-size: 40px;
    font-weight: 300;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    /* Сильная тень для читаемости на белом фоне */
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    transition: transform 0.2s ease, color 0.2s ease;
    z-index: 1050;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    transform: scale(1.2);
    color: #f0f0f0;
}

.modal-content {
    display: block;
    max-width: 95vw;  
    max-height: 95vh; 
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    -webkit-user-drag: none; 
    user-select: none; 
}

/* Новые стили для прозрачных кнопок-стрелок с SVG */
.modal-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1040;
    background: transparent; /* Убрали темный круг */
    color: #fff;
    border: none;
    width: 60px; /* Широкая зона клика */
    height: 100px; /* Высокая зона клика */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.7; /* Легкая прозрачность в покое */
    padding: 0;
}

.modal-nav-btn:hover {
    opacity: 1; /* Полная яркость при наведении */
    transform: translateY(-50%) scale(1.15); /* Плавное увеличение */
}

/* Стилизация самих SVG иконок внутри кнопок */
.modal-nav-btn svg {
    width: 45px;
    height: 45px;
    /* Четкая обводящая тень для контраста на любом фоне */
    filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, 0.8));
}

#modal-prev-btn {
    left: 15px;
}

#modal-next-btn {
    right: 15px;
}

/* Обёртка для слова "Оценка" и самих звезд */
.review-rating-wrapper {
    display: inline-flex;
    align-items: center;
}

/* Рейтинг в мета-данных отзыва (CSP Fix) */
.view-header-rating {
    color: #f39c12;
    font-size: 1.15em;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 2px;
}

/* Адаптивность для мобильных экранов */
@media (max-width: 768px) {
    .review-full-header h1 {
        font-size: 1.6em;
    }
    .review-full-text p {
        font-size: 1em;
    }
    .review-full-photos {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    .review-photo-thumbnail {
        height: 100px;
    }
    
    /* Адаптация галереи для смартфонов */
    .modal-nav-btn {
        width: 40px;
        height: 80px;
    }
    .modal-nav-btn svg {
        width: 35px;
        height: 35px;
    }
    #modal-prev-btn { 
        left: 5px; 
    }
    #modal-next-btn { 
        right: 5px; 
    }
    .modal-close {
        top: 15px;
        right: 15px;
        font-size: 35px;
    }
}