/* ==========================================================================
   INKRYPTUS REVIEWS MARQUEE - SEAMLESS TRACK LOGIC
   ========================================================================== */

:root {
    --irm-marquee-speed: 90s;
    --irm-card-width: 380px;
    --irm-card-gap: 2rem;
}

/* Container principal com máscara de fade */
.irm-marquee-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 2rem 0;
    mask-image: linear-gradient(to right,
            transparent,
            black 10%,
            black 90%,
            transparent);
    -webkit-mask-image: linear-gradient(to right,
            transparent,
            black 10%,
            black 90%,
            transparent);
}

/* A trilha que carrega os itens duplicados */
.irm-marquee-track {
    display: flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    width: max-content;
    will-change: transform;
    animation: irm-marquee var(--irm-marquee-speed) linear infinite !important;
    gap: var(--irm-card-gap);
}

/* Pausa ao passar o mouse */
.irm-marquee-wrapper:hover .irm-marquee-track {
    animation-play-state: paused !important;
}

/* Keyframes para loop infinito perfeito */
@keyframes irm-marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        /* Move exatamente metade da largura total da track (Original + Clone) */
        transform: translateX(-50%);
    }
}

/* ==========================================================================
   CARDS DESIGN - PREMIUM GLASSMORPHISM
   ========================================================================== */

.irm-review-card {
    display: flex;
    flex-direction: column;
    width: var(--irm-card-width);
    height: 350px;
    /* Fixed height to keep all cards uniform */
    flex-shrink: 0;
    white-space: normal;
    /* Critical: overrides marquee nowrap to allow internal text wrapping */
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    text-decoration: none !important;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.irm-review-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary);
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Header do Card */
.irm-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
    flex-shrink: 0;
}

.irm-reviewer-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.irm-photo-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--surface-3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.irm-card-meta {
    display: flex;
    flex-direction: column;
}

.irm-reviewer-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.irm-stars {
    display: flex;
    gap: 2px;
    color: #fbb03b;
    font-size: 1.8rem;
    padding-top: 10px;
}

/* Body do Card */
.irm-card-body {
    flex-grow: 1;
    overflow: hidden;
}

.irm-review-text {
    font-size: 1.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    /* Limits lines and adds (...) automatically */
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* Remove p margins inside cards to keep line-clamping consistent */
.irm-review-text p {
    margin: 0;
    display: inline;
}

/* Media Queries */
@media (max-width: 768px) {
    :root {
        --irm-card-width: 300px;
        --irm-marquee-speed: 90s;
    }
}

/* Light Theme Adaptations */
body.light-theme .irm-review-card {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .irm-review-text {
    color: var(--dark-text-secondary);
}

/* Seção e Cabeçalhos */
.trust-section {
    padding: var(--spacing-xl) 0;
    background-color: var(--dark-bg) !important;
}

.section-title-trust {
    color: var(--primary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-subtitle-trust {
    font-weight: 400;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

/* Tabela de destaque das avaliações */
.review-card-highlight {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
}

.review-highlight-table {
    width: auto;
    margin: 0 auto;
    border-collapse: collapse;
    color: white;
}

.review-highlight-table td {
    vertical-align: middle;
    padding: 0 15px;
}

.highlight-label {
    font-size: 1.2rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.highlight-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.highlight-primary {
    color: var(--primary);
}

.highlight-separator {
    font-size: 2rem;
    font-weight: 100;
    color: rgba(255, 255, 255, 0.2);
}

.highlight-stars {
    display: flex;
    align-items: center;
    font-weight: 800;
}

.highlight-stars img {
    display: block;
    width: 120px;
    padding: 17px 8px;
}

/* Inline Card */
.trustpilot-inline-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
    padding: 1.5rem;
    border: 1px solid var(--surface-3);
    border-radius: 15px;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.trustpilot-inline-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

.trustpilot-inline-card__text {
    display: flex;
    flex-direction: column;
    color: white;
}

body.light-theme .trust-section {
    background-color: var(--light-bg) !important;
}

body.light-theme .section-subtitle-trust,
body.light-theme .review-highlight-table,
body.light-theme .trustpilot-inline-card__text {
    color: var(--dark-text);
}

body.light-theme .trustpilot-inline-card {
    background: rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   ILLUSTRATION GRID LAYOUT
   ========================================================================== */

.trust-main-grid {
    display: block;
    width: 100%;
}

.trust-section.has-illustrations .trust-main-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    /* Illustration takes less space than content */
    gap: var(--spacing-xxl, 6rem);
    align-items: center;
}

.trust-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
}

.trust-illustration .illustration-img {
    max-width: 100%;
    height: auto;
    max-height: 45rem;
}

.trust-content-wrapper {
    width: 100%;
    min-width: 0;
    /* Prevent marquee from breaking grid */
}

/* Section adjustment when has illustrations */
.trust-section.has-illustrations .review-card-highlight {
    align-items: flex-start;
}

.trust-section.has-illustrations .review-highlight-table {
    margin: 0;
}

/* Ensure CTA card is centered outside the grid */
.trust-section .trustpilot-inline-card {
    margin-left: auto;
    margin-right: auto;
    max-width: 80rem;
}

/* Dark/Light mode images toggle if not already handled by theme */
.trust-illustration .light-mode-image {
    display: none;
}

body.light-theme .trust-illustration .light-mode-image {
    display: block;
}

body.light-theme .trust-illustration .dark-mode-image {
    display: none;
}

/* Responsive */
@media (max-width: 992px) {
    .trust-section.has-illustrations .trust-main-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl, 4rem);
    }

    .trust-illustration {
        order: -1;
        /* Illustration on top in mobile */
        max-width: 35rem;
        margin: 0 auto;
    }

    .trust-section.has-illustrations .section-title-trust,
    .trust-section.has-illustrations .section-subtitle-trust {
        text-align: center;
    }

    .trust-section.has-illustrations .review-card-highlight {
        align-items: center;
    }

    .trust-section.has-illustrations .review-highlight-table {
        margin: 0 auto;
    }

    .trust-section.has-illustrations .trustpilot-inline-card {
        justify-content: center;
    }
}