/* ============================================================
   OpsTree Client Stories — Orbital Testimonial Slider
   ------------------------------------------------------------
   Changes from original:
   • Orbit + counter-rotate animations paused when off-screen
     (was: running 24/7 even when scrolled away or tab hidden)
   • setInterval auto-advance pauses when off-screen (handled in JS)
   • Pre-built orbs (no innerHTML rebuild every 6s)
   • Respects prefers-reduced-motion
   ============================================================ */

#ts-premium {
    --ts-purple: #A033FF;
    --ts-cyan:   #2BD4FF;
    --ts-bg:     #FFFFFF;
    --ts-text:   #0B1535;
    --ts-mute:   #8E9AAF;
    --ts-border: rgba(160, 51, 255, 0.08);

    font-family: sans-serif;
    color: var(--ts-text);
    background: var(--ts-bg);
    border-radius: 32px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

#ts-premium *  { box-sizing: border-box; margin: 0; padding: 0; }

/* Ambient glow */
#ts-premium::before {
    content: "";
    position: absolute;
    top: -10%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(43, 212, 255, 0.04) 0%, transparent 70%);
    filter: blur(80px);
    z-index: 1;
    pointer-events: none;
}

.ts-grid {
    display: grid;
    grid-template-columns: 520px 1fr;
    gap: 60px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 60px;
    position: relative;
    z-index: 2;
}

/* Orbit */
.ts-circle-col {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 500px;
}

.ts-orbit-wrap {
    position: relative;
    width: 440px;
    height: 440px;
}

.ts-orbit-ring {
    position: absolute;
    width: 330px;
    height: 330px;
    border-radius: 50%;
    border: 1px solid transparent;
    background: linear-gradient(var(--ts-bg), var(--ts-bg)) padding-box,
                linear-gradient(135deg, rgba(160, 51, 255, 0.15), rgba(43, 212, 255, 0.15)) border-box;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.01);
}

.ts-orbit-rotating {
    position: absolute;
    inset: 0;
    transform-origin: center;
    animation: tsSpin 28s linear infinite;
    animation-play-state: paused;
    z-index: 3;
}

.ts-orb-inner {
    width: 100%;
    height: 100%;
    animation: tsCounter 28s linear infinite;
    animation-play-state: paused;
}

/* Animations only run when section is in view (JS toggles this class) */
#ts-premium.is-in-view .ts-orbit-rotating,
#ts-premium.is-in-view .ts-orb-inner { animation-play-state: running; }

@keyframes tsSpin    { to { transform: rotate(360deg); } }
@keyframes tsCounter { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }

/* Comet dot */
.ts-pulse-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--ts-cyan);
    border-radius: 50%;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 15px var(--ts-cyan);
}

/* Logo orbs */
.ts-orb {
    position: absolute;
    width: 72px;
    height: 72px;
    cursor: pointer;
    z-index: 5;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.ts-orb-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #FFF;
    border: 1px solid #EEE;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: 0.4s;
}

.ts-orb-img img {
    max-width: 70%;
    max-height: 70%;
    opacity: 0.85;
    filter: none;
    transition: 0.3s ease;
}

.ts-orb:hover .ts-orb-img img {
    opacity: 1;
    transform: scale(1.1);
}

.ts-orb.ts-on { width: 92px; height: 92px; }
.ts-orb.ts-on .ts-orb-img {
    border-color: var(--ts-purple);
    border-width: 2px;
    box-shadow: 0 10px 30px rgba(160, 51, 255, 0.15);
}
.ts-orb.ts-on .ts-orb-img img { opacity: 1; transform: scale(1.05); }

/* Center vessel */
#ts-center {
    position: absolute;
    width: 175px;
    height: 175px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 1px solid #F8F9FA;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.06);
}
#ts-center img {
    max-width: 65%;
    max-height: 65%;
    object-fit: contain;
}

/* Content */
.ts-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ts-purple);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 25px;
}
.ts-label::before {
    content: "";
    width: 24px;
    height: 2px;
    background: var(--ts-purple);
    opacity: 0.3;
}

.ts-qtext {
    font-family: serif;
    font-size: 26px;
    font-style: italic;
    margin-bottom: 35px;
    line-height: 1.5;
    min-height: 140px;
    color: #1F2937;
}

.ts-qname {
    font-weight: 800;
    font-size: 22px;
    color: var(--ts-text);
}

.ts-qrole {
    font-size: 13px;
    color: var(--ts-mute);
    margin-top: 4px;
    font-weight: 500;
}

/* Controls */
.ts-controls {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-top: 50px;
}

.ts-arrow {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid #EEE;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.ts-arrow:hover {
    border-color: var(--ts-purple);
    transform: translateY(-2px);
}

.ts-arrow-next {
    background: var(--ts-purple);
    border: none;
    color: white;
    box-shadow: 0 10px 20px rgba(160, 51, 255, 0.2);
}

.ts-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.ts-counter {
    font-size: 16px;
    font-weight: 500;
    color: var(--ts-mute);
}

.ts-cur {
    color: var(--ts-purple);
    font-weight: 800;
}

.ts-bar {
    height: 3px;
    background: #F1F5F9;
    border-radius: 10px;
    flex: 1;
    max-width: 200px;
    overflow: hidden;
}

.ts-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ts-purple), var(--ts-cyan));
    width: 0%;
    transition: width 6000ms linear;
}

@media (max-width: 980px) {
    .ts-grid {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 60px 20px;
    }
    .ts-circle-col {
        transform: scale(0.8);
        height: 380px;
    }
    .ts-label { justify-content: center; }
    .ts-controls { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .ts-orbit-rotating,
    .ts-orb-inner { animation: none !important; }
}