/* ============================================
   Testimonial Flip Slider - v2.0
   Matches reference: stacked vertical layout,
   avatar overlapping top-left, right side arrows
============================================ */

/* ── Wrapper: 3-column grid ─────────────────── */
.tfs-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 0;
    position: relative;
}

/* ── LEFT: Dots (vertical stack) ────────────── */
.tfs-dots-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 0 6px;
    align-self: center;
}

.tfs-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1d5db;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.25s, transform 0.25s;
    display: block;
}

.tfs-dot.tfs-dot-on {
    background: #3b82c4;
    transform: scale(1.35);
}

.tfs-dot:hover:not(.tfs-dot-on) {
    background: #9ca3af;
}

/* ── CENTER: Slides Area ─────────────────────── */
.tfs-slides-area {
    flex: 1;
    position: relative;
    min-height: 260px;
}

/* ── Each Slide ───────────────────────────────── */
.tfs-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease, transform 0.45s ease;
    transform: translateY(20px);
    display: flex;
    flex-direction: column;
}

.tfs-slide.tfs-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    position: relative; /* active takes up space */
}

/* Inactive "peek" below active — like reference image */
.tfs-slide.tfs-peek {
    opacity: 1;
    pointer-events: none;
    transform: translateY(0);
    position: absolute;
    top: auto;
    bottom: -52px;
    left: 60px; /* offset right to match reference */
    width: calc(100% - 60px);
    z-index: 0;
}

/* ── Avatar (outside card, overlapping top-left) */
.tfs-avatar-wrap {
    position: relative;
    z-index: 3;
    width: 70px;
    height: 0; /* no height - overlaps card */
    margin-bottom: 0;
}

.tfs-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    display: block;
    position: relative;
    top: 0;
}

/* Active slide avatar is offset to overlap */
.tfs-slide.tfs-active .tfs-avatar {
    top: 0;
}

/* Peek slide: hide avatar */
.tfs-slide.tfs-peek .tfs-avatar-wrap {
    display: none;
}

/* ── Flip Card ───────────────────────────────── */
.tfs-flip-card {
    perspective: 1200px;
    z-index: 2;
    position: relative;
    margin-top: -35px; /* avatar overlaps into card */
}

.tfs-flip-inner {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 14px;
}

/* Flip state */
.tfs-slide.tfs-flipped .tfs-flip-inner {
    transform: rotateY(180deg);
}

/* ── Card Front ──────────────────────────────── */
.tfs-card-front {
    background: #3b82c4;
    border-radius: 14px;
    padding: 44px 22px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 200px;
    box-sizing: border-box;
    position: relative;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Inactive slide front */
.tfs-slide.tfs-peek .tfs-card-front {
    background: #e8edf2;
    padding: 18px 22px;
    min-height: 80px;
}

/* ── Front Body ──────────────────────────────── */
.tfs-front-body {
    flex: 1;
}

.tfs-review-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: #ffffff;
}

.tfs-slide.tfs-peek .tfs-review-text {
    display: none; /* hide full text in peek */
}

/* ── Front Footer ────────────────────────────── */
.tfs-front-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
}

.tfs-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tfs-name {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.tfs-date {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
}

.tfs-slide.tfs-peek .tfs-name {
    color: #374151;
    font-size: 14px;
}
.tfs-slide.tfs-peek .tfs-date {
    color: #9ca3af;
}

/* ── Stars ───────────────────────────────────── */
.tfs-stars {
    display: flex;
    gap: 2px;
    align-items: center;
}

.tfs-star {
    font-size: 15px;
    line-height: 1;
}
.tfs-star.on  { color: #fbbf24; }
.tfs-star.off { color: rgba(255,255,255,0.3); }

.tfs-slide.tfs-peek .tfs-stars {
    display: none;
}

/* ── Flip Button ─────────────────────────────── */
.tfs-flip-btn {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 13px;
    padding: 0;
    transition: background 0.2s;
}
.tfs-flip-btn:hover { background: rgba(255,255,255,0.35); }

/* ── Card Back ───────────────────────────────── */
.tfs-card-back {
    position: absolute;
    inset: 0;
    background: #1d4ed8;
    border-radius: 14px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.tfs-back-inner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.tfs-back-icon {
    font-size: 28px;
    color: rgba(255,255,255,0.55);
}

.tfs-back-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
}

.tfs-back-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
    color: rgba(255,255,255,0.88);
}

.tfs-flip-back {
    position: absolute;
    bottom: 14px;
    right: 14px;
}

/* ── RIGHT: Arrows (vertical stack) ─────────── */
.tfs-arrows-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding: 0 6px;
    align-self: center;
}

.tfs-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #3b82c4;
    background: transparent;
    color: #3b82c4;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.tfs-arrow:hover {
    background: #3b82c4;
    color: #ffffff;
}

.tfs-arrow:disabled, .tfs-arrow.tfs-disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

/* ── Hover flip for active slide ─────────────── */
.tfs-wrapper[data-flip="hover"] .tfs-slide.tfs-active:hover .tfs-flip-inner {
    transform: rotateY(180deg);
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 600px) {
    .tfs-avatar { width: 55px; height: 55px; }
    .tfs-flip-card { margin-top: -28px; }
    .tfs-card-front { padding: 36px 16px 18px 16px; }
    .tfs-review-text { font-size: 14px; }
    .tfs-arrow { width: 30px; height: 30px; }
    .tfs-dots-wrap { gap: 6px; }
    .tfs-slide.tfs-peek { left: 40px; width: calc(100% - 40px); bottom: -44px; }
}

/* ── Editor: disable hover flip ─────────────── */
.elementor-editor-active .tfs-flip-inner {
    transform: none !important;
}
