/* ========================================
   REVIEWS PAGE STYLES
   Editorial, hairline-separated layout.
   Mobile-first, Monsoon Mist theme tokens.
======================================== */

/* ========================================
   MAIN CONTENT
======================================== */
.rv-main {
    padding: 104px 20px 72px;
    background: var(--mist);
    min-height: 70vh;
}

@media (min-width: 640px) {
    .rv-main {
        padding: 136px 24px 104px;
    }
}

.rv-container {
    max-width: 720px;
    margin: 0 auto;
}

/* ========================================
   HERO
======================================== */
.rv-hero {
    text-align: center;
    padding: 8px 0 40px;
}

@media (min-width: 640px) {
    .rv-hero {
        padding: 16px 0 56px;
    }
}

.rv-eyebrow {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--teal-deep);
    margin-bottom: 14px;
}

.rv-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.25;
    letter-spacing: -0.01em;
}

@media (min-width: 640px) {
    .rv-title {
        font-size: 2.75rem;
    }
}

.rv-title-italic {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 400;
}

/* ========================================
   RATING SUMMARY
   Open band framed by hairlines — no box.
======================================== */
.rv-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px 0;
    border-top: 1px solid var(--ink-line);
    border-bottom: 1px solid var(--ink-line-soft);
}

@media (min-width: 640px) {
    .rv-summary {
        grid-template-columns: auto 1fr;
        gap: 64px;
        padding: 40px 0;
    }
}

.rv-summary-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

@media (min-width: 640px) {
    .rv-summary-score {
        align-items: flex-start;
        text-align: left;
        min-width: 180px;
    }
}

.rv-score-number {
    font-size: 3.5rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1;
    letter-spacing: -0.02em;
}

.rv-score-stars {
    display: flex;
    gap: 3px;
}

.rv-score-count {
    font-size: 0.85rem;
    color: var(--ink-soft);
}

/* Stars (shared, rendered by JS) */
.rv-star {
    fill: var(--star-empty);
    display: block;
    flex-shrink: 0;
}

.rv-star.is-filled {
    fill: var(--star);
}

/* Write a Review button — replaces the old floating FAB */
.rv-write-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    padding: 13px 28px;
    background: var(--teal-deep);
    color: var(--on-teal);
    border: none;
    border-radius: 9999px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 639px) {
    .rv-write-btn {
        align-self: stretch;
        width: 100%;
    }
}

.rv-write-btn:hover {
    background: var(--teal-deep-hover);
    box-shadow: 0 8px 24px var(--shadow-cta);
    transform: translateY(-1px);
}

.rv-write-btn:active {
    background: var(--teal-deep-press);
    transform: translateY(0);
    box-shadow: none;
}

/* Distribution rows — double as rating filters */
.rv-distribution {
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
}

.rv-dist-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% + 20px);
    margin: 0 -10px;
    padding: 7px 10px;
    background: none;
    border: none;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.rv-dist-row:hover {
    background: var(--mist-deep);
}

.rv-dist-row.active {
    background: var(--teal-tint);
}

.rv-dist-row:disabled {
    cursor: default;
    background: none;
}

.rv-dist-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink-soft);
    width: 12px;
    text-align: left;
    flex-shrink: 0;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.rv-dist-row.active .rv-dist-label {
    color: var(--teal-deep);
    font-weight: 600;
}

.rv-dist-bar {
    flex: 1;
    height: 6px;
    background: var(--mist-deeper);
    border-radius: 3px;
    overflow: hidden;
}

.rv-dist-fill {
    display: block;
    height: 100%;
    background: var(--star);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.rv-dist-count {
    font-size: 0.8rem;
    color: var(--ink-soft);
    width: 28px;
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* ========================================
   TOOLBAR (result count + sort)
======================================== */
.rv-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0 6px;
    min-height: 52px;
}

.rv-result-count {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

/* "Clear filter" chip, shown while a star filter is active */
.rv-clear-filter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--teal-tint);
    border: none;
    border-radius: 9999px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--teal-deep);
    cursor: pointer;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.rv-clear-filter:hover {
    background: var(--teal-tint-soft);
}

.rv-clear-filter svg {
    width: 12px;
    height: 12px;
}

/* Sort — quiet, text-styled select */
.rv-sort {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.rv-sort-label {
    font-size: 0.85rem;
    color: var(--ink-soft);
    white-space: nowrap;
}

.rv-sort-select {
    padding: 8px 26px 8px 6px;
    border: none;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink);
    background-color: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2312312C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 14px;
    transition: background-color 0.15s ease;
}

.rv-sort-select:hover {
    background-color: var(--mist-deep);
}

/* ========================================
   REVIEW ENTRIES
   Hairline-separated list, no card boxes.
======================================== */
.rv-list {
    display: flex;
    flex-direction: column;
}

.rv-card {
    padding: 28px 0;
}

.rv-card + .rv-card {
    border-top: 1px solid var(--ink-line-soft);
}

@media (min-width: 640px) {
    .rv-card {
        padding: 36px 0;
    }
}

/* Entry header: avatar + identity, stars right */
.rv-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.rv-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--mist-deep);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    text-transform: uppercase;
}

.rv-card-id {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.rv-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rv-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--ink-soft);
}

.rv-card-verified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--success);
    font-weight: 500;
    white-space: nowrap;
}

.rv-card-verified svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.rv-card-stars {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.rv-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.4;
    margin-bottom: 8px;
}

.rv-card-body {
    font-size: 0.92rem;
    color: var(--ink-soft);
    line-height: 1.75;
}

/* Photo Thumbnails */
.rv-card-photos {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.rv-card-thumb {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--ink-line);
    transition: transform 0.2s ease, border-color 0.2s ease;
    background: none;
    padding: 0;
}

.rv-card-thumb:hover {
    border-color: var(--ink);
    transform: scale(1.04);
}

.rv-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (min-width: 640px) {
    .rv-card-thumb {
        width: 72px;
        height: 72px;
    }
}

/* Helpful — quiet text button */
.rv-card-helpful {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 16px;
    padding: 7px 14px;
    background: none;
    border: 1px solid var(--ink-line);
    border-radius: 9999px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--ink-soft);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.rv-card-helpful:hover {
    color: var(--ink);
    border-color: var(--ink-soft);
}

.rv-card-helpful.active {
    color: var(--teal-deep);
    border-color: transparent;
    background: var(--teal-tint);
}

.rv-card-helpful svg {
    width: 13px;
    height: 13px;
}

/* ========================================
   LOADING SKELETON
======================================== */
.rv-skeleton {
    padding: 28px 0;
}

.rv-skeleton + .rv-skeleton {
    border-top: 1px solid var(--ink-line-soft);
}

.rv-skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: var(--mist-deep);
    animation: rv-pulse 1.4s ease-in-out infinite;
    margin-bottom: 12px;
}

.rv-skeleton-line:nth-child(1) { width: 32%; }
.rv-skeleton-line:nth-child(2) { width: 55%; }
.rv-skeleton-line:nth-child(3) { width: 90%; margin-bottom: 0; }

@keyframes rv-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
    .rv-skeleton-line {
        animation: none;
    }
}

/* ========================================
   EMPTY / ERROR STATE
======================================== */
.rv-empty {
    text-align: center;
    padding: 72px 20px;
}

.rv-empty-icon {
    margin: 0 auto 18px;
    color: var(--ink-faint);
}

.rv-empty-icon svg {
    width: 44px;
    height: 44px;
}

.rv-empty-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 8px;
}

.rv-empty-text {
    font-size: 0.9rem;
    color: var(--ink-soft);
    line-height: 1.6;
}

/* ========================================
   LOAD MORE
======================================== */
.rv-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 32px 0 8px;
    border-top: 1px solid var(--ink-line-soft);
}

.rv-more-note {
    font-size: 0.8rem;
    color: var(--ink-soft);
}

.rv-more-btn {
    padding: 12px 30px;
    background: none;
    border: 1px solid var(--ink-line);
    border-radius: 9999px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.rv-more-btn:hover {
    background: var(--mist-deep);
    border-color: var(--ink-soft);
}

.rv-more-btn:active {
    background: var(--mist-deeper);
}

/* ========================================
   WRITE REVIEW MODAL
======================================== */
.rv-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 49, 44, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

@media (min-width: 640px) {
    .rv-modal-overlay {
        align-items: center;
        padding: 20px;
    }
}

.rv-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.rv-modal {
    background: var(--paper);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 480px;
    padding: 32px 24px 40px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

@media (min-width: 640px) {
    .rv-modal {
        border-radius: 24px;
        padding: 40px 36px;
        transform: translateY(20px);
        max-height: 85vh;
        box-shadow: 0 24px 64px var(--shadow-tint-lg);
    }
}

.rv-modal-overlay.active .rv-modal {
    transform: translateY(0);
}

/* Drag Handle (mobile) */
.rv-modal-drag-handle {
    width: 36px;
    height: 4px;
    background: var(--ink-line);
    border-radius: 2px;
    margin: 0 auto 20px;
}

@media (min-width: 640px) {
    .rv-modal-drag-handle {
        display: none;
    }
}

/* Close Button */
.rv-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: var(--mist-deep);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 1;
}

.rv-modal-close:hover {
    background: var(--mist-deeper);
}

.rv-modal-close svg {
    width: 16px;
    height: 16px;
    color: var(--ink-soft);
}

/* Modal Typography */
.rv-modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
}

.rv-modal-subtitle {
    font-size: 0.9rem;
    color: var(--ink-soft);
    margin-bottom: 28px;
}

/* ========================================
   REVIEW FORM
======================================== */
#rv-review-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.rv-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.rv-field-label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink-soft);
    letter-spacing: 0.01em;
}

.rv-optional {
    color: var(--ink-faint);
    font-weight: 400;
}

.rv-input {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid var(--ink-line);
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: var(--ink);
    background: var(--paper);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
}

.rv-input::placeholder {
    color: var(--ink-faint);
}

.rv-input:focus {
    border-color: var(--teal-deep);
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
}

.rv-input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px var(--error-tint);
}

.rv-textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.6;
}

/* Star Rating Selector */
.rv-star-selector {
    display: flex;
    gap: 4px;
}

.rv-star-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    transition: transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.rv-star-btn:hover {
    transform: scale(1.12);
}

.rv-star-btn svg {
    width: 30px;
    height: 30px;
    fill: var(--star-empty);
    pointer-events: none;
    display: block;
    transition: fill 0.15s ease;
}

.rv-star-btn.is-filled svg {
    fill: var(--star);
}

.rv-star-label {
    font-size: 0.8rem;
    color: var(--ink-soft);
    margin-top: 4px;
    min-height: 18px;
}

.rv-star-label.error {
    color: var(--error);
}

/* Upload Area */
.rv-upload-area {
    border: 1.5px dashed var(--ink-line);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.rv-upload-area:hover,
.rv-upload-area.drag-over {
    border-color: var(--teal-deep);
    background: var(--teal-tint-soft);
}

.rv-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.rv-upload-placeholder svg {
    width: 30px;
    height: 30px;
    color: var(--ink-faint);
}

.rv-upload-placeholder span {
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.rv-upload-hint {
    font-size: 0.75rem !important;
    color: var(--ink-faint) !important;
}

/* Upload Previews */
.rv-upload-previews {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.rv-preview-item {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--ink-line);
}

.rv-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rv-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(18, 49, 44, 0.65);
    border: none;
    border-radius: 50%;
    color: var(--on-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    transition: background 0.2s ease;
}

.rv-preview-remove:hover {
    background: rgba(18, 49, 44, 0.85);
}

.rv-preview-video {
    width: 100%;
    height: 100%;
    background: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--on-ink);
    font-size: 0.7rem;
    font-family: 'Outfit', sans-serif;
}

/* Modal Actions */
.rv-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    justify-content: flex-end;
}

.rv-cancel-btn {
    padding: 13px 24px;
    background: none;
    border: 1px solid var(--ink-line);
    border-radius: 9999px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink-soft);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.rv-cancel-btn:hover {
    border-color: var(--ink-soft);
    color: var(--ink);
}

.rv-submit {
    padding: 13px 28px;
    background: var(--teal-deep);
    color: var(--on-teal);
    border: none;
    border-radius: 9999px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.rv-submit:hover {
    background: var(--teal-deep-hover);
    box-shadow: 0 8px 24px var(--shadow-cta);
}

.rv-submit:active {
    background: var(--teal-deep-press);
    box-shadow: none;
}

.rv-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

/* Modal Success State */
.rv-modal-success {
    text-align: center;
    padding: 20px 0;
}

.rv-modal-success.hidden {
    display: none;
}

.rv-success-icon {
    width: 56px;
    height: 56px;
    background: var(--success-tint);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.rv-success-icon svg {
    width: 26px;
    height: 26px;
    color: var(--success);
}

.rv-success-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 8px;
}

.rv-success-text {
    font-size: 0.9rem;
    color: var(--ink-soft);
    margin-bottom: 24px;
    line-height: 1.6;
}

.rv-done-btn {
    margin: 0 auto;
}

/* ========================================
   IMAGE LIGHTBOX
======================================== */
.rv-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.rv-lightbox-overlay.active {
    display: flex;
}

.rv-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 1;
}

.rv-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.rv-lightbox-close svg {
    width: 20px;
    height: 20px;
}

.rv-lightbox-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.rv-lightbox-content img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 12px;
    object-fit: contain;
}
