/* ================================================================
   Reviews Module CSS  — nghost.vip brand colors
   Primary : #2196f3  |  Dark: #1565c0  |  Navy: #0d1547
   ================================================================ */

/* ── Stars ──────────────────────────────────────────────────── */
.rv-star-on  { color: #2196f3; font-size: inherit; }
.rv-star-off { color: #d1d5db; font-size: inherit; }

/* ── Hero score banner ──────────────────────────────────────── */
.rv-hero {
    background: linear-gradient(135deg, #0d1547 0%, #131e5e 60%, #0d1547 100%);
    border-radius: 8px;
    padding: 36px 32px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 28px;
}
.rv-hero-score {
    display: flex;
    align-items: center;
    gap: 20px;
}
.rv-hero-number {
    font-size: 4.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}
.rv-hero-stars-row {
    font-size: 1.6rem;
    letter-spacing: 2px;
    line-height: 1;
    margin-bottom: 6px;
}
.rv-hero-count {
    font-size: .85rem;
    color: rgba(255,255,255,.55);
    margin-top: 4px;
}

/* ── Distribution bars ─────────────────────────────────────── */
.rv-dist-list  { display: flex; flex-direction: column; gap: 7px; min-width: 220px; }
.rv-dist-item  { display: flex; align-items: center; gap: 10px; }
/* Clickable distribution rows (when wrapped in <a>) */
a.rv-dist-item {
    text-decoration: none; color: inherit;
    cursor: pointer;
    border-radius: 8px; padding: 3px 6px; margin: -3px -6px;
    transition: background .15s;
}
a.rv-dist-item:hover       { background: rgba(255,255,255,.1); }
a.rv-dist-item.rv-dist-active { background: rgba(255,255,255,.18); box-shadow: 0 0 0 1.5px rgba(255,255,255,.35); }
a.rv-dist-item.rv-dist-active .rv-dist-bar { background: linear-gradient(90deg, #fff, rgba(255,255,255,.7)); }
.rv-dist-label {
    width: 36px;
    font-size: .78rem;
    color: rgba(255,255,255,.65);
    font-weight: 600;
    flex-shrink: 0;
    text-align: right;
}
.rv-dist-track {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,.1);
    border-radius: 4px;
    overflow: hidden;
}
.rv-dist-bar {
    height: 100%;
    background: linear-gradient(90deg, #1976d2, #2196f3);
    border-radius: 4px;
    transition: width .7s ease;
    min-width: 2px;
}
.rv-dist-count {
    width: 24px;
    font-size: .75rem;
    color: rgba(255,255,255,.45);
    text-align: right;
    flex-shrink: 0;
}

/* ── Write review button (inside hero) ─────────────────────── */
.rv-write-hero-btn {
    display: inline-block;
    background: linear-gradient(135deg, #1976d2, #2196f3);
    color: #fff !important;
    border: none;
    border-radius: 4px;
    padding: 13px 30px;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none !important;
    cursor: pointer;
    transition: opacity .15s, transform .15s;
    white-space: nowrap;
    align-self: center;
}
.rv-write-hero-btn:hover { opacity: .88; transform: translateY(-2px); }

/* ── Submit form card ──────────────────────────────────────── */
.rv-form-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    border-top: 3px solid #2196f3;
    padding: 28px 24px;
    margin-bottom: 24px;
}
.rv-form-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0d1547;
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}
.rv-req { color: #ef4444; }

.rv-field { margin-bottom: 16px; }
.rv-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

/* Star picker */
.rv-star-picker {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
    margin: 4px 0;
}
.rv-star-picker input[type="radio"] { display: none; }
.rv-star-picker label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 2.2rem;
    color: #d1d5db;
    cursor: pointer;
    transition: color .12s, transform .1s;
    line-height: 1;
    user-select: none;
}
.rv-star-picker label:hover { transform: scale(1.15); }
/* Number below each star */
.rv-star-num {
    font-size: .65rem;
    font-weight: 700;
    color: #9ca3af;
    line-height: 1;
    transition: color .12s;
}

/* Dynamic rating description */
.rv-rating-desc {
    margin-top: 8px;
    font-size: .82rem;
    font-weight: 700;
    color: #2196f3;
    min-height: 1.3em;
    transition: color .15s, opacity .15s;
    opacity: .5;
}

.rv-submit-btn {
    display: inline-block;
    background: linear-gradient(135deg, #1565c0, #2196f3);
    color: #fff !important;
    border: none;
    border-radius: 4px;
    padding: 11px 32px;
    font-size: .92rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s, transform .15s;
    margin-top: 4px;
}
.rv-submit-btn:hover:not(:disabled) { opacity: .88; transform: translateY(-1px); }
.rv-submit-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ── Login card ────────────────────────────────────────────── */
.rv-login-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    border-top: 3px solid #2196f3;
    padding: 40px 24px;
    margin-bottom: 24px;
    text-align: center;
}
.rv-login-icon  { font-size: 2.8rem; line-height: 1; margin-bottom: 12px; }
.rv-login-title { font-size: 1.05rem; font-weight: 700; color: #0d1547; margin: 0 0 8px; }
.rv-login-text  { font-size: .88rem; color: #6b7280; margin: 0 0 20px; }
.rv-login-btn {
    display: inline-block;
    background: linear-gradient(135deg, #1565c0, #2196f3);
    color: #fff !important;
    font-weight: 700;
    font-size: .92rem;
    padding: 11px 32px;
    border-radius: 4px;
    text-decoration: none !important;
    transition: opacity .15s, transform .15s;
}
.rv-login-btn:hover { opacity: .88; transform: translateY(-1px); }

/* ── Reviews list header ───────────────────────────────────── */
.rv-reviews-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e8edf5;
}
.rv-reviews-header-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0d1547;
    margin: 0;
}
.rv-reviews-header-count {
    font-size: .85rem;
    color: #9ca3af;
    font-weight: 400;
}

/* ── Review item wrapper (title above + card) ──────────────── */
.rv-review-item {
    margin-bottom: 20px;
}
.rv-review-item:last-child { margin-bottom: 0; }

/* ── Title label — displayed ABOVE the card ────────────────── */
.rv-review-title-above {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #0d1547;
    margin-bottom: 10px;
    padding-left: 2px;
}
.rv-review-title-above::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: #2196f3;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Single review card ────────────────────────────────────── */
.rv-card {
    background: #fff;
    border-radius: 10px;
    padding: 22px 24px;
    border: 1px solid #e8edf5;
    box-shadow: 0 2px 8px rgba(13,21,71,.05), 0 1px 3px rgba(13,21,71,.04);
    transition: box-shadow .2s, transform .2s;
}
.rv-card:hover {
    box-shadow: 0 6px 24px rgba(13,21,71,.1);
    transform: translateY(-2px);
}

.rv-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.rv-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.rv-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d1547, #2196f3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.15rem;
    font-family: Arial, "Segoe UI", Tahoma, sans-serif;
    line-height: 1;
    flex-shrink: 0;
    overflow: hidden;
}
.rv-card-name {
    font-weight: 700;
    font-size: 1rem;
    color: #0d1547;
}
.rv-card-date {
    font-size: .82rem;
    color: #9ca3af;
    margin-top: 3px;
}
.rv-badge-verified {
    display: inline-block;
    background: rgba(33,150,243,.1);
    color: #1565c0;
    font-size: .72rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 4px;
    margin-left: 6px;
    border: 1px solid rgba(33,150,243,.25);
    vertical-align: middle;
}
.rv-card-rating { font-size: 1.15rem; white-space: nowrap; }

.rv-card-title {
    font-weight: 700;
    font-size: .97rem;
    color: #0d1547;
    margin-bottom: 6px;
}
.rv-card-body {
    font-size: 1.05rem;
    line-height: 1.9;
    color: #1f2937;
    font-style: normal;
    font-weight: 400;
    letter-spacing: .01em;
    text-align: start;          /* follows dir="auto" — RTL for Arabic, LTR for English */
    unicode-bidi: plaintext;    /* correct mixed Arabic/English rendering */
}
.rv-review-title-above {
    text-align: start;
    unicode-bidi: plaintext;
}

/* ── Review action bar (Useful · Share · Reply) ────────────── */
.rv-action-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
}
body.dark-mode .rv-action-bar { border-top-color: #1e293b; }

.rv-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1.5px solid transparent;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: .78rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    line-height: 1.5;
    white-space: nowrap;
}
.rv-action-btn:hover {
    background: rgba(33,150,243,.07);
    border-color: rgba(33,150,243,.3);
    color: #2196f3;
}
.rv-action-btn svg { flex-shrink: 0; }

/* Useful — active state after voting */
.rv-useful-btn.rv-voted {
    background: rgba(33,150,243,.1);
    border-color: rgba(33,150,243,.4);
    color: #2196f3;
}
.rv-useful-count {
    background: #e5e7eb;
    border-radius: 10px;
    padding: 0 6px;
    font-size: .72rem;
    font-weight: 700;
    color: #374151;
    transition: background .15s, color .15s;
    min-width: 18px;
    text-align: center;
}
.rv-useful-btn.rv-voted .rv-useful-count {
    background: #2196f3;
    color: #fff;
}
body.dark-mode .rv-useful-count { background: #374151; color: #d1d5db; }
body.dark-mode .rv-useful-btn.rv-voted .rv-useful-count { background: #2196f3; color: #fff; }

/* Share — copied flash */
.rv-share-btn.rv-copied { color: #22c55e !important; border-color: rgba(34,197,94,.4) !important; }

.rv-action-spacer { flex: 1; }
.rv-vote-feedback { font-size: .76rem; color: #6b7280; }

/* keep old .rv-vote hidden (no longer rendered but safe to keep) */
.rv-vote { display: none; }
.rv-helpful-row { display: none; }

/* ══════════════════════════════════════════════════════════════
   REPLIES  (Trustpilot-style threaded comments)
══════════════════════════════════════════════════════════════ */
.rv-replies-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}
body.dark-mode .rv-replies-section { border-top-color: #1e293b; }

/* List of existing replies */
.rv-replies-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.rv-reply-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.rv-reply-avatar {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg,#1565c0,#2196f3);
    color: #fff;
    font-size: .75rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin-top: 2px;
    box-shadow: 0 1px 4px rgba(33,150,243,.3);
}

.rv-reply-bubble {
    flex: 1;
    background: #f1f5f9;
    border-radius: 4px 14px 14px 14px;
    padding: 10px 14px;
    position: relative;
}
body.dark-mode .rv-reply-bubble {
    background: #1a2236;
}
.rv-reply-bubble::before {
    content: '';
    position: absolute;
    top: 10px; left: -6px;
    border: 6px solid transparent;
    border-right-color: #f1f5f9;
    border-left: 0;
}
body.dark-mode .rv-reply-bubble::before { border-right-color: #1a2236; }

.rv-reply-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}
.rv-reply-name {
    font-size: .83rem; font-weight: 700;
    color: #0d1547;
}
body.dark-mode .rv-reply-name { color: #e2e8f0; }
.rv-reply-date {
    font-size: .72rem; color: #9ca3af;
    margin-left: auto;
}
.rv-reply-body {
    font-size: .9rem; line-height: 1.65;
    color: #1f2937; margin: 0;
}
body.dark-mode .rv-reply-body { color: #d1d5db; }

/* ── Inline reply input form ───────────────────────────────── */
@keyframes rv-slide-down {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rv-inline-reply {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: rv-slide-down .18s ease;
    padding-top: 4px;
}
.rv-inline-reply-user-av {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg,#0d1547,#1565c0);
    color: #fff;
    font-size: .75rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin-top: 4px;
}
.rv-inline-reply-wrap {
    flex: 1;
    background: #f1f5f9;
    border: 1.5px solid transparent;
    border-radius: 4px 14px 14px 14px;
    transition: border-color .15s, background .15s;
    overflow: hidden;
}
body.dark-mode .rv-inline-reply-wrap {
    background: #1a2236;
    border-color: #2d3748;
}
.rv-inline-reply-wrap:focus-within {
    border-color: #2196f3;
    background: #fff;
}
body.dark-mode .rv-inline-reply-wrap:focus-within {
    background: #1e2433;
    border-color: #2196f3;
}
.rv-inline-reply textarea {
    width: 100%; border: none; background: transparent;
    padding: 10px 14px;
    font-size: .9rem; line-height: 1.55;
    resize: none; min-height: 42px; max-height: 150px;
    box-sizing: border-box; outline: none;
    color: #0f172a;
}
body.dark-mode .rv-inline-reply textarea { color: #e2e8f0; }
.rv-inline-reply textarea::placeholder { color: #9ca3af; }

.rv-inline-reply-actions {
    display: flex; gap: 8px;
    padding: 6px 10px 10px;
    justify-content: flex-end;
    border-top: 1px solid rgba(0,0,0,.05);
}
body.dark-mode .rv-inline-reply-actions { border-top-color: rgba(255,255,255,.06); }
.rv-inline-reply-cancel {
    background: none; border: none;
    font-size: .8rem; color: #6b7280;
    cursor: pointer; padding: 4px 10px; border-radius: 6px;
    transition: color .15s, background .15s;
}
.rv-inline-reply-cancel:hover { color: #ef4444; background: rgba(239,68,68,.07); }
.rv-inline-reply-submit {
    background: linear-gradient(135deg,#2196f3,#1565c0);
    color: #fff; border: none;
    border-radius: 8px; padding: 5px 16px;
    font-size: .82rem; font-weight: 700;
    cursor: pointer; transition: opacity .15s;
}
.rv-inline-reply-submit:hover   { opacity: .88; }
.rv-inline-reply-submit:disabled { opacity: .5; cursor: not-allowed; }
.rv-inline-reply-msg { font-size: .78rem; padding: 0 14px 8px; }

/* ── Country under reviewer name ──────────────────────────── */
.rv-card-country {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .78rem;
    color: #6b7280;
    margin-top: 2px;
    line-height: 1.3;
}
.rv-card-country-flag { font-size: .95rem; line-height: 1; }
body.dark-mode .rv-card-country { color: #9ca3af; }

/* ── Shared review — persistent highlight ──────────────────── */

/* Light mode */
.rv-card.rv-shared {
    position: relative;
    border: 2px solid rgba(33,150,243,.55) !important;
    background: linear-gradient(160deg, rgba(33,150,243,.045) 0%, #fff 60%) !important;
    box-shadow: 0 0 0 4px rgba(33,150,243,.1),
                0 8px 32px rgba(33,150,243,.16) !important;
    transform: none !important; /* disable hover lift on shared card */
}

/* Dark mode */
body.dark-mode .rv-card.rv-shared {
    border: 2px solid rgba(33,150,243,.65) !important;
    background: linear-gradient(160deg, rgba(33,150,243,.12) 0%, rgba(15,23,42,.95) 60%) !important;
    box-shadow: 0 0 0 4px rgba(33,150,243,.18),
                0 0 50px rgba(33,150,243,.22) !important;
}

/* Floating badge: "🔗 Shared Review" ribbon */
.rv-shared-badge {
    position: absolute;
    top: -1px;
    right: 20px;
    background: linear-gradient(135deg, #1565c0 0%, #2196f3 100%);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: 4px 14px 5px;
    border-radius: 0 0 10px 10px;
    letter-spacing: .05em;
    white-space: nowrap;
    box-shadow: 0 3px 12px rgba(33,150,243,.45);
    pointer-events: none;
    z-index: 3;
    line-height: 1.4;
}
body.dark-mode .rv-shared-badge {
    box-shadow: 0 3px 16px rgba(33,150,243,.6);
}

/* Initial entrance animation (runs once, then rv-shared takes over) */
@keyframes rv-highlight {
    0%   { box-shadow: 0 0 0 4px rgba(33,150,243,.1), 0 8px 32px rgba(33,150,243,.16), 0 0 0 10px rgba(33,150,243,.55); }
    65%  { box-shadow: 0 0 0 4px rgba(33,150,243,.1), 0 8px 32px rgba(33,150,243,.16), 0 0 0 18px rgba(33,150,243,.18); }
    100% { box-shadow: 0 0 0 4px rgba(33,150,243,.1), 0 8px 32px rgba(33,150,243,.16), 0 0 0 24px rgba(33,150,243,.0); }
}
body.dark-mode @keyframes rv-highlight {
    0%   { box-shadow: 0 0 0 4px rgba(33,150,243,.18), 0 0 50px rgba(33,150,243,.22), 0 0 0 10px rgba(33,150,243,.65); }
    65%  { box-shadow: 0 0 0 4px rgba(33,150,243,.18), 0 0 50px rgba(33,150,243,.22), 0 0 0 20px rgba(33,150,243,.2); }
    100% { box-shadow: 0 0 0 4px rgba(33,150,243,.18), 0 0 50px rgba(33,150,243,.22), 0 0 0 28px rgba(33,150,243,.0); }
}
.rv-card.rv-highlighted {
    animation: rv-highlight 1.6s cubic-bezier(.2,.8,.4,1) forwards;
}

/* ── Pagination ────────────────────────────────────────────── */
.rv-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.rv-pagination a {
    display: inline-block;
    padding: 7px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 4px;
    color: #374151;
    text-decoration: none !important;
    font-size: .85rem;
    font-weight: 500;
    transition: background .15s, color .15s, border-color .15s;
}
.rv-pagination a:hover,
.rv-pagination a.active {
    background: linear-gradient(135deg, #1565c0, #2196f3);
    color: #fff !important;
    border-color: transparent;
}

/* ── Alert messages ────────────────────────────────────────── */
.rv-alert         { border-radius: 6px; padding: 12px 16px; font-size: .88rem; font-weight: 500; margin-bottom: 16px; }
.rv-alert-success { background: #e3f2fd; color: #0d47a1; border: 1px solid #90caf9; }
.rv-alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .rv-hero               { padding: 24px 20px; flex-direction: column; }
    .rv-hero-number        { font-size: 3.5rem; }
    .rv-hero-stars-row     { font-size: 1.3rem; }
    .rv-dist-list          { width: 100%; }
    .rv-card-header        { flex-direction: column; gap: 8px; }
    .rv-form-card,
    .rv-login-card,
    .rv-reviews-card       { padding: 20px 16px; }
}
