/* ============================================================
   review.css — BookMassage Review System v1.4
   ============================================================ */

/* === Summary === */
.review-section { margin: 40px 0; }
.review-section__title { font-size: 1.25rem; font-weight: 700; margin: 0 0 16px; color: #111827; }
.review-summary { display: flex; gap: 32px; align-items: flex-start; margin-bottom: 20px; }
.review-summary__score { text-align: center; min-width: 100px; }
.review-summary__avg { display: block; font-size: 2.5rem; font-weight: 700; color: #111827; line-height: 1; }
.review-summary__stars { display: block; font-size: 1.2rem; color: #f59e0b; margin: 4px 0; }
.review-summary__count { display: block; font-size: 0.85rem; color: #6b7280; }
.review-summary__dist { flex: 1; max-width: 300px; }
.review-summary__empty { color: #9ca3af; font-style: italic; margin: 0 0 16px; }

.review-dist__row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.review-dist__label { font-size: 0.8rem; color: #6b7280; width: 24px; text-align: right; }
.review-dist__bar { flex: 1; height: 8px; background: #f3f4f6; border-radius: 4px; overflow: hidden; }
.review-dist__fill { height: 100%; background: #f59e0b; border-radius: 4px; transition: width 0.3s; }
.review-dist__count { font-size: 0.75rem; color: #9ca3af; width: 30px; }

.review-cta-text { font-size: 0.9rem; color: #6b7280; margin: 0 0 12px; }
.review-cta-btn {
    display: inline-block; padding: 10px 24px;
    background: var(--primary, #2563eb); color: #fff;
    border: none; border-radius: 8px; font-weight: 600;
    font-size: 0.9rem; cursor: pointer; transition: opacity 0.15s;
}
.review-cta-btn:hover { opacity: 0.9; }

/* === Review List === */
.review-list { margin-top: 24px; }
.review-item { padding: 16px 0; border-bottom: 1px solid #f3f4f6; }
.review-item__header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.review-item__stars { color: #f59e0b; font-size: 1rem; }
.review-item__author { font-weight: 600; color: #374151; font-size: 0.9rem; }
.review-item__date { font-size: 0.8rem; color: #9ca3af; }
.review-item__text { font-size: 0.93rem; color: #4b5563; line-height: 1.6; margin: 0 0 8px; }
.review-item__actions { margin-bottom: 4px; }

.review-helpful-btn {
    background: none; border: 1px solid #e5e7eb; border-radius: 16px;
    padding: 4px 12px; font-size: 0.8rem; color: #6b7280; cursor: pointer;
}
.review-helpful-btn:hover { background: #f9fafb; border-color: #d1d5db; }

.review-reply { margin: 8px 0 0 20px; padding: 10px 14px; background: #f9fafb; border-radius: 8px; border-left: 3px solid #d1d5db; }
.review-reply__label { font-size: 0.8rem; color: #6b7280; font-weight: 600; }
.review-reply__text { font-size: 0.88rem; color: #4b5563; margin: 4px 0 0; }
.review-reply--cta { background: #fffbeb; border-left-color: #f59e0b; font-size: 0.85rem; }
.review-reply--cta a { color: #2563eb; font-weight: 600; }

.review-item__flagged {
    margin: 6px 0 8px;
    padding: 6px 12px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #92400e;
}

.review-pagination { display: flex; align-items: center; gap: 12px; padding: 16px 0; font-size: 0.85rem; color: #6b7280; }
.review-page-link { color: #2563eb; text-decoration: none; font-weight: 600; }

/* === Editorial Note === */
.editorial-note {
    margin: 32px 0; padding: 20px; background: #f8fafc;
    border: 1px solid #e2e8f0; border-radius: 10px;
}
.editorial-note__label { font-size: 0.85rem; font-weight: 700; color: #64748b; margin-bottom: 8px; }
.editorial-note__text { font-size: 0.93rem; color: #475569; line-height: 1.6; margin: 0 0 8px; font-style: italic; }
.editorial-note__byline { font-size: 0.8rem; color: #94a3b8; }
.editorial-note__disclaimer { font-size: 0.75rem; color: #94a3b8; margin: 8px 0 0; border-top: 1px solid #e2e8f0; padding-top: 8px; }

/* === Form Modal === */
.review-form-modal { display: none; position: fixed; inset: 0; z-index: 1000; }
.review-form-modal.active { display: flex; align-items: center; justify-content: center; }
.review-form-modal__overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.review-form-modal__content {
    position: relative; background: #fff; border-radius: 12px;
    padding: 32px; max-width: 520px; width: 90%; max-height: 90vh;
    overflow-y: auto; z-index: 1;
}
.review-form-modal__close {
    position: absolute; top: 12px; right: 16px;
    background: none; border: none; font-size: 1.5rem; color: #9ca3af; cursor: pointer;
}

/* === Form === */
.review-form__title { font-size: 1.15rem; font-weight: 700; margin: 0 0 20px; color: #111827; }
.review-form__field { margin-bottom: 16px; }
.review-form__label { display: block; font-size: 0.85rem; font-weight: 600; color: #374151; margin-bottom: 6px; }
.review-form__label .required { color: #ef4444; }
.review-form__label .optional { color: #9ca3af; font-weight: 400; }
.review-form__textarea {
    width: 100%; min-height: 100px; padding: 10px 14px;
    border: 1px solid #d1d5db; border-radius: 8px; font-size: 0.9rem;
    resize: vertical; font-family: inherit;
}
.review-form__textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.review-form__input {
    width: 100%; padding: 8px 12px; border: 1px solid #d1d5db;
    border-radius: 6px; font-size: 0.9rem;
}
.review-form__charcount { font-size: 0.75rem; color: #9ca3af; margin-top: 4px; text-align: right; }
.review-form__error { font-size: 0.8rem; color: #ef4444; display: block; margin-top: 4px; }
.review-form__submit {
    display: block; width: 100%; padding: 12px;
    background: var(--primary, #2563eb); color: #fff; border: none;
    border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer;
    margin-top: 8px;
}
.review-form__submit:hover { opacity: 0.9; }
.review-form__submit:disabled { opacity: 0.5; cursor: not-allowed; }
.review-form__message { padding: 12px; border-radius: 8px; margin-top: 12px; font-size: 0.9rem; }
.review-form__message--success { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }
.review-form__message--error { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }

/* === Star Rating === */
.star-rating { display: inline-flex; gap: 4px; }
.star-rating__star {
    font-size: 2rem; cursor: pointer; color: #d1d5db; transition: color 0.1s;
    user-select: none; -webkit-user-select: none;
}
.star-rating__star.active { color: #f59e0b; }
.star-rating__star:hover { color: #fbbf24; }

/* === Inline Form (review.php) === */
.review-form--inline { max-width: 520px; }

/* === Responsive === */
@media (max-width: 640px) {
    .review-summary { flex-direction: column; gap: 16px; }
    .review-summary__dist { max-width: 100%; }
    .review-form-modal__content { padding: 20px; }
}
