/* ============================================
   REVIEWS SECTION — Clean & Minimal
   Uses site CSS variables: --c-primary, --c-accent,
   --c-surface, --c-border, --c-text, --c-text-muted
   ============================================ */

/* ── Layout (matches profile-container proportions) ── */
.rv-section {
    margin-top: 2rem;
}

.rv-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4%;
}

.rv-layout {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 16px;
    align-items: start;
}

.rv-left {
    position: sticky;
    top: 90px;
    order: 2;
}

.rv-right {
    min-width: 0;
    order: 1;
}

/* ── Summary Card ── */
.rv-summary {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 12px;
}

.rv-summary__score {
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--c-border);
    margin-bottom: 16px;
}

.rv-summary__score--empty {
    padding: 24px 0;
}

.rv-summary__number {
    font-size: 3rem;
    font-weight: 900;
    color: var(--c-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.rv-summary__stars {
    font-size: 1.25rem;
    color: #f59e0b;
    margin: 6px 0;
}

.rv-summary__count {
    font-size: 12px;
    color: var(--c-text-muted);
    font-weight: 600;
    margin-top: 4px;
}

/* Distribution Bars */
.rv-summary__bars {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--c-border);
    margin-bottom: 16px;
}

.rv-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.rv-bar:last-child {
    margin-bottom: 0;
}

.rv-bar__label {
    font-size: 12px;
    font-weight: 700;
    color: var(--c-text-muted);
    width: 28px;
    text-align: right;
    flex-shrink: 0;
}

.rv-bar__track {
    flex: 1;
    height: 6px;
    background: var(--c-border);
    border-radius: 3px;
    overflow: hidden;
}

.rv-bar__fill {
    height: 100%;
    background: #f59e0b;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.rv-bar__count {
    font-size: 11px;
    font-weight: 600;
    color: var(--c-text-muted);
    width: 20px;
    text-align: right;
    flex-shrink: 0;
}

/* Category Ratings */
.rv-summary__categories h4 {
    font-size: 11px;
    font-weight: 800;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.rv-cat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
}

.rv-cat:last-child {
    border-bottom: none;
}

.rv-cat__icon {
    width: 24px;
    height: 24px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--c-accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
}

.rv-cat__name {
    font-size: 12px;
    font-weight: 600;
    color: var(--c-text);
    flex: 1;
    min-width: 0;
}

.rv-cat__stars {
    color: #f59e0b;
    font-size: 11px;
    flex-shrink: 0;
}

.rv-cat__val {
    font-size: 12px;
    font-weight: 800;
    color: var(--c-primary);
    width: 24px;
    text-align: right;
    flex-shrink: 0;
}

/* ── Write Review (Expandable) ── */
.rv-write {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    overflow: hidden;
}

.rv-write__btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: var(--c-primary);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.rv-write__btn:hover {
    background: rgba(16, 185, 129, 0.05);
}

.rv-write__chevron {
    font-size: 10px;
    transition: transform 0.3s ease;
    margin-left: 2px;
}

.rv-write.is-open .rv-write__chevron {
    transform: rotate(180deg);
}

.rv-write__form {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 16px;
}

.rv-write.is-open .rv-write__form {
    max-height: 600px;
    padding: 0 16px 16px;
    border-top: 1px solid var(--c-border);
}

/* Form Fields */
.rv-field {
    margin-top: 14px;
}

.rv-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.rv-field__sub {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.rv-field input[type="text"],
.rv-field input[type="email"],
.rv-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--c-text);
    font-family: inherit;
    transition: border-color 0.2s ease;
    background: #fff;
}

.rv-field input:focus,
.rv-field textarea:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.rv-field textarea {
    resize: vertical;
    min-height: 70px;
}

.rv-field__hint {
    display: block;
    font-size: 11px;
    color: var(--c-text-muted);
    margin-top: 2px;
}

/* Star Rating Input */
.rv-star-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 2px;
}

.rv-star-input input {
    display: none;
}

.rv-star-input label {
    font-size: 1.5rem;
    color: var(--c-border);
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.rv-star-input label:hover,
.rv-star-input label:hover ~ label,
.rv-star-input input:checked ~ label {
    color: #f59e0b;
}

/* Character Counter */
.rv-counter {
    text-align: right;
    font-size: 11px;
    color: var(--c-text-muted);
    margin-top: 2px;
}

/* Submit Button */
.rv-submit {
    width: 100%;
    padding: 10px;
    margin-top: 14px;
    background: var(--c-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    font-family: inherit;
}

.rv-submit:hover {
    background: var(--c-primary-dark, #022c22);
    transform: translateY(-1px);
}

/* Header */
.rv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.rv-header__title {
    font-size: 15px;
    font-weight: 800;
    color: var(--c-text);
    margin: 0;
}

.rv-header__sort {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rv-header__sort label {
    font-size: 12px;
    font-weight: 600;
    color: var(--c-text-muted);
}

.rv-header__sort select {
    padding: 5px 8px;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--c-text);
    background: #fff;
    cursor: pointer;
    font-family: inherit;
}

.rv-header__sort select:focus {
    outline: none;
    border-color: var(--c-accent);
}

/* Filter Chips */
.rv-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    align-items: center;
}

.rv-chips__divider {
    width: 1px;
    height: 16px;
    background: var(--c-border);
    margin: 0 4px;
}

.rv-chip {
    padding: 5px 12px;
    border: 1px solid var(--c-border);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: var(--c-text-muted);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.rv-chip:hover {
    border-color: var(--c-accent);
    color: var(--c-accent);
}

.rv-chip--active {
    background: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
}

.rv-chip--active:hover {
    background: var(--c-primary-dark, #022c22);
    color: #fff;
    border-color: var(--c-primary-dark, #022c22);
}

/* Review Cards */
.rv-list {
    min-height: 100px;
}

.rv-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 10px;
    transition: border-color 0.2s ease;
}

.rv-card:hover {
    border-color: #cbd5e1;
}

.rv-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.rv-card__user {
    display: flex;
    gap: 10px;
    align-items: center;
}

.rv-card__avatar {
    width: 32px;
    height: 32px;
    background: var(--c-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}

.rv-card__name {
    font-size: 13px;
    font-weight: 800;
    color: var(--c-text);
    display: flex;
    align-items: center;
    gap: 5px;
}

.rv-card__verified {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: var(--c-accent);
    color: #fff;
    border-radius: 50%;
    font-size: 8px;
    flex-shrink: 0;
}

.rv-card__meta {
    font-size: 11px;
    color: var(--c-text-muted);
    font-weight: 600;
    margin-top: 2px;
}

.rv-card__date {
    font-size: 11px;
    color: var(--c-text-muted);
    font-weight: 600;
    flex-shrink: 0;
}

.rv-card__stars {
    color: #f59e0b;
    font-size: 13px;
    margin-bottom: 6px;
}

.rv-card__title {
    font-size: 14px;
    font-weight: 800;
    color: var(--c-text);
    margin: 0 0 4px;
}

.rv-card__text {
    font-size: 13px;
    color: var(--c-text-muted);
    line-height: 1.6;
}

/* School Response */
.rv-card__response {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(16, 185, 129, 0.05);
    border-left: 3px solid var(--c-accent);
    border-radius: 0 6px 6px 0;
}

.rv-card__response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.rv-card__response-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--c-accent);
}

.rv-card__response-date {
    font-size: 10px;
    color: var(--c-text-muted);
    font-weight: 600;
}

.rv-card__response-text {
    font-size: 12px;
    color: var(--c-text);
    line-height: 1.5;
}

/* Review Actions */
.rv-card__actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--c-border);
}

.rv-action {
    padding: 4px 10px;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--c-text-muted);
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}

.rv-action:hover {
    background: var(--c-surface);
    border-color: var(--c-accent);
    color: var(--c-accent);
}

.rv-action--voted {
    background: rgba(16, 185, 129, 0.08);
    border-color: var(--c-accent);
    color: var(--c-accent);
}

.rv-action--report:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

/* Pagination */
.rv-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
}

.rv-page {
    padding: 6px 12px;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--c-text-muted);
    background: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.rv-page:hover {
    border-color: var(--c-accent);
    color: var(--c-accent);
}

.rv-page--active {
    background: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
}

.rv-page--active:hover {
    color: #fff;
}

.rv-page--disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.rv-dots {
    padding: 6px 4px;
    font-size: 12px;
    color: var(--c-text-muted);
}

/* Loading / Empty */
.rv-loading,
.rv-empty {
    text-align: center;
    padding: 2rem;
    color: var(--c-text-muted);
    font-size: 13px;
    font-weight: 600;
}

.rv-loading i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--c-accent);
}

.rv-empty i {
    display: block;
    font-size: 2rem;
    color: var(--c-border);
    margin-bottom: 8px;
}

.rv-empty h4 {
    font-size: 14px;
    font-weight: 800;
    color: var(--c-text);
    margin: 0 0 4px;
}

.rv-empty p {
    font-size: 12px;
    margin: 0;
}

/* Alert Messages */
.rv-alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rv-alert--success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.rv-alert--error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.rv-alert--warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ── Report Modal ── */
.rv-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.rv-modal-overlay.is-open {
    display: flex;
}

.rv-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: rvModalIn 0.2s ease;
}

@keyframes rvModalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.rv-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--c-border);
}

.rv-modal__header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--c-text);
}

.rv-modal__close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--c-text-muted);
    font-size: 16px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.rv-modal__close:hover {
    background: #fee2e2;
    color: #ef4444;
}

.rv-modal__body {
    padding: 20px;
}

.rv-modal__body p {
    font-size: 13px;
    color: var(--c-text-muted);
    margin: 0 0 14px;
}

.rv-report-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rv-report-option:hover {
    border-color: var(--c-accent);
    background: rgba(16, 185, 129, 0.03);
}

.rv-report-option:has(input:checked) {
    border-color: var(--c-accent);
    background: rgba(16, 185, 129, 0.06);
}

.rv-report-option input[type="radio"] {
    accent-color: var(--c-accent);
    flex-shrink: 0;
}

.rv-report-option span {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text);
}

.rv-modal__body textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: var(--c-text);
    resize: vertical;
    min-height: 60px;
    margin-top: 12px;
    transition: border-color 0.2s ease;
}

.rv-modal__body textarea:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.rv-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--c-border);
}

.rv-modal__btn {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}

.rv-modal__btn--cancel {
    background: transparent;
    border: 1px solid var(--c-border);
    color: var(--c-text-muted);
}

.rv-modal__btn--cancel:hover {
    background: #f1f5f9;
}

.rv-modal__btn--submit {
    background: #ef4444;
    border: 1px solid #ef4444;
    color: #fff;
}

.rv-modal__btn--submit:hover {
    background: #dc2626;
}

/* ── Toast ── */
.rv-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: #1e293b;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.rv-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.rv-toast--success i {
    color: #34d399;
}

.rv-toast--error i {
    color: #f87171;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .rv-layout {
        grid-template-columns: 1fr;
    }

    .rv-left {
        position: static;
        order: 2;
    }

    .rv-right {
        order: 1;
    }
}

@media (max-width: 860px) {
    .rv-left {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .rv-summary,
    .rv-write {
        margin-bottom: 0;
    }
}

@media (max-width: 600px) {
    .rv-left {
        grid-template-columns: 1fr;
    }

    .rv-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .rv-header__sort {
        width: 100%;
    }

    .rv-header__sort select {
        flex: 1;
    }

    .rv-chips {
        gap: 4px;
    }

    .rv-chip {
        padding: 4px 10px;
        font-size: 11px;
    }

    .rv-card__header {
        flex-direction: column;
        gap: 4px;
    }

    .rv-card__actions {
        flex-direction: column;
    }

    .rv-action {
        justify-content: center;
    }

    .rv-summary__number {
        font-size: 2.5rem;
    }
}

