/* ================================================================
   TESTIMONIAL CARD STACK - Solid Rectangular Design
   ================================================================ */

/* Stack Container */
.testimonial-card-stack-container {
    position: relative;
    width: 420px;
    height: 420px;
    /* Proper Square shape */
    margin: 0 auto;
    left: 60px;
    /* Shifted right for separation */
    perspective: 1500px;
}

/* Individual Card */
.testimonial-card-stack-item {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;

    /* Solid color matching reference (Purple) */
    background: transparent;
    /* Background handled by pseudo-element mask */

    /* Clean border handled by mask/glow but we want a visible edge too */
    /* Add a subtle physical border that sits on top/around */
    border: 1px solid rgba(255, 255, 255, 0.1);

    /* Clean border handled by mask/glow */
    border-radius: 24px;

    /* Soft shadow for separation */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);

    padding: 40px 32px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;

    /* Spring-like transition */
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* 3D transform setup */
    transform-style: preserve-3d;
    transform-origin: center center;
    /* FIX: Hide the rotating corners that stick out */
    overflow: hidden;
}

.testimonial-card-stack-item:active {
    cursor: grabbing;
}

/* ================================================================
   ROTATING EDGE GLOW EFFECT - Dual Beam on Top Card Only
   ================================================================ */

/* Glow Layer (Only on Top Card) */
.testimonial-card-stack-item.stack-top::before {
    content: '';
    position: absolute;
    /* Make it huge so it covers the whole rotation area smoothly */
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;

    background: conic-gradient(from 0deg,
            transparent 0deg,
            transparent 80deg,
            rgba(255, 255, 255, 1) 100deg,
            transparent 120deg,
            transparent 260deg,
            rgba(255, 255, 255, 1) 280deg,
            transparent 300deg,
            transparent 360deg);

    /* Center rotation */
    transform-origin: center;
    z-index: -2;
    animation: rotateGlow 4s linear infinite;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Ensure no glow on background cards */
.testimonial-card-stack-item:not(.stack-top)::before {
    content: '';
    position: absolute;
    inset: -2px;
    /* Just a border placeholder */
    background: transparent;
    z-index: -2;
    opacity: 0;
    /* Add a subtle solid border for back cards so they aren't invisible */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
}

/* Inner masking - Solid Card Background */
.testimonial-card-stack-item::after {
    content: '';
    position: absolute;
    /* Thin border width (2px) by inset */
    inset: 2px;
    background: #5B5D9E;
    /* Match card color */
    border-radius: 22px;
    /* Slightly smaller than parent (24px) */
    z-index: -1;
}

@keyframes rotateGlow {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}



/* Card Content */
.testimonial-card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    color: #ffffff;
}

/* Rating Stars */
.testimonial-rating {
    font-size: 20px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
    letter-spacing: 3px;
    filter: drop-shadow(0 2px 4px rgba(255, 193, 7, 0.3));
}

/* Testimonial Text */
.testimonial-text {
    font-size: 18px;
    line-height: 1.6;
    margin: 0 0 auto 0;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.98);
    letter-spacing: 0.3px;
}

/* Author Info */
.testimonial-author {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1.5px solid rgba(255, 255, 255, 0.15);
}

.testimonial-author-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.testimonial-author-info strong {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.testimonial-author-info span {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}

/* ================================================================
   PARTICLE SHAPE ANIMATION CANVAS
   ================================================================ */


.testimonial-particle-canvas {
    position: absolute;
    left: -500px;
    /* Shifted more to right for better positioning */
    top: 50%;
    transform: translateY(-50%);
    width: 1000px;
    /* Massive canvas to prevent clipping */
    height: 1000px;
    /* Massive canvas to prevent clipping */
    pointer-events: none;
    z-index: 1;
    /* Layer above card background (0) but below content (2) */
}

/* Hide on mobile/tablet */
@media (max-width: 1024px) {
    .testimonial-particle-canvas {
        display: none;
    }
}

/* Navigation Arrows - Below Card, Centered */
.testimonial-navigation {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 32px;
    position: relative;
    left: 60px;
    /* Aligned with card stack */
}

.nav-arrow {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nav-arrow svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.nav-arrow:active {
    transform: scale(0.95);
}

/* ================================================================
   MOBILE RESPONSIVE
   ================================================================ */

@media (max-width: 768px) {
    .testimonial-card-stack-container {
        width: 320px;
        height: 320px;
        /* Square Mobile */
    }

    .testimonial-card-stack-item {
        padding: 32px 24px;
    }

    .testimonial-text {
        font-size: 15px;
    }

    /* Larger touch target on mobile */
    .testimonial-card-stack-item.stack-top {
        cursor: pointer;
    }
}

@media (max-width: 480px) {
    .testimonial-card-stack-container {
        width: 280px;
        height: 280px;
        /* Square Small Mobile */
    }

    .testimonial-card-stack-item {
        padding: 24px 20px;
    }

    .testimonial-text {
        font-size: 14px;
    }
}

/* ================================================================
   ANIMATION PRESETS
   ================================================================ */

/* Card entrance animation */
@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.testimonial-card-stack-item {
    animation: cardEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

/* Stagger animation delays */
.testimonial-card-stack-item:nth-child(1) {
    animation-delay: 0.1s;
}

.testimonial-card-stack-item:nth-child(2) {
    animation-delay: 0.2s;
}

.testimonial-card-stack-item:nth-child(3) {
    animation-delay: 0.3s;
}

.testimonial-card-stack-item:nth-child(4) {
    animation-delay: 0.4s;
}

/* ================================================================
   ACCESSIBILITY
   ================================================================ */

/* Focus styles for keyboard navigation */
.testimonial-card-stack-item.stack-top:focus-visible {
    outline: 2px solid #8B5CF6;
    outline-offset: 4px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .testimonial-card-stack-item {
        transition: none;
        animation: none;
    }
}