/* ==========================================================================
   Waqt Al-Hadhara - testimonials.css (Ultra-Premium Rebuild)
   Seamless, wide-track marquee with refined mobile architecture.
   ========================================================================== */

:root {
    --t-card-width-desktop: 380px;
    --t-card-width-tablet: 320px;
    --t-card-width-mobile: 250px; /* Reduced for better mobile shape */
    --t-gap: 24px;
    --t-duration: 40s;
    --t-mask-width: 15%;
}

.testimonials-sec {
    position: relative;
    padding: 100px 0;
    background-color: var(--color-bg-primary);
    overflow: hidden;
}

/* ── Cinematic Side Masks ────────────────────────────────────────────────── */
.t-rows {
    position: relative;
    width: 100%;
    margin-top: 50px;
    display: flex;
    flex-direction: column;
    gap: 10px; /* Reduced gap since rows have internal padding now */
}

/* Elegant fade masks to hide the "entry/exit" of cards */
.t-rows::before,
.t-rows::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: var(--t-mask-width);
    z-index: 10;
    pointer-events: none;
}

.t-rows::before {
    left: 0;
    background: linear-gradient(to right, var(--color-bg-primary), transparent);
}

.t-rows::after {
    right: 0;
    background: linear-gradient(to left, var(--color-bg-primary), transparent);
}

/* ── Marquee Track Structure ─────────────────────────────────────────────── */
.t-row {
    width: 100%;
    max-width: 100%; /* marquee can never force horizontal scroll */
    overflow: hidden;
    /* Force LTR here so the track always starts from the left edge 
       regardless of the global RTL setting. This fixes the "gap" bug. */
    direction: ltr !important; 
    /* Added vertical padding to allow cards to "rise" on hover without clipping */
    padding: 20px 0;
}

.t-track {
    display: flex;
    width: max-content;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Row 1: Right -> Left */
.t-row-left .t-track {
    animation: marqueeLeft var(--t-duration) linear infinite;
}

/* Row 2: Left -> Right */
.t-row-right .t-track {
    animation: marqueeRight var(--t-duration) linear infinite;
}

.t-row:hover .t-track {
    animation-play-state: paused;
}

/* ── Testimonial Card (Premium Design) ──────────────────────────────────── */
.t-card {
    flex-shrink: 0;
    width: var(--t-card-width-desktop);
    margin-right: var(--t-gap);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-grey);
    padding: 30px;
    display: flex;
    flex-direction: column; /* Better for structure */
    gap: 18px;
    direction: rtl; /* Content is Arabic */
    text-align: right;
    white-space: normal;
    transition: all 0.4s var(--transition-ease);
}

.t-card:hover {
    border-color: var(--color-gold);
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    background: #0F0F11;
}

html.light-mode .t-card:hover {
    background: #FFFFFF;
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

/* Card Header: Stars and Info */
.t-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.t-stars {
    color: var(--color-gold);
    font-size: 0.85rem;
    display: flex;
    gap: 3px;
}

.t-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.t-photo {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-border-grey);
    transition: border-color 0.3s ease;
}

.t-card:hover .t-photo {
    border-color: var(--color-gold);
}

.t-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.t-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.t-role {
    font-size: 0.78rem;
    color: var(--color-gold);
    font-weight: 500;
}

.t-text {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin: 0;
    font-weight: 400;
}

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes marqueeLeft {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes marqueeRight {
    0%   { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

/* ── Responsive Refinements ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .t-card { width: var(--t-card-width-tablet); padding: 24px; }
    :root { --t-duration: 50s; }
}

@media (max-width: 768px) {
    .testimonials-sec { padding: 70px 0; }
    .t-rows { gap: 20px; }
    :root { 
        --t-duration: 45s; 
        --t-mask-width: 10%;
    }
}

/* Phone Mode Optimization (The "Shape" request) */
@media (max-width: 480px) {
    .t-card { 
        width: var(--t-card-width-mobile); 
        padding: 18px; /* Slightly tighter for better shape */
        gap: 12px;
        border-width: 1px; /* Ensure clean border */
    }
    
    .t-photo { width: 42px; height: 42px; } /* Slightly smaller photo */
    .t-name { font-size: 0.88rem; }
    .t-role { font-size: 0.7rem; }
    .t-stars { font-size: 0.75rem; gap: 2px; }
    
    .t-text { 
        font-size: 0.82rem; 
        line-height: 1.55; 
        color: var(--color-text-secondary);
    }
    
    .t-rows::before, .t-rows::after { width: 6%; } /* Narrower masks for mobile */

    /* Slightly faster on mobile for energy */
    :root { --t-duration: 32s; }
}

/* ── Google Review CTA ────────────────────────────────────────────────── */
.t-google-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 12px 24px;
    border: 1px solid var(--color-gold, #c9a961);
    border-radius: 50px;
    color: var(--color-gold, #c9a961);
    background: transparent;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}
.t-google-cta:hover {
    background: var(--color-gold, #c9a961);
    color: #000;
    transform: translateY(-1px);
}
.t-google-cta .fa-google { font-size: 1.1rem; }

/* Google-source review card: thin gold border to distinguish from narrative cards */
.t-card-google { border-color: var(--color-gold, #c9a961); }

/* ── Clickable Google Cards ──────────────────────────────────────────────── */
.t-card-clickable {
    cursor: pointer;
    user-select: none;
}
.t-card-clickable:focus-visible {
    outline: 2px solid var(--color-gold, #c9a961);
    outline-offset: 3px;
}
