/* ==========================================================================
   PopFace Reviews — reviews.css
   Всі стилі модуля відгуків. Жодних inline-стилів у PHP/HTML.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Утиліти
   -------------------------------------------------------------------------- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   Секція
   -------------------------------------------------------------------------- */
.reviews-section {
    width: 100%;
}

/* --------------------------------------------------------------------------
   Aggregate Rating Header
   -------------------------------------------------------------------------- */
.reviews-aggregate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.reviews-aggregate__score {
    font-size: 40px;
    font-weight: 800;
    color: #013040;
    line-height: 1;
}

.reviews-aggregate__stars {
    display: flex;
    gap: 4px;
    align-items: center;
}

.reviews-aggregate__count {
    font-size: 15px;
    color: #013040;
    opacity: 0.55;
}

/* --------------------------------------------------------------------------
   Кнопка «Залишити відгук» — під сіткою по центру
   -------------------------------------------------------------------------- */
.reviews-cta {
    text-align: center;
    margin: 36px 0 24px;
}

.leave-review-btn {
    background: #FF385C;
    background: linear-gradient(135deg, #FF385C 0%, #e02d50 100%);
    color: #ffffff;
    padding: 14px 38px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 56, 92, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.leave-review-btn:hover,
.leave-review-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(255, 56, 92, 0.38);
    background: linear-gradient(135deg, #e02d50 0%, #c41e3d 100%);
    outline: none;
}

/* --------------------------------------------------------------------------
   SVG-зірки (загальні)
   -------------------------------------------------------------------------- */
.aggregate-star,
.review-star {
    display: inline-flex;
    flex-shrink: 0;
    color: #ddd;
}

.aggregate-star svg,
.review-star svg {
    fill: currentColor;
}

.aggregate-star--filled,
.review-star--filled {
    color: #f6ca00;
    filter: drop-shadow(0 0 3px rgba(246, 202, 0, 0.5));
}

/* --------------------------------------------------------------------------
   Сітка карток (3 колонки на ПК)
   -------------------------------------------------------------------------- */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 36px 28px;
    margin-bottom: 32px;
}

@media (min-width: 992px) {
    .reviews-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.reviews-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #013040;
    opacity: 0.5;
    font-size: 15px;
    padding: 40px 0;
}

/* --------------------------------------------------------------------------
   Картка відгуку — прозорий фон, центрування
   -------------------------------------------------------------------------- */
.review-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    overflow: visible;
}

.review-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.review-card:hover {
    transform: none;
    box-shadow: none !important;
}

/* ── 1. Велике кругле фото ───────────────────────────────── */
.review-card__photo-wrap {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 16px;
    flex-shrink: 0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    background: #f8fafc;
    border: 3px solid #ffffff;
}

@media (max-width: 480px) {
    .review-card__photo-wrap {
        width: 150px;
        height: 150px;
    }
}

.review-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.review-card__photo-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #94a3b8;
}

/* ── 2. Автор та місто ───────────────────────────────────── */
.review-card__author-info {
    margin-bottom: 6px;
    text-align: center;
    width: 100%;
}

.review-card__name {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

.review-card__city {
    font-size: 15px;
    font-weight: 600;
    color: #475569;
}

/* ── 3. Зірочки рейтингу ─────────────────────────────────── */
.review-card__rating {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    margin-bottom: 12px;
}

.review-star svg {
    width: 16px;
    height: 16px;
}

/* ── 4. Текст відгуку ────────────────────────────────────── */
.review-card__text {
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
    text-align: center;
    margin-bottom: 10px;
    max-width: 360px;
}

.review-card__text p {
    margin: 0 0 8px;
}

.review-card__text p:last-child {
    margin-bottom: 0;
}

/* ── 5. Дата ─────────────────────────────────────────────── */
.review-card__date {
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    display: block;
}

/* ── Приховати старі елементи (лапки, хедер) ─────────────── */
.review-card__quote-icon,
.review-card__header,
.review-card__author-wrap,
.review-card__avatar,
.review-card__avatar-placeholder {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Кнопка «Дивитися ще»
   -------------------------------------------------------------------------- */
.load-more-reviews {
    text-align: center;
    margin: 8px 0 32px;
}

.load-more-btn {
    background: transparent;
    color: #41b6d7;
    border: 1.5px solid #41b6d7;
    padding: 9px 24px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.load-more-btn:hover,
.load-more-btn:focus-visible {
    background: #41b6d7;
    color: #fff;
    outline: none;
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Модальне вікно
   -------------------------------------------------------------------------- */
.review-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999 !important;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    overflow-y: auto;
    box-sizing: border-box;
}

.review-modal.is-open {
    display: flex;
    animation: modalOverlayIn 0.25s ease-out;
}

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

.review-modal-content {
    background: #ffffff;
    padding: 36px 32px;
    border-radius: 20px;
    max-width: 480px;
    width: 100%;
    position: relative;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
    margin: auto;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    animation: modalContentIn 0.25s ease-out;
    box-sizing: border-box;
}

@keyframes modalContentIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.review-modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.review-modal-close:hover,
.review-modal-close:focus-visible {
    background: #e2e8f0;
    color: #0f172a;
    outline: none;
}

.review-modal-content h3,
.review-modal-title {
    color: #0f172a;
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    margin: 0 0 24px;
}

/* --------------------------------------------------------------------------
   Повідомлення форми
   -------------------------------------------------------------------------- */
.form-message {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
}

.form-message--success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.form-message--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* --------------------------------------------------------------------------
   Форма
   -------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    color: #0f172a;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #FF385C;
    box-shadow: 0 0 0 4px rgba(255, 56, 92, 0.12);
}

.form-group textarea {
    resize: vertical;
    min-height: 105px;
}

/* --------------------------------------------------------------------------
   Зірки в формі
   -------------------------------------------------------------------------- */
.rating-input {
    display: flex;
    gap: 6px;
    margin-top: 2px;
}

.rating-star {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: #cbd5e1;
    transition: color 0.15s ease, transform 0.15s ease;
    display: inline-flex;
    align-items: center;
}

.rating-star svg {
    fill: currentColor;
}

.rating-star.is-active,
.rating-star.is-hover {
    color: #f59e0b;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.4));
}

.rating-star:hover {
    transform: scale(1.15);
}

.rating-star:focus-visible {
    outline: 2px solid #FF385C;
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Кнопка сабміту форми
   -------------------------------------------------------------------------- */
.submit-review-btn {
    width: 100%;
    background: linear-gradient(135deg, #FF385C 0%, #e02d50 100%);
    color: #ffffff;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 56, 92, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    margin-top: 8px;
}

.submit-review-btn:hover,
.submit-review-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(255, 56, 92, 0.38);
    background: linear-gradient(135deg, #e02d50 0%, #c41e3d 100%);
    outline: none;
}

.submit-review-btn:disabled {
    opacity: 0.55;
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --------------------------------------------------------------------------
   Блокування скролу при модалці
   -------------------------------------------------------------------------- */
body.modal-open {
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Адаптивність
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .reviews-grid {
        grid-template-columns: 1fr;
    }

    .reviews-aggregate__score {
        font-size: 32px;
    }

    .review-modal-content {
        padding: 28px 20px;
        border-radius: 16px;
    }

    .review-modal-content h3,
    .review-modal-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .leave-review-btn {
        font-size: 15px;
        padding: 12px 28px;
    }
}

@media (max-width: 480px) {
    .reviews-aggregate {
        flex-direction: column;
        gap: 8px;
    }

    .review-card {
        /* padding скинуто через !important в базовому правилі */
    }
}
