/* ═══════════════════════════════════════════════════════════
   FM Review Carousel — Frontend Styles
   Version: 0.3.0 · Author: Foolsmate.digital
   ═══════════════════════════════════════════════════════════ */

/* ── Page Body (used by index.php) ───────────────────────── */
.fm-page-body {
    margin: 0;
    padding: 0;
    background: #0f172a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Carousel Wrapper ────────────────────────────────────── */
.fm-carousel-wrapper {
    --bg-color: transparent;
    --card-bg: rgba(20, 27, 42, 0.45);
    --card-border-gradient: linear-gradient(135deg, rgba(212, 175, 55, 0.6) 0%, rgba(212, 175, 55, 0.1) 50%, rgba(212, 175, 55, 0.05) 100%);
    --card-glow-hover: 0 16px 40px rgba(212, 175, 55, 0.15), 0 0 20px rgba(212, 175, 55, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --star-color: #fcd34d;
    --star-empty: #334155;
    --logo-bg: #ffffff;
    --pipe-color: #475569;

    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
    overflow-x: hidden;
    padding: 60px 0;
    box-sizing: border-box;
}

.fm-carousel-wrapper *,
.fm-carousel-wrapper *::before,
.fm-carousel-wrapper *::after {
    box-sizing: inherit;
}

/* ── Track Container ─────────────────────────────────────── */
.fm-carousel-wrapper .carousel-track-container {
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
    position: relative;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

.fm-carousel-wrapper .carousel-track {
    display: inline-flex;
    gap: 32px;
    padding: 20px 12px;
}

/* ═══════════════════════════════════════════════════════════
   REVIEW CARD — Glass Morphism
   ═══════════════════════════════════════════════════════════ */

.fm-carousel-wrapper .review-card {
    position: relative;
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 28px;
    min-width: 480px;
    max-width: 480px;
    min-height: 290px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.05);
    white-space: normal;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1;
    animation: cardFadeIn 0.6s ease both;
}

/* Gradient Border */
.fm-carousel-wrapper .review-card::before {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: -1;
    margin: -1px;
    border-radius: inherit;
    background: var(--card-border-gradient);
    opacity: 0.7;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

/* Hover */
.fm-carousel-wrapper .review-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--card-glow-hover);
    z-index: 10;
}

.fm-carousel-wrapper .review-card:hover::before {
    opacity: 1;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.9) 0%, rgba(212, 175, 55, 0.3) 50%, rgba(212, 175, 55, 0.1) 100%);
}

/* ── Clickable Cards ─────────────────────────────────────── */
.fm-carousel-wrapper .review-card.clickable {
    cursor: pointer;
}

.fm-carousel-wrapper .review-card.clickable::after {
    content: '↗';
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 18px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fm-carousel-wrapper .review-card.clickable:hover::after {
    color: var(--star-color);
    transform: translate(4px, -4px);
}

/* ═══════════════════════════════════════════════════════════
   CARD TOP — Stars
   ═══════════════════════════════════════════════════════════ */

.fm-carousel-wrapper .card-top {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.fm-carousel-wrapper .stars {
    color: var(--star-color);
    font-size: 18px;
    letter-spacing: 3px;
    transition: text-shadow 0.3s ease;
}

.fm-carousel-wrapper .review-card:hover .stars {
    text-shadow: 0 0 8px rgba(252, 211, 77, 0.8);
}

.fm-carousel-wrapper .stars .star-empty {
    color: var(--star-empty);
    text-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════════
   CARD BODY — The Quote (Hero Element)
   ═══════════════════════════════════════════════════════════ */

.fm-carousel-wrapper .card-body {
    flex-grow: 1;
    position: relative;
    margin-bottom: 24px;
}

.fm-carousel-wrapper .quote-mark {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 56px;
    line-height: 1;
    color: var(--star-color);
    opacity: 0.35;
    position: absolute;
    top: -8px;
    left: -4px;
    pointer-events: none;
    user-select: none;
}

.fm-carousel-wrapper .review-text {
    font-size: 20px;
    line-height: 1.5;
    color: #e2e8f0;
    font-weight: 400;
    letter-spacing: 0.15px;
    margin: 0;
    padding-left: 6px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

/* ═══════════════════════════════════════════════════════════
   CARD ATTRIBUTION — Logo + Name + Company (Bottom)
   ═══════════════════════════════════════════════════════════ */

.fm-carousel-wrapper .card-attribution {
    display: flex;
    align-items: center;
    gap: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 18px;
    margin-top: auto;
}

/* ── Logo Box ────────────────────────────────────────────── */
.fm-carousel-wrapper .logo-box {
    background-color: var(--logo-bg);
    border-radius: 12px;
    width: 104px;
    height: 73px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.fm-carousel-wrapper .logo-placeholder {
    color: #1e293b;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Logo image — hidden by default, JS adds .is-visible */
.fm-carousel-wrapper .logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    display: none;
}

.fm-carousel-wrapper .logo-img.is-visible {
    display: block;
}

/* ── Attribution Text ────────────────────────────────────── */
.fm-carousel-wrapper .attribution-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}

.fm-carousel-wrapper .person-name {
    font-size: 15px;
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: 0.2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fm-carousel-wrapper .company-name {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS — Infinite Scroll
   ═══════════════════════════════════════════════════════════ */

@keyframes scroll-left {
    from { transform: translateX(0); }
    to { transform: translateX(calc(-50% - 16px)); }
}

@keyframes scroll-right {
    from { transform: translateX(calc(-50% - 16px)); }
    to { transform: translateX(0); }
}

.fm-carousel-wrapper .track-scroll-left {
    animation: scroll-left 50s linear infinite;
}

.fm-carousel-wrapper .track-scroll-right {
    animation: scroll-right 50s linear infinite;
}

/* Pause state — toggled by JS via class */
.fm-carousel-wrapper .carousel-track.is-paused {
    animation-play-state: paused;
}

/* ── Card Entrance Animation ─────────────────────────────── */

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

/* Staggered entrance per row */
.fm-carousel-wrapper .carousel-track-container:nth-child(1) .review-card { animation-delay: 0s; }
.fm-carousel-wrapper .carousel-track-container:nth-child(2) .review-card { animation-delay: 0.15s; }
.fm-carousel-wrapper .carousel-track-container:nth-child(3) .review-card { animation-delay: 0.3s; }

/* ═══════════════════════════════════════════════════════════
   EMBED OVERRIDES — Lightweight iFrame Mode
   ═══════════════════════════════════════════════════════════ */

.fm-embed-body {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.fm-embed-body .fm-carousel-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .fm-carousel-wrapper {
        padding: 30px 0;
        gap: 20px;
    }

    .fm-carousel-wrapper .review-card {
        min-width: 340px;
        max-width: 340px;
        padding: 24px;
        min-height: 310px;
    }

    .fm-carousel-wrapper .carousel-track {
        gap: 20px;
    }

    .fm-carousel-wrapper .logo-box {
        width: 44px;
        height: 44px;
        padding: 5px;
        border-radius: 10px;
    }

    .fm-carousel-wrapper .logo-placeholder {
        font-size: 12px;
    }

    .fm-carousel-wrapper .card-attribution {
        gap: 12px;
    }

    .fm-carousel-wrapper .person-name {
        font-size: 13px;
    }

    .fm-carousel-wrapper .company-name {
        font-size: 12px;
    }

    .fm-carousel-wrapper .review-text {
        font-size: 15px;
        line-height: 1.65;
    }

    .fm-carousel-wrapper .quote-mark {
        font-size: 44px;
    }

    @keyframes scroll-left {
        from { transform: translateX(0); }
        to { transform: translateX(calc(-50% - 10px)); }
    }

    @keyframes scroll-right {
        from { transform: translateX(calc(-50% - 10px)); }
        to { transform: translateX(0); }
    }
}

@media (max-width: 480px) {
    .fm-carousel-wrapper .review-card {
        min-width: 290px;
        max-width: 290px;
        padding: 20px;
        min-height: 280px;
    }

    .fm-carousel-wrapper .stars {
        font-size: 15px;
        letter-spacing: 2px;
    }

    .fm-carousel-wrapper .review-text {
        font-size: 14px;
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }

    .fm-carousel-wrapper .quote-mark {
        font-size: 36px;
    }

    .fm-carousel-wrapper .logo-box {
        width: 40px;
        height: 40px;
        padding: 4px;
        border-radius: 8px;
    }
}

/* ═══════════════════════════════════════════════════════════
   UTILITY — JS Visibility Toggle
   ═══════════════════════════════════════════════════════════ */

.fm-carousel-wrapper .is-hidden {
    display: none !important;
}

@media print {
    .fm-carousel-wrapper { display: none; }
}
