/* ===================================
   Premium Testimonial Cards Design
   Modern, Interactive & Engaging
   =================================== */

/* Testimonial Section Styling */
section:has(.grid-3 > .card[style*="border-left: 4px solid"]) {
    position: relative;
    overflow: hidden;
}

/* Enhanced Testimonial Card Base */
.card[style*="border-left: 4px solid"] {
    background: linear-gradient(135deg, #ffffff 0%, #FAFAFF 100%);
    border-radius: 28px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.08);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 5px solid #9B7EDE !important;
    transform-style: preserve-3d;
}

/* Decorative Quote Mark */
.card[style*="border-left: 4px solid"]::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 20px;
    font-size: 120px;
    font-family: Georgia, serif;
    color: rgba(155, 126, 222, 0.08);
    line-height: 1;
    pointer-events: none;
    transition: all 0.5s ease;
    z-index: 0;
}

/* Animated Gradient Border */
.card[style*="border-left: 4px solid"]::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 28px;
    background: linear-gradient(135deg, #9B7EDE, #C4B5FD, #7C3AED, #A78BFA);
    background-size: 400% 400%;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.6s ease;
    animation: gradientFlow 8s ease infinite;
}

@keyframes gradientFlow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Hover State - Enhanced */
.card[style*="border-left: 4px solid"]:hover {
    transform: translateY(-16px) scale(1.03) rotateX(2deg);
    box-shadow:
        0 25px 60px rgba(124, 58, 237, 0.25),
        0 0 0 1px rgba(155, 126, 222, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 80px rgba(155, 126, 222, 0.15);
    background: linear-gradient(135deg, #ffffff 0%, #F5F3FF 100%);
    border-left-color: #7C3AED !important;
    border-left-width: 6px !important;
}

.card[style*="border-left: 4px solid"]:hover::after {
    opacity: 1;
}

.card[style*="border-left: 4px solid"]:hover::before {
    color: rgba(155, 126, 222, 0.15);
    transform: scale(1.1) rotate(-5deg);
    top: -25px;
}

/* Star Rating Container */
.card[style*="border-left: 4px solid"]>div:first-child {
    position: relative;
    z-index: 1;
    font-size: 1.5rem;
    letter-spacing: 4px;
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 193, 7, 0.08) 100%);
    border-radius: 50px;
    transition: all 0.4s ease;
}

/* Star Animation on Hover */
.card[style*="border-left: 4px solid"]:hover>div:first-child {
    transform: scale(1.15);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 193, 7, 0.15) 100%);
    box-shadow: 0 8px 24px rgba(255, 193, 7, 0.3);
}

/* Individual Star Animation */
.card[style*="border-left: 4px solid"]:hover>div:first-child::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: starPulse 1.5s ease-in-out infinite;
    border-radius: 50%;
    pointer-events: none;
}

@keyframes starPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
    }
}

/* Testimonial Text (Italic Paragraph) */
.card[style*="border-left: 4px solid"] p[style*="italic"] {
    position: relative;
    z-index: 1;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #4C4773;
    margin-bottom: 1.5rem;
    transition: all 0.4s ease;
}

.card[style*="border-left: 4px solid"]:hover p[style*="italic"] {
    color: #1E1B4B;
    transform: translateX(4px);
}

/* Client Name (Purple Text) */
.card[style*="border-left: 4px solid"] div[style*="color: var(--color-primary)"] {
    position: relative;
    z-index: 1;
    font-weight: 700;
    font-size: 1.125rem;
    background: linear-gradient(135deg, #9B7EDE 0%, #7C3AED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
    transition: all 0.4s ease;
    display: inline-block;
}

.card[style*="border-left: 4px solid"]:hover div[style*="color: var(--color-primary)"] {
    transform: translateX(6px);
    background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Position/Title Text */
.card[style*="border-left: 4px solid"] div[style*="font-size: 0.875rem"] {
    position: relative;
    z-index: 1;
    color: #6B7280;
    font-size: 0.95rem;
    transition: all 0.4s ease;
}

.card[style*="border-left: 4px solid"]:hover div[style*="font-size: 0.875rem"] {
    color: #9B7EDE;
    transform: translateX(6px);
}

/* Shimmer Effect on Hover */
.card[style*="border-left: 4px solid"] .shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transform: skewX(-25deg);
    transition: left 0.8s ease;
    pointer-events: none;
    z-index: 10;
}

.card[style*="border-left: 4px solid"]:hover .shimmer {
    left: 150%;
}

/* Floating Glow Effect */
.card[style*="border-left: 4px solid"] .glow-orb {
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(155, 126, 222, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
    z-index: 0;
}

.card[style*="border-left: 4px solid"]:hover .glow-orb {
    opacity: 1;
    animation: floatGlow 4s ease-in-out infinite;
}

@keyframes floatGlow {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(20px, -20px) scale(1.2);
    }
}

/* Staggered Entrance Animation */
.card[style*="border-left: 4px solid"].reveal-animation {
    animation: fadeSlideUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
}

.card[style*="border-left: 4px solid"].reveal-animation:nth-child(1) {
    animation-delay: 0.1s;
}

.card[style*="border-left: 4px solid"].reveal-animation:nth-child(2) {
    animation-delay: 0.3s;
}

.card[style*="border-left: 4px solid"].reveal-animation:nth-child(3) {
    animation-delay: 0.5s;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

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

/* Ripple Effect on Click */
.testimonial-ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(155, 126, 222, 0.4) 0%, transparent 70%);
    pointer-events: none;
    animation: rippleExpand 0.8s ease-out forwards;
}

@keyframes rippleExpand {
    from {
        transform: scale(0);
        opacity: 1;
    }

    to {
        transform: scale(3);
        opacity: 0;
    }
}

/* Curved Left Border Accent Enhancement */
.card[style*="border-left: 4px solid"] {
    border-left-style: solid !important;
    position: relative;
}

/* Add vertical gradient on left border area */
.card[style*="border-left: 4px solid"] .border-gradient {
    position: absolute;
    left: -5px;
    top: 20%;
    width: 5px;
    height: 60%;
    background: linear-gradient(180deg, transparent 0%, #7C3AED 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: 3px;
}

.card[style*="border-left: 4px solid"]:hover .border-gradient {
    opacity: 1;
    animation: borderPulse 2s ease-in-out infinite;
}

@keyframes borderPulse {

    0%,
    100% {
        transform: scaleY(1);
        opacity: 0.7;
    }

    50% {
        transform: scaleY(1.2);
        opacity: 1;
    }
}

/* Confetti Effect (Optional - can be triggered via JS) */
.confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #FFD700, #FFC107);
    pointer-events: none;
    opacity: 0;
}

.card[style*="border-left: 4px solid"]:hover .confetti {
    animation: confettiFall 2s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(-20px) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: translateY(100px) rotate(360deg);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .card[style*="border-left: 4px solid"] {
        padding: 2rem;
        border-radius: 20px;
    }

    .card[style*="border-left: 4px solid"]:hover {
        transform: translateY(-12px) scale(1.02);
    }

    .card[style*="border-left: 4px solid"]::before {
        font-size: 80px;
        top: -10px;
    }
}

/* Accessibility - Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    .card[style*="border-left: 4px solid"],
    .card[style*="border-left: 4px solid"] * {
        animation: none !important;
        transition: none !important;
    }

    .card[style*="border-left: 4px solid"]:hover {
        transform: translateY(-4px);
    }
}

/* Premium Glow on Active/Focus */
.card[style*="border-left: 4px solid"]:active,
.card[style*="border-left: 4px solid"]:focus-within {
    outline: none;
    box-shadow:
        0 30px 70px rgba(124, 58, 237, 0.3),
        0 0 0 3px rgba(155, 126, 222, 0.3);
}

/* Section Header Enhancement for Testimonials */
.section-header:has(+ .grid-3 > .card[style*="border-left: 4px solid"]) h2 {
    position: relative;
    display: inline-block;
}

.section-header:has(+ .grid-3 > .card[style*="border-left: 4px solid"]) h2::after {
    content: '★';
    position: absolute;
    right: -40px;
    top: 50%;
    transform: translateY(-50%);
    color: #FFD700;
    font-size: 1.5rem;
    opacity: 0;
    transition: all 0.4s ease;
}

.section-header:has(+ .grid-3 > .card[style*="border-left: 4px solid"]):hover h2::after {
    opacity: 1;
    right: -50px;
    animation: starTwinkle 1.5s ease-in-out infinite;
}

@keyframes starTwinkle {

    0%,
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    50% {
        opacity: 0.5;
        transform: translateY(-50%) scale(1.2);
    }
}

/* Testimonial Grid Enhancement */
.grid-3:has(> .card[style*="border-left: 4px solid"]) {
    position: relative;
    z-index: 1;
}