/*
 * eCommerce Autopilot - reviews showcase (markup: resources/views/landing/reviews-showcase.blade.php).
 * Works on the light homepage, in dark mode, and on the /client-reviews page.
 */

.rv {
    --rv-ink: #0e1726;
    --rv-muted: #5b6676;
    --rv-line: rgba(14, 23, 38, .1);
    --rv-surface: #ffffff;
    --rv-soft: #f4f6f9;
    --rv-green: #2fc28a;
    --rv-green-d: #13875e;
    --rv-navy: #071726;
    --rv-star: #f5b301;
    font-family: "Hanken Grotesk", "Anek Bangla", system-ui, sans-serif;
    text-align: left;
}

[data-theme="dark"] .rv {
    --rv-ink: #e8edf3;
    --rv-muted: #9aa8b8;
    --rv-line: rgba(255, 255, 255, .1);
    --rv-surface: #0d2135;
    --rv-soft: #112a42;
}

/* ---------- Tabs ---------- */
.rv-tabs {
    display: flex;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 36px;
    padding: 5px;
    gap: 4px;
    border: 1px solid var(--rv-line);
    border-radius: 999px;
    background: var(--rv-surface);
    box-shadow: 0 12px 30px -18px rgba(7, 23, 38, .35);
    overflow-x: auto;
    scrollbar-width: none;
}

.rv-tabs::-webkit-scrollbar {
    display: none;
}

.rv-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: none;
    border: 0;
    background: transparent;
    color: var(--rv-muted);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 11px 20px;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.rv-tab svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rv-tab em {
    font-style: normal;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 99px;
    background: var(--rv-soft);
    color: var(--rv-muted);
}

.rv-tab:hover {
    color: var(--rv-ink);
}

.rv-tab.is-active {
    background: var(--rv-green-d);
    color: #fff;
}

.rv-tab.is-active em {
    background: rgba(255, 255, 255, .2);
    color: #fff;
}

.rv-tab:focus-visible,
.rv-card:focus-visible,
.rv-btn:focus-visible,
.rv-close:focus-visible {
    outline: 2px solid var(--rv-green);
    outline-offset: 3px;
}

/* ---------- Grid of 9:16 cards ---------- */
.rv-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    width: min(1180px, 100%);
    margin: 0 auto;
}

@media (max-width: 1100px) {
    .rv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .rv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

.rv-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 9 / 16;
    padding: 0;
    border: 1px solid var(--rv-line);
    border-radius: 18px;
    overflow: hidden;
    background: var(--rv-navy);
    color: #fff;
    text-align: left;
    font: inherit;
    cursor: pointer;
    isolation: isolate;
    transition: transform .25s ease, box-shadow .25s ease;
}

.rv-card[hidden] {
    display: none;
}

@media (hover: hover) {
    .rv-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 24px 44px -22px rgba(7, 23, 38, .6);
    }
    .rv-card:hover .rv-media img,
    .rv-card:hover .rv-media video {
        transform: scale(1.04);
    }
    .rv-card:hover .rv-play {
        transform: translate(-50%, -50%) scale(1.08);
        background: var(--rv-green);
    }
}

.rv-media {
    position: absolute;
    inset: 0;
    z-index: -1;
    display: block;
}

.rv-media img,
.rv-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s cubic-bezier(.2, .75, .15, 1);
}

/* Screenshots keep their full shape on a blurred copy of themselves */
.rv-card--proof .rv-media {
    background: var(--rv-soft);
}

.rv-card--proof .rv-media::before {
    content: "";
    position: absolute;
    inset: -20px;
    background: var(--rv-bg) center / cover no-repeat;
    filter: blur(18px) brightness(.85);
}

.rv-card--proof .rv-media img {
    position: relative;
    object-fit: contain;
    padding: 10px 10px 92px;
}

.rv-ph {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-family: "Bricolage Grotesque", system-ui, sans-serif;
    font-size: 64px;
    font-weight: 700;
    color: rgba(255, 255, 255, .9);
    background: linear-gradient(160deg, #13875e, #071726);
}

/* Readable caption over any picture */
.rv-card::after {
    content: "";
    position: absolute;
    inset: 45% 0 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(7, 23, 38, 0) 0%, rgba(7, 23, 38, .55) 45%, rgba(7, 23, 38, .92) 100%);
    pointer-events: none;
}

.rv-play {
    position: absolute;
    left: 50%;
    top: 46%;
    width: 58px;
    height: 58px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(7, 23, 38, .45);
    border: 1.5px solid rgba(255, 255, 255, .75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: transform .25s ease, background-color .25s ease;
}

.rv-play::after {
    content: "";
    position: absolute;
    left: 54%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent #fff;
}

.rv-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 16px;
}

.rv-info b {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
}

.rv-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, .78);
    line-height: 1.3;
}

.rv-excerpt {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.45;
    color: rgba(255, 255, 255, .88);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rv-more {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #5fe0ad;
}

.rv-stars {
    display: inline-flex;
    gap: 2px;
    margin-bottom: 2px;
}

.rv-stars i {
    width: 13px;
    height: 13px;
    background: rgba(255, 255, 255, .35);
    clip-path: polygon(50% 0, 61.8% 35.4%, 100% 38.2%, 69.1% 61.8%, 80.9% 100%, 50% 76.4%, 19.1% 100%, 30.9% 61.8%, 0 38.2%, 38.2% 35.4%);
}

.rv-stars i.on {
    background: var(--rv-star);
}

@media (max-width: 760px) {
    .rv-info { padding: 12px; }
    .rv-info b { font-size: 14px; }
    .rv-play { width: 48px; height: 48px; }
    .rv-card--proof .rv-media img { padding-bottom: 78px; }
    .rv-excerpt { -webkit-line-clamp: 2; }
}

.rv-empty {
    text-align: center;
    color: var(--rv-muted);
    padding: 48px 0;
    margin: 0;
}

/* ---------- Buttons ---------- */
.rv-load {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.rv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 26px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--rv-green, #2fc28a);
    color: var(--rv-navy, #071726);
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease;
}

.rv-btn:hover {
    background: #45d39c;
    color: var(--rv-navy, #071726);
}

.rv-btn--ghost {
    background: transparent;
    border-color: var(--rv-line);
    color: var(--rv-ink);
}

.rv-btn--ghost:hover {
    background: var(--rv-soft);
    color: var(--rv-ink);
}

/* ---------- Viewer popup ---------- */
.rv-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 20px;
}

.rv-modal[hidden] {
    display: none;
}

.rv-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 12, 20, .82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.rv-dialog {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 360px);
    max-height: calc(100vh - 40px);
    border-radius: 22px;
    overflow: hidden;
    background: var(--rv-surface);
    color: var(--rv-ink);
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .7);
    animation: rv-pop .28s cubic-bezier(.2, .75, .15, 1);
}

@keyframes rv-pop {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
}

.rv-stage {
    height: min(80vh, 760px);
    aspect-ratio: 9 / 16;
    background: #000;
    display: grid;
    place-items: center;
}

.rv-stage iframe,
.rv-stage video,
.rv-stage img {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.rv-stage img,
.rv-stage video {
    object-fit: contain;
}

.rv-detail {
    padding: 34px 26px 26px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rv-detail .rv-stars i {
    width: 16px;
    height: 16px;
    background: var(--rv-line);
}

.rv-detail .rv-stars i.on {
    background: var(--rv-star);
}

.rv-detail h3 {
    margin: 4px 0 0;
    font-family: "Bricolage Grotesque", system-ui, sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--rv-ink);
}

.rv-meta {
    margin: 0;
    color: var(--rv-muted);
    font-size: 14px;
}

.rv-text {
    margin: 14px 0 0;
    padding-left: 14px;
    border-left: 3px solid var(--rv-green);
    font-size: 15px;
    line-height: 1.65;
    color: var(--rv-ink);
    white-space: pre-line;
}

.rv-text:empty {
    display: none;
}

.rv-verified {
    margin-top: auto;
    padding-top: 18px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--rv-green-d);
}

[data-theme="dark"] .rv-verified {
    color: #5fe0ad;
}

.rv-verified svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rv-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    display: grid;
    place-items: center;
    background: rgba(7, 23, 38, .7);
    color: #fff;
    cursor: pointer;
}

.rv-close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

@media (max-width: 760px) {
    .rv-modal { padding: 0; }
    .rv-dialog {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }
    .rv-dialog { background: #000; }
    .rv-stage {
        height: 62vh;
        width: auto;
        justify-self: center;
    }
    .rv-detail { background: var(--rv-surface); }
    .rv-detail { padding: 20px 18px 28px; }
}

@media (prefers-reduced-motion: reduce) {
    .rv-card,
    .rv-media img,
    .rv-media video,
    .rv-play,
    .rv-dialog {
        transition: none;
        animation: none;
    }
}

/* An image whose file is missing falls back to the card's plain background */
.rv-media img.is-broken {
    visibility: hidden;
}
