/* ==========================================================================
   Anva Reviews - Frontend Styles
   ========================================================================== */

/* Reset box-sizing for our scope */
.anva-reviews-section *,
.anva-reviews-section *::before,
.anva-reviews-section *::after {
    box-sizing: border-box;
}

/* ---- Section ---- */
.anva-reviews-section {
    padding: 60px 0 80px;
    margin-top: var(--anva-section-margin-top, 0px);
    margin-bottom: var(--anva-section-margin-bottom, 0px);
    border-radius: var(--anva-card-radius, 20px);
    position: relative;
    overflow: hidden;
}

.anva-reviews-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- Header ---- */
.anva-reviews-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 48px;
}

.anva-header-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.anva-header-icon--video {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid #ef4444;
    color: #dc2626;
}

.anva-header-icon--photo {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border: 2px solid #8b5cf6;
    color: #7c3aed;
}

.anva-reviews-title {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* ---- Grid ---- */
.anva-reviews-slider {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.anva-slider-btn {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: #0f172a;
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}

.anva-slider-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    color: #111827;
}

.anva-slider-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.anva-slider-btn svg {
    width: 30px;
    height: 30px;
    display: block;
}

.anva-slider--locked .anva-slider-btn {
    display: none;
}

.anva-slider--locked .anva-reviews-grid {
    justify-content: center;
}

.anva-reviews-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 28px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    padding: 4px;
}

.anva-reviews-grid::-webkit-scrollbar {
    display: none;
}

.anva-reviews-grid > * {
    scroll-snap-align: start;
}

/* ==========================================================================
   VIDEO CARDS
   ========================================================================== */

.anva-video-card {
    width: 100%;
    max-width: 320px;
    flex: 0 0 min(320px, calc(100vw - 110px));
    background: #fff;
    border-radius: var(--anva-card-radius, 20px);
    overflow: hidden;
    position: relative;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.04),
        0 10px 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    border: 1px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
}

.anva-video-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.12),
        0 8px 16px rgba(0, 0, 0, 0.08);
}

/* Border accent wrap */
.anva-video-border-wrap {
    padding: 10px 10px 0;
    position: relative;
}

.anva-video-thumb {
    width: 100%;
    aspect-ratio: 9 / 16;
    background: linear-gradient(180deg, #0f172a 0%, #334155 100%);
    position: relative;
    overflow: hidden;
    border-radius: calc(var(--anva-card-radius, 20px) - 6px);
    border: 3px solid rgba(0, 0, 0, 0.06);
}

.anva-video-thumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100% !important;
    display: block;
    object-position: center;
}

.anva-video-thumb-img--hidden {
    display: none;
}

/* Overlay gradient on hover */
.anva-video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.15) 50%,
        rgba(0, 0, 0, 0.45) 100%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 1;
}

.anva-video-card:hover .anva-video-overlay {
    opacity: 1;
}

/* Shine effect */
.anva-video-shine {
    position: absolute;
    top: -100%;
    left: -100%;
    width: 60%;
    height: 200%;
    background: linear-gradient(
        120deg,
        transparent 30%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 70%
    );
    transform: rotate(25deg);
    transition: top 0.6s ease, left 0.6s ease;
    z-index: 2;
    pointer-events: none;
}

.anva-video-card:hover .anva-video-shine {
    top: -50%;
    left: 150%;
}

/* Play button */
.anva-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    z-index: 3;
    box-shadow:
        0 8px 24px rgba(239, 68, 68, 0.35),
        0 0 0 6px rgba(239, 68, 68, 0.15);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s ease;
}

.anva-play-btn svg {
    margin-left: 3px;
}

.anva-video-card:hover .anva-play-btn {
    transform: translate(-50%, -50%) scale(1.12);
    box-shadow:
        0 12px 32px rgba(239, 68, 68, 0.45),
        0 0 0 8px rgba(239, 68, 68, 0.2);
}

/* Pulse animation on play button */
.anva-play-btn::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(239, 68, 68, 0.4);
    animation: anva-pulse 2s ease-in-out infinite;
}

@keyframes anva-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .anva-play-btn::before {
        animation: none;
    }
    .anva-video-card,
    .anva-photo-card,
    .anva-photo-img,
    .anva-video-shine,
    .anva-video-overlay,
    .anva-play-btn,
    .anva-modal,
    .anva-modal-content {
        transition-duration: 0.01ms !important;
    }
}

/* Video info */
.anva-video-info {
    padding: 18px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.anva-video-name {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.01em;
}

.anva-video-caption {
    font-size: 13px;
    color: #6b7280;
    width: 100%;
    margin-top: -2px;
}

.anva-video-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid #fca5a5;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: auto;
}

/* ==========================================================================
   PHOTO CARDS (Glassmorphism)
   ========================================================================== */

.anva-photo-card {
    width: 100%;
    max-width: 340px;
    flex: 0 0 min(340px, calc(100vw - 110px));
    background: var(--anva-photo-card-bg, #ffffff);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--anva-card-radius, 20px);
    overflow: hidden;
    border: 1.5px solid rgba(15, 23, 42, 0.08);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.anva-photo-card:hover {
    transform: translateY(-8px);
    box-shadow:
        0 20px 48px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.anva-photo-img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
}

.anva-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.anva-photo-card:hover .anva-photo-img {
    transform: scale(1.05);
}

.anva-photo-body {
    padding: 22px 20px 24px;
}

.anva-photo-name {
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

/* Stars */
.anva-stars {
    display: flex;
    gap: 2px;
    margin-bottom: 10px;
}

.anva-star--filled {
    color: #f59e0b;
}

.anva-star--empty {
    color: #d1d5db;
}

.anva-photo-text {
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   VIDEO MODAL
   ========================================================================== */

.anva-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.anva-modal[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.anva-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.anva-modal-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    z-index: 2;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.anva-modal[aria-hidden="false"] .anva-modal-content {
    transform: scale(1) translateY(0);
}

.anva-modal-close {
    position: absolute;
    top: -44px;
    right: 0;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    line-height: 1;
}

.anva-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.anva-modal-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.15);
}

.anva-modal-video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
    .anva-reviews-grid {
        gap: 22px;
    }

    .anva-video-card {
        max-width: 280px;
    }

    .anva-photo-card {
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .anva-reviews-section {
        padding: 40px 0 60px;
    }

    .anva-reviews-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        margin-bottom: 32px;
    }

    .anva-reviews-title {
        font-size: 26px;
    }

    .anva-reviews-grid {
        gap: 20px;
    }

    .anva-reviews-slider {
        gap: 8px;
    }

    .anva-slider-btn {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .anva-slider-btn svg {
        width: 26px;
        height: 26px;
    }

    .anva-video-card {
        max-width: 260px;
        flex-basis: min(260px, calc(100vw - 94px));
    }

    .anva-photo-card {
        max-width: 280px;
        flex-basis: min(280px, calc(100vw - 94px));
    }

    .anva-video-info {
        padding: 14px 14px;
    }

    .anva-modal-content {
        max-width: 340px;
    }
}

@media (max-width: 480px) {
    .anva-reviews-section {
        padding: 32px 0 48px;
    }

    .anva-reviews-container {
        padding: 0 12px;
    }

    .anva-reviews-title {
        font-size: 22px;
    }

    .anva-reviews-grid {
        gap: 16px;
        padding: 2px;
    }

    .anva-video-card {
        max-width: 240px;
        flex-basis: min(240px, calc(100vw - 80px));
    }

    .anva-photo-card {
        max-width: 260px;
        flex-basis: min(260px, calc(100vw - 80px));
    }

    .anva-play-btn {
        width: 60px;
        height: 60px;
    }

    .anva-play-btn svg {
        width: 22px;
        height: 22px;
    }

    .anva-photo-body {
        padding: 16px 14px 18px;
    }

    .anva-modal-content {
        width: 92%;
        max-width: 300px;
    }
}
