/* =========================================================
   Сброс и глобальные настройки
   ========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Roboto', sans-serif;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background: #0a0a0a;
    padding: 20px 0;

    /* iOS FIX */
    min-height: -webkit-fill-available;
}

/* =========================================================
   Фон (iOS FIX)
   ========================================================= */
.reviews-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/background-img/background_reviews.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;

    /* iOS FIX */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: -1;
}

/* =========================================================
   Контейнер страницы
   ========================================================= */
.reviews-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    z-index: 10;
}

/* =========================================================
   Шапка
   ========================================================= */
.reviews-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.back-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 16px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #fff;
}

.header-content {
    flex: 1;
}

.header-content h1 {
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.reviews-count {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* =========================================================
   Кнопка "Оставить отзыв"
   ========================================================= */
.add-review-section {
    margin-bottom: 32px;
    text-align: center;
}

.btn-add-review {
    display: inline-block;
    background: linear-gradient(90deg, #ff8c00, #ffa500);
    color: #fff;
    padding: 14px 32px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-add-review:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 140, 0, 0.4);
}

/* =========================================================
   Форма отзыва
   ========================================================= */
.review-form-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 24px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.form-header h2 {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
}

.close-form {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.close-form:hover {
    color: #fff;
}

/* Группы полей */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.required {
    color: #ff8c00;
}

/* Рейтинг звездами */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 8px;
}

.star-rating input {
    display: none;
}

.star-rating label {
    font-size: 36px;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: #ffa500;
    transform: scale(1.1);
}

/* Textarea */
.form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 16px;
    color: #fff;
    outline: none;
    resize: vertical;
    font-family: 'Roboto', sans-serif;
    transition: all 0.3s ease;
}

.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group textarea:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ff8c00;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.2);
}

.char-counter {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-align: right;
    margin-top: 4px;
}

/* Input file */
.form-group input[type="file"] {
    display: block;
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 14px 16px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.image-previews img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Кнопка отправки */
.btn-submit {
    width: 100%;
    background: linear-gradient(90deg, #ff8c00, #ffa500);
    color: #fff;
    padding: 16px;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 140, 0, 0.4);
}

/* =========================================================
   Список отзывов
   ========================================================= */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Карточка отзыва */
.review-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.review-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

/* Шапка отзыва */
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 16px;
}

.author-info {
    display: flex;
    gap: 16px;
    flex: 1;
}

/* Аватар */
.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff8c00, #ffa500);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
}

/* Детали автора */
.author-details {
    flex: 1;
}

.author-name {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.review-date {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    margin-bottom: 6px;
}

.stay-badge {
    display: inline-block;
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

/* Рейтинг */
.review-rating {
    flex-shrink: 0;
}

.stars {
    color: #ffa500;
    font-size: 20px;
    letter-spacing: 2px;
}

/* Галерея */
.review-gallery {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.review-gallery a {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease;
}

.review-gallery a:hover {
    transform: scale(1.05);
    border-color: #ff8c00;
}

.review-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Текст отзыва */
.review-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    line-height: 1.6;
}

.text-content {
    margin-bottom: 12px;
    /* УБРАЛИ white-space: pre-wrap */
    word-wrap: break-word;  /* Переносим длинные слова */
    overflow-wrap: break-word;
}

.btn-show-more {
    background: none;
    border: none;
    color: #ffa500;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.btn-show-more:hover {
    color: #ff8c00;
}

/* =========================================================
   Empty state
   ========================================================= */
.empty-state {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 24px;
    padding: 60px 32px;
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h2 {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    margin-bottom: 24px;
}

/* =========================================================
   Мобильная адаптация
   ========================================================= */
@media (max-width: 768px) {
    .reviews-container {
        padding: 0 16px;
    }

    .reviews-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-content h1 {
        font-size: 28px;
    }

    .review-form-card {
        padding: 24px 20px;
    }

    .review-card {
        padding: 20px;
    }

    .review-header {
        flex-direction: column;
    }

    .author-info {
        width: 100%;
    }

    .review-rating {
        align-self: flex-start;
    }

    .review-gallery a {
        width: 70px;
        height: 70px;
    }
}

/* =========================================================
   iOS Специфичные фиксы
   ========================================================= */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }

    .reviews-bg {
        position: absolute;
        min-height: 100vh;
    }
}