/* Testimonials Carousel Styles - Simplified Structure */
.testimonial-carousel {
    position: relative;
    margin: 0 auto;
    max-width: 1200px;
    padding: 20px 60px; /* Add padding for navigation buttons */
    overflow: hidden; /* Critical: Hide testimonials that slide outside the container */
}

.testimonial-carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    /* Ensure track is wide enough to contain all testimonials */
    width: max-content;
}

/* Individual testimonial cards in carousel */
.testimonial-carousel .testimonial-card {
    flex: 0 0 auto;
    width: 350px; /* Fixed width for narrow, tall cards */
    max-width: 350px;
    padding: 0 5px; /* 5px padding on each side */
    opacity: 1;
    transition: opacity 0.3s ease;
    box-sizing: border-box;
}

/* Testimonial card content wrapper - Main styling container */
.testimonial-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 3rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    min-height: 350px;
    position: relative;
}

/* Clean hover effect - enhanced shadow for lift, no gold border */
.testimonial-card:hover .testimonial-content {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

/* Testimonial text section */
.testimonial-content .testimonial-text {
    flex: 1;
    margin-bottom: 2rem;
    line-height: 1.8;
    color: var(--text-primary);
    font-size: var(--font-size-lg);
}

/* Author section */
.testimonial-content .testimonial-author {
    margin-bottom: 1.5rem;
}

.testimonial-content .author-info h4 {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    line-height: 1.4;
}

.testimonial-content .author-info p {
    margin: 0;
    line-height: 1.4;
}

.testimonial-content .author-info .author-title {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

.testimonial-content .author-info .author-company {
    font-size: var(--font-size-base);
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

/* Rating stars at bottom */
.testimonial-content .testimonial-rating {
    color: var(--gold-primary);
    font-size: var(--font-size-lg);
    display: flex;
    gap: 0.25rem;
    justify-content: flex-start;
    align-items: center;
    margin-top: auto;
}

.testimonial-content .testimonial-rating i {
    display: inline-flex;
}

/* Circular Navigation Buttons - Positioned absolutely */
.testimonial-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--gold-primary);
    color: var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.testimonial-nav-btn.testimonial-prev {
    left: 0;
}

.testimonial-nav-btn.testimonial-next {
    right: 0;
}

.testimonial-nav-btn:hover:not(:disabled) {
    background: var(--gold-primary);
    color: var(--bg-primary);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.testimonial-nav-btn:active:not(:disabled) {
    transform: translateY(-50%) scale(0.95);
}

.testimonial-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border-secondary);
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .testimonial-carousel .testimonial-card {
        flex: 0 0 auto;
        width: 45%; /* Adjusted width for tablet */
        max-width: 400px;
    }
    
    .testimonial-nav-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .testimonial-carousel {
        padding: 20px 50px; /* Reduce padding on mobile */
    }
    
    .testimonial-carousel .testimonial-card {
        flex: 0 0 auto;
        width: calc(100% - 2rem); /* Full width minus padding */
        max-width: 100%;
        padding: 0 0.5rem;
    }
    
    /* Reduce min-height for mobile to prevent cards being too tall */
    .testimonial-content {
        min-height: 280px; /* Reduced from 350px */
        padding: 2rem;
    }
    
    /* Adjust text sizes for mobile */
    .testimonial-content .testimonial-text {
        font-size: var(--font-size-base);
        margin-bottom: 1.5rem;
    }
    
    .testimonial-content .author-info h4 {
        font-size: var(--font-size-base);
    }
    
    .testimonial-content .author-info p {
        font-size: var(--font-size-sm);
    }
    
    .testimonial-content .testimonial-rating {
        font-size: var(--font-size-base);
    }
    
    .testimonial-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .testimonial-carousel {
        padding: 20px 40px; /* Further reduce padding */
    }
    
    .testimonial-content {
        min-height: 260px; /* Further reduced height */
        padding: 1.5rem;
    }
    
    .testimonial-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .testimonial-nav-btn.testimonial-prev {
        left: -5px;
    }
    
    .testimonial-nav-btn.testimonial-next {
        right: -5px;
    }
}

/* Ensure submit testimonial section has proper spacing */
.testimonials .text-center.mt-5 {
    margin-top: 5rem !important;
}

/* Animation for testimonial transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.testimonial-card {
    animation: fadeIn 0.5s ease-out;
}

/* Fix for proper height alignment */
.testimonial-carousel {
    min-height: 320px;
}

/* Keyboard focus styles */
.testimonial-nav-btn:focus {
    outline: 3px solid var(--gold-primary);
    outline-offset: 2px;
}

/* Touch-friendly tap targets on mobile */
@media (pointer: coarse) {
    .testimonial-nav-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Grid layout for non-carousel testimonials */
.testimonials .testimonial-grid .testimonial-card {
    background: transparent;
    border: none;
    padding: 0;
}

.testimonials .testimonial-grid .testimonial-content {
    /* Keep the same clean styling for grid layout */
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Apply same hover effect to grid layout - no gold border */
.testimonials .testimonial-grid .testimonial-card:hover .testimonial-content {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}
