/* ============================================================
   AfriSkill AI — Premium Testimonials
   ============================================================ */

.tm-section {
    position: relative;
    overflow: hidden;
    padding: 100px 0 120px;
}

.tm-bg-glow {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 500px;
    background: radial-gradient(ellipse, rgba(79, 70, 229, 0.16) 0%, transparent 70%);
    pointer-events: none;
}

.tm-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
    pointer-events: none;
}

[data-theme="light"] .tm-bg-grid {
    background-image:
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
}

.tm-header { text-align: center; margin-bottom: 56px; position: relative; z-index: 1; }

.tm-trust-bar {
    display: inline-flex;
    align-items: center;
    gap: 32px;
    margin-top: 32px;
    padding: 16px 32px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 100px;
    backdrop-filter: blur(12px);
}

[data-theme="light"] .tm-trust-bar {
    background: rgba(255,255,255,0.8);
    border-color: rgba(0,0,0,0.06);
    box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}

.tm-trust-item { text-align: center; }
.tm-trust-val {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #818CF8, #C4B5FD);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.tm-trust-lbl { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.tm-trust-divider { width: 1px; height: 32px; background: rgba(255,255,255,0.1); }
[data-theme="light"] .tm-trust-divider { background: rgba(0,0,0,0.08); }

/* Slider */
.tm-slider-wrap { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; }

.tm-slider {
    overflow: hidden;
    border-radius: 24px;
    perspective: 1200px;
}

.tm-track {
    display: flex;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.tm-slide {
    min-width: 100%;
    flex-shrink: 0;
    padding: 8px;
    opacity: 0.5;
    transform: scale(0.92);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.tm-slide.is-active {
    opacity: 1;
    transform: scale(1);
}

/* Card */
.tm-card {
    position: relative;
    padding: 48px 44px 40px;
    background: linear-gradient(145deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    overflow: hidden;
}

[data-theme="light"] .tm-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-color: rgba(0,0,0,0.06);
    box-shadow: 0 20px 60px rgba(0,0,0,0.06), 0 1px 0 rgba(255,255,255,0.8) inset;
}

.tm-slide.is-featured .tm-card {
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.08);
}

.tm-card-glow {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.tm-quote-icon {
    position: absolute;
    top: 24px;
    right: 28px;
    color: #2563EB;
}

.tm-featured-badge {
    position: absolute;
    top: 20px;
    left: 24px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 100px;
}

.tm-rating {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
}

.tm-star {
    font-size: 1.125rem;
    color: rgba(251, 191, 36, 0.25);
    transition: transform 0.3s ease;
}

.tm-star.filled {
    color: #FBBF24;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.tm-slide.is-active .tm-star.filled {
    animation: tmStarPop 0.4s ease backwards;
}
.tm-slide.is-active .tm-star.filled:nth-child(1) { animation-delay: 0.1s; }
.tm-slide.is-active .tm-star.filled:nth-child(2) { animation-delay: 0.15s; }
.tm-slide.is-active .tm-star.filled:nth-child(3) { animation-delay: 0.2s; }
.tm-slide.is-active .tm-star.filled:nth-child(4) { animation-delay: 0.25s; }
.tm-slide.is-active .tm-star.filled:nth-child(5) { animation-delay: 0.3s; }

@keyframes tmStarPop {
    from { transform: scale(0) rotate(-30deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

.tm-review {
    margin: 0 0 36px;
    padding: 0;
    border: none;
}

.tm-review p {
    font-size: clamp(1.125rem, 2.5vw, 1.375rem);
    font-weight: 500;
    line-height: 1.7;
    color: var(--text);
    font-style: italic;
    margin: 0;
}

.tm-author {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-top: 28px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

[data-theme="light"] .tm-author { border-top-color: rgba(0,0,0,0.06); }

.tm-avatar-wrap { position: relative; flex-shrink: 0; }

.tm-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(37, 99, 235, 0.3);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.2);
}

.tm-avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563EB, #7C3AED);
    color: #fff;
    font-weight: 800;
    font-size: 1.5rem;
}

.tm-play-btn {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    border: 3px solid var(--bg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.tm-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.tm-author-name { font-weight: 700; font-size: 1.0625rem; color: var(--text); }
.tm-author-role { font-size: 0.875rem; color: var(--muted); margin-top: 2px; }
.tm-author-country {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--muted);
    margin-top: 4px;
    opacity: 0.8;
}

/* Controls */
.tm-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 36px;
}

.tm-nav {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
}

[data-theme="light"] .tm-nav {
    background: #fff;
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.tm-nav:hover {
    background: #2563EB;
    border-color: #2563EB;
    color: #fff;
    transform: scale(1.05);
}

.tm-progress-wrap { flex: 1; max-width: 280px; }

.tm-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.tm-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

[data-theme="light"] .tm-dot { background: rgba(0,0,0,0.12); }

.tm-dot.active {
    background: #2563EB;
    width: 28px;
    border-radius: 4px;
}

.tm-progress {
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
}

[data-theme="light"] .tm-progress { background: rgba(0,0,0,0.06); }

.tm-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2563EB, #8B5CF6);
    border-radius: 2px;
    transition: width 0.1s linear;
}

/* Video Modal */
.tm-video-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.tm-video-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.tm-video-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
}

.tm-video-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    z-index: 1;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.tm-video-modal.is-open .tm-video-content { transform: scale(1); }

.tm-video-close {
    position: absolute;
    top: -48px;
    right: 0;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.tm-video-close:hover { background: rgba(255,255,255,0.2); }

.tm-video-player {
    position: relative;
    padding-bottom: 56.25%;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}

.tm-video-player iframe,
.tm-video-player video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive */
@media (max-width: 768px) {
    .tm-section { padding: 72px 0 88px; }
    .tm-card { padding: 36px 28px 32px; }
    .tm-trust-bar { gap: 20px; padding: 12px 24px; flex-wrap: wrap; justify-content: center; }
    .tm-trust-divider { display: none; }
    .tm-review p { font-size: 1.0625rem; }
    .tm-nav { width: 44px; height: 44px; }
    .tm-controls { gap: 16px; }
}

@media (max-width: 480px) {
    .tm-author { flex-direction: column; text-align: center; }
    .tm-featured-badge { position: static; display: inline-block; margin-bottom: 16px; }
    .tm-quote-icon { display: none; }
    .tm-section { padding: 56px 0 72px; }
    .tm-card { padding: 28px 20px 24px; }
    .tm-header { margin-bottom: 36px; }
    .tm-trust-bar { border-radius: 16px; gap: 16px; padding: 16px; width: 100%; }
    .tm-trust-item { flex: 1 1 40%; min-width: 80px; }
}

@media (max-width: 360px) {
    .tm-review p { font-size: 1rem; }
    .tm-controls { flex-wrap: wrap; justify-content: center; }
}
