/* testimonials.css - Enhanced Version with Mobile Single Card Carousel */

.testimonials-section {
    padding: var(--section-padding);
    position: relative;
    overflow: hidden;
    /* Solid background color as requested */
    background: #111827 !important;
    background-attachment: scroll !important;
}

/* SOPHISTICATED: Subtle, intricate line texture */
.testimonials-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    /* Sophisticated subtle line pattern */
    background-image:
        /* Fine diagonal grid */
        repeating-linear-gradient(45deg,
            transparent,
            transparent 80px,
            rgba(96, 165, 250, 0.08) 80px,
            rgba(96, 165, 250, 0.08) 81px),
        repeating-linear-gradient(-45deg,
            transparent,
            transparent 80px,
            rgba(167, 139, 250, 0.06) 80px,
            rgba(167, 139, 250, 0.06) 81px),
        /* Subtle horizontal accent lines */
        repeating-linear-gradient(0deg,
            transparent,
            transparent 120px,
            rgba(245, 240, 232, 0.04) 120px,
            rgba(245, 240, 232, 0.04) 121px),
        /* Very fine vertical lines */
        repeating-linear-gradient(90deg,
            transparent,
            transparent 100px,
            rgba(96, 165, 250, 0.03) 100px,
            rgba(96, 165, 250, 0.03) 101px);
    opacity: 1;
}

/* Additional override for any inherited backgrounds */
#testimonials.testimonials-section,
section.testimonials-section,
.testimonials-section {
    background-color: #111827 !important;
    background: #111827 !important;
}

.testimonials-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    z-index: 2;
}

/* Update section header colors for dark background */
.testimonials-section .section-tag {
    color: #F5F0E8 !important;
    text-shadow: none !important;
}

.testimonials-section .section-title {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.testimonials-section .section-title .highlight {
    background: linear-gradient(135deg, #F5F0E8, #E8DDD4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: none !important;
}

.testimonials-section .section-description {
    color: #e2e8f0 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
}

/* Desktop/Tablet: 3x2 Grid Layout with Equal Heights */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 25px;
    padding: 20px 0;
    min-height: 400px;
    transition: var(--transition-smooth);
    align-items: stretch;
}

/* Mobile Carousel Container */
.testimonials-carousel {
    display: none; /* Hidden by default, shown on mobile */
    position: relative;
    overflow: hidden;
    padding: 20px 0;
    touch-action: pan-y; /* Allow vertical scrolling but handle horizontal touch */
}

.testimonials-track {
    display: flex;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 20px;
}

/* Enhanced Testimonial Card with Subtle Noise Texture - REDUCED GLOW */
.testimonial-card {
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(20px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(120%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px;
    padding: 20px 20px 25px 20px;
    display: flex;
    gap: 15px;
    position: relative;
    transition: var(--transition-smooth);
    cursor: pointer;
    min-height: 160px;
    height: auto;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    animation: slideInUp 0.5s ease forwards;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    z-index: 2;
    /* Add subtle noise texture */
    background-image:
        /* Very subtle noise pattern */
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        radial-gradient(circle at 70% 80%, rgba(0, 0, 0, 0.015) 1px, transparent 1px),
        radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.01) 1px, transparent 1px),
        /* Subtle grain texture */
        repeating-conic-gradient(from 0deg at 50% 50%, transparent 0deg, rgba(255, 255, 255, 0.008) 1deg, transparent 2deg) !important;
    background-size:
        30px 30px,
        25px 25px,
        35px 35px,
        8px 8px !important;
    background-position:
        0 0,
        15px 15px,
        10px 20px,
        0 0 !important;
}

.testimonial-card:nth-child(1) { animation-delay: 0.1s; }
.testimonial-card:nth-child(2) { animation-delay: 0.2s; }
.testimonial-card:nth-child(3) { animation-delay: 0.3s; }
.testimonial-card:nth-child(4) { animation-delay: 0.4s; }
.testimonial-card:nth-child(5) { animation-delay: 0.5s; }
.testimonial-card:nth-child(6) { animation-delay: 0.6s; }

.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.08),
        rgba(244, 114, 182, 0.06),
        rgba(245, 240, 232, 0.04)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
}

.testimonial-card:hover {
    transform: translateY(-12px) scale(1.03);
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(25px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(140%) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    /* Slightly more visible noise on hover */
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 70% 80%, rgba(0, 0, 0, 0.02) 1px, transparent 1px),
        radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        repeating-conic-gradient(from 0deg at 50% 50%, transparent 0deg, rgba(255, 255, 255, 0.012) 1deg, transparent 2deg) !important;
}

.testimonial-card:hover::before {
    opacity: 1;
}

/* Left Side - Photo */
.client-photo {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    position: relative;
}

.client-avatar {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    background: rgba(241, 245, 249, 0.8);
}

.client-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.testimonial-card:hover .client-avatar {
    border-color: rgba(245, 240, 232, 0.5);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.testimonial-card:hover .client-avatar img {
    transform: scale(1.05);
}

/* Right Side - Content */
.testimonial-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

/* Client Info Header */
.client-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.client-info {
    flex: 1;
    min-width: 0;
}

.client-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff !important;
    margin-bottom: 2px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-info .position {
    font-size: 12px;
    color: #e2e8f0 !important;
    opacity: 0.9;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Rating Stars - REMOVED GLOW */
.rating {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.rating i {
    font-size: 12px;
    color: #F5F0E8 !important;
    text-shadow: none !important;
    transition: var(--transition-smooth);
}

.testimonial-card:hover .rating i {
    transform: scale(1.1);
    text-shadow: none !important;
}

/* Testimonial Quote */
.testimonial-quote {
    flex: 1;
    position: relative;
    margin-bottom: 8px;
}

.testimonial-quote p {
    font-size: 13px;
    line-height: 1.5;
    color: #f1f5f9 !important;
    opacity: 0.95;
    font-style: italic;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    margin: 0;
    position: relative;
}

.testimonial-card .quote-mark {
    position: absolute !important;
    left: -12px !important;
    top: -8px !important;
    font-size: 24px !important;
    color: #f1f5f9 !important;
    opacity: 0.8 !important;
    font-family: Georgia, serif !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
    pointer-events: none !important;
}

/* Even stronger override for stubborn styles */
.testimonials-section .testimonial-card .testimonial-quote .quote-mark {
    color: #f1f5f9 !important;
    background: none !important;
    -webkit-text-fill-color: #f1f5f9 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

/* Force override any hover effects that turn text black - REMOVED GLOW */
.testimonial-card:hover .quote-mark {
    color: #ffffff !important; /* Brighter on hover */
    text-shadow: none !important;
}

.testimonial-card:hover .testimonial-quote p {
    color: #ffffff !important; /* Brighter quote text on hover */
    text-shadow: none !important;
}

.testimonial-card:hover .testimonial-quote p::after {
    color: #ffffff !important; /* Brighter closing quote on hover */
    text-shadow: none !important;
}

.testimonial-card:hover .client-info h4 {
    color: #ffffff !important; /* Brighter name on hover */
    text-shadow: none !important;
}

.testimonial-card:hover .client-info .position {
    color: #f8fafc !important; /* Brighter position on hover */
    text-shadow: none !important;
}

/* Fix heading hover - change gold to white, no glow */
.testimonials-section .section-title:hover {
    color: #ffffff !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #ffffff !important;
    background-clip: unset !important;
    text-shadow: none !important;
    filter: none !important;
}

.testimonials-section .section-title .highlight:hover {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #ffffff !important;
    background-clip: unset !important;
    color: #ffffff !important;
    filter: none !important;
    text-shadow: none !important;
}

.testimonial-quote p::after {
    content: '"';
    font-size: 24px;
    color: #f1f5f9 !important; /* Same as the quote text color */
    opacity: 0.8;
    font-family: Georgia, serif;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    font-style: normal;
    margin-left: 2px;
}

/* Enhanced Footer with Better Separated Project Type Badge - REDUCED GLOW */
.testimonial-footer {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    margin-top: auto;
    padding-top: 12px;
    padding-bottom: 8px; /* Increased space for badge */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.project-type {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #1e293b !important; /* Dark text for contrast */
    background: linear-gradient(135deg,
        rgba(245, 240, 232, 0.9),
        rgba(232, 221, 212, 0.8)
    ) !important;
    padding: 8px 16px;
    border-radius: 16px;
    font-weight: 700;
    border: 2px solid rgba(245, 240, 232, 0.8) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    position: absolute;
    left: -30px; /* More separation from card */
    bottom: -15px; /* Further down for better separation */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(-2px);
    z-index: 3; /* Higher z-index */
}

.testimonial-card:hover .project-type {
    transform: translateY(-8px) scale(1.1);
    border-color: rgba(245, 240, 232, 1) !important;
    background: linear-gradient(135deg,
        rgba(245, 240, 232, 0.95),
        rgba(232, 221, 212, 0.9)
    ) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    color: #1e293b !important; /* Keep dark text for contrast */
}

/* Navigation Styles - Updated for dark background - REDUCED GLOW */
.testimonials-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    margin-top: 35px;
    position: relative;
}

.nav-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #F5F0E8 !important;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-size: 16px;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    text-shadow: none !important;
    border-color: rgba(245, 240, 232, 0.3);
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.testimonials-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 2px solid transparent;
}

.dot.active {
    background: #F5F0E8;
    box-shadow: none !important;
    border-color: rgba(245, 240, 232, 0.2);
}

.dot:hover {
    background: rgba(245, 240, 232, 0.7);
    transform: scale(1.3);
}

/* Auto-play Toggle Styles - FIXED TO BEIGE */
.autoplay-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    position: absolute;
    top: -50px;
    right: 0;
    font-size: 12px;
    color: #e2e8f0 !important;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 45px;
    height: 24px;
    cursor: pointer;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(245, 240, 232, 0.2) !important;
    transition: 0.3s ease;
    border-radius: 24px;
    border: 1px solid rgba(245, 240, 232, 0.3) !important;
    backdrop-filter: blur(10px);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2px;
    background-color: #F5F0E8 !important;
    transition: 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: rgba(245, 240, 232, 0.4) !important;
    border-color: rgba(245, 240, 232, 0.5) !important;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: #F5F0E8 !important;
}

/* Swipe Progress Indicator for Mobile */
.swipe-indicator {
    display: none;
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: rgba(245, 240, 232, 0.6);
    text-align: center;
    opacity: 0.7;
    font-weight: 500;
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.testimonial-card.fade-in {
    animation: fadeInScale 0.4s ease forwards;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 20px;
        min-height: 500px;
    }

    .testimonial-card {
        min-height: 140px;
        padding: 18px 18px 23px 18px;
        border-radius: 10px;
    }

    .client-photo {
        width: 60px;
        height: 60px;
    }

    .project-type {
        padding: 6px 12px;
        font-size: 10px;
        left: -28px;
        bottom: -10px;
    }
}

/* Mobile - Single Card Carousel */
@media (max-width: 768px) {
    .testimonials-section {
        padding: 60px 0;
    }

    /* Hide grid, show carousel */
    .testimonials-grid {
        display: none !important;
    }

    .testimonials-carousel {
        display: block !important;
        padding: 20px 0;
        margin: 0;
        width: 100%;
        overflow: hidden;
        position: relative;
    }

    .testimonials-track {
        display: flex;
        align-items: stretch;
        gap: 0;
        /* Each card takes exactly 100% of container width */
        width: calc(100% * 12); /* Total width for all 12 cards */
    }

    .testimonial-card {
        flex: none;
        /* Each card takes exactly 100% of the carousel container width */
        width: calc(100% / 12); /* Exactly 1/12 of total track width */
        min-height: 180px;
        padding: 20px;
        gap: 15px;
        border-radius: 12px;
        margin: 0;
        box-sizing: border-box;
        display: flex;

        /* Add internal container for spacing */
        position: relative;

        /* Remove hover effects on mobile */
        transform: none !important;
    }

    /* Create inner container for proper spacing */
    .testimonial-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 20px; /* Left spacing */
        right: 20px; /* Right spacing */
        bottom: 0;
        background: rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(20px) saturate(120%);
        -webkit-backdrop-filter: blur(20px) saturate(120%);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        z-index: -1;

        /* Add subtle noise texture */
        background-image:
            radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
            radial-gradient(circle at 70% 80%, rgba(0, 0, 0, 0.015) 1px, transparent 1px),
            radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.01) 1px, transparent 1px),
            repeating-conic-gradient(from 0deg at 50% 50%, transparent 0deg, rgba(255, 255, 255, 0.008) 1deg, transparent 2deg);
        background-size: 30px 30px, 25px 25px, 35px 35px, 8px 8px;
        background-position: 0 0, 15px 15px, 10px 20px, 0 0;
    }

    /* Remove the original background from the card since it's now on ::before */
    .testimonial-card {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        box-shadow: none !important;
        background-image: none !important;
    }

    /* Adjust content positioning to account for inner spacing */
    .testimonial-card > * {
        position: relative;
        z-index: 1;
    }


    .testimonial-card:hover {
        transform: none !important;
        background: rgba(255, 255, 255, 0.08) !important;
        border-color: rgba(255, 255, 255, 0.15) !important;
        backdrop-filter: blur(20px) saturate(120%) !important;
        -webkit-backdrop-filter: blur(20px) saturate(120%) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }

    .client-photo {
        width: 65px; /* Slightly larger photo on mobile */
        height: 65px;
    }

    .client-avatar {
        border-radius: 8px;
    }

    .client-info h4 {
        font-size: 16px; /* Larger name text */
        margin-bottom: 4px; /* More space below name */
    }

    .client-info .position {
        font-size: 13px; /* Larger position text */
        line-height: 1.3;
    }

    .testimonial-quote {
        margin-bottom: 12px; /* More space below quote */
    }

    .testimonial-quote p {
        font-size: 14px; /* Larger quote text */
        line-height: 1.6; /* Better line spacing */
        margin: 8px 0; /* Vertical margins for quote */
    }

    .rating i {
        font-size: 12px; /* Slightly larger stars */
    }

    .project-type {
        padding: 8px 14px; /* More generous badge padding */
        font-size: 10px;
        left: -18px;
        bottom: -14px;
        border-radius: 12px;
    }

    /* Update navigation for mobile */
    .testimonials-navigation {
        gap: 20px;
        margin-top: 30px;
    }

    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .dot {
        width: 8px;
        height: 8px;
    }

    .autoplay-toggle-wrapper {
        top: -45px;
        font-size: 11px;
    }

    .toggle-switch {
        width: 40px;
        height: 20px;
    }

    .toggle-slider:before {
        height: 16px;
        width: 16px;
        left: 2px;
        bottom: 1px;
    }

    .toggle-switch input:checked + .toggle-slider:before {
        transform: translateX(18px);
    }

    /* Show swipe indicator */
    .swipe-indicator {
        display: block;
    }

    /* Remove hover effects on mobile cards */
    .testimonial-card:hover .client-avatar,
    .testimonial-card:hover .client-avatar img,
    .testimonial-card:hover .rating i,
    .testimonial-card:hover .project-type {
        transform: none !important;
    }
}

@media (max-width: 480px) {
    .testimonials-carousel {
        padding: 20px 0; /* Remove horizontal padding */
    }

    .testimonial-card {
        padding: 18px; /* Uniform padding */
        min-height: 160px;
        gap: 12px;
        border-radius: 10px;
    }

    /* Adjust inner spacing for smaller screens */
    .testimonial-card::before {
        left: 15px; /* Smaller left spacing */
        right: 15px; /* Smaller right spacing */
        border-radius: 10px;
    }


    .client-photo {
        width: 55px;
        height: 55px;
    }

    .client-info h4 {
        font-size: 14px;
    }

    .client-info .position {
        font-size: 11px;
    }

    .testimonial-quote p {
        font-size: 12px;
        line-height: 1.4;
    }

    .project-type {
        font-size: 8px;
        padding: 5px 10px;
        left: -18px;
        bottom: -10px;
        border-radius: 10px;
    }

    .testimonials-navigation {
        gap: 15px;
        margin-top: 25px;
    }

    .nav-btn {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
}