/**
 * Testimonial Carousel Styles with Drag/Swipe Support
 */

.testimonials-slider {
    position: relative;
    padding: 20px 20px; /* Add top/bottom padding for hover effect */
    margin: -20px -20px; /* Negative margin to compensate */
    overflow: visible; /* Allow cards to extend beyond container */
}

.testimonials-track {
    display: flex;
    gap: 32px;
    transition: transform 0.5s ease-in-out;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.testimonials-track:active {
    cursor: grabbing;
}

.testimonial-card {
    flex: 0 0 auto;
    width: calc((100% - 64px) / 3);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(0, 0, 0, 0.06),
        0 16px 40px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    min-height: 200px;
    max-height: 280px;
}

.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.05) 50%,
        rgba(13, 148, 137, 0.02) 100%);
    border-radius: 24px;
    pointer-events: none;
    z-index: -1;
}

.testimonial-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.8) 50%, 
        transparent 100%);
    pointer-events: none;
}

.testimonial-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.06),
        0 12px 32px rgba(0, 0, 0, 0.08),
        0 24px 64px rgba(13, 148, 137, 0.12),
        0 32px 80px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(13, 148, 137, 0.4);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    z-index: 10;
}

.testimonial-card:hover::before {
    background: linear-gradient(135deg, 
        rgba(13, 148, 137, 0.08) 0%, 
        rgba(255, 255, 255, 0.2) 30%,
        rgba(255, 255, 255, 0.1) 70%,
        rgba(13, 148, 137, 0.05) 100%);
}

.testimonial-card:hover::after {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(13, 148, 137, 0.6) 50%, 
        transparent 100%);
    height: 2px;
}

/* Glassmorphism shimmer effect */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.testimonial-card:hover {
    overflow: hidden;
}

.testimonial-card:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    animation: shimmer 2s ease-in-out;
    pointer-events: none;
    z-index: 1;
}

.testimonial-card.modern {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    box-shadow: 
        0 3px 10px rgba(0, 0, 0, 0.05),
        0 10px 28px rgba(0, 0, 0, 0.07),
        0 20px 48px rgba(0, 0, 0, 0.09),
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(255, 255, 255, 0.15);
}

.testimonial-card.modern::before {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0.08) 50%,
        rgba(13, 148, 137, 0.03) 100%);
}

.testimonial-card .card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.testimonial-card .author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #CCF1EE;
}

.testimonial-card .author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.testimonial-card .author-info-top {
    flex: 1;
}

.testimonial-card .author-name {
    font-size: 18px;
    font-weight: 700;
    color: #0F172A;
    margin: 0 0 4px 0;
}

.testimonial-card .author-role {
    font-size: 14px;
    color: #64748B;
    margin: 0 0 8px 0;
}

.testimonial-card .testimonial-rating {
    display: flex;
    gap: 4px;
}

.testimonial-card .testimonial-rating .star {
    font-size: 16px;
}

.testimonial-card .testimonial-text {
    font-size: 16px;
    line-height: 1.7;
    color: #475569;
    margin: 0 0 20px 0;
    font-style: italic;
}

.testimonial-card .card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.testimonial-card .verified-badge {
    display: none; /* Hide verified badge */
}

/* Testimonials Section */
.testimonials-section {
    padding-top: 100px !important; /* Extra padding for hover effect */
    padding-bottom: 100px !important;
}

/* Dots Navigation */
.testimonials-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
}

.testimonials-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #CBD5E1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.testimonials-dots .dot.active {
    background: #0D9489;
    transform: scale(1.2);
}

.testimonials-dots .dot:hover {
    background: #0D9489;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 991px) {
    .testimonial-card {
        width: calc((100% - 32px) / 2);
    }
}

/* MOBILE LAYOUT - FORCE OVERRIDE */
@media (max-width: 768px) {
    .testimonials-slider {
        padding: 20px 0 !important;
        margin: -20px 0 !important;
    }
    
    .testimonials-track {
        gap: 16px !important;
        padding: 0 20px !important;
    }
    
    .testimonial-card {
        width: calc(100vw - 80px) !important;
        max-width: 350px !important;
        padding: 20px !important;
        margin: 0 !important;
        min-height: auto !important;
        max-height: none !important;
    }
    
    /* FORCE HORIZONTAL LAYOUT - AVATAR LEFT, INFO RIGHT */
    .testimonial-card .card-header {
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 16px !important;
        margin-bottom: 16px !important;
        text-align: left !important;
    }
    
    .testimonial-card .author-avatar {
        width: 56px !important;
        height: 56px !important;
        flex-shrink: 0 !important;
        align-self: flex-start !important;
    }
    
    .testimonial-card .author-info-top {
        flex: 1 !important;
        text-align: left !important;
    }
    
    .testimonial-card .author-name {
        font-size: 16px !important;
        margin-bottom: 4px !important;
        text-align: left !important;
    }
    
    .testimonial-card .author-role {
        font-size: 13px !important;
        margin-bottom: 8px !important;
        text-align: left !important;
    }
    
    .testimonial-card .testimonial-rating {
        justify-content: flex-start !important;
        text-align: left !important;
    }
    
    .testimonial-card .testimonial-text {
        font-size: 15px !important;
        margin-bottom: 0 !important;
        line-height: 1.6 !important;
        text-align: left !important;
        margin-top: 16px !important;
    }
    
    /* Disable hover effects on mobile */
    .testimonial-card:hover {
        transform: none !important;
    }
}

@media (max-width: 480px) {
    .testimonials-track {
        padding: 0 16px; /* Reduce padding on small screens */
    }
    
    .testimonial-card {
        width: calc(100vw - 64px); /* Adjust for smaller screens */
        max-width: 320px;
        padding: 18px;
    }
    
    .testimonial-card .author-avatar {
        width: 52px;
        height: 52px;
    }
    
    .testimonial-card .author-name {
        font-size: 15px;
    }
    
    .testimonial-card .author-role {
        font-size: 12px;
    }
    
    .testimonial-card .testimonial-text {
        font-size: 14px;
    }
    
    .testimonial-card .testimonial-rating .star {
        font-size: 14px;
    }
}

/* Disable drag/swipe animations on mobile optimization */
@media (max-width: 768px) {
    .mobile-optimized .testimonials-track {
        transition: transform 0.3s ease !important;
    }
    
    .scrolling-mobile .testimonials-track {
        transition: none !important;
    }
    
    /* FORCE MOBILE LAYOUT - HIGHEST PRIORITY */
    .testimonials-section .testimonial-card .card-header {
        flex-direction: row !important;
        text-align: left !important;
    }
    
    .testimonials-section .testimonial-card .author-avatar {
        align-self: flex-start !important;
    }
    
    .testimonials-section .testimonial-card .author-info-top {
        text-align: left !important;
    }
    
    .testimonials-section .testimonial-card .testimonial-rating {
        justify-content: flex-start !important;
    }
}

/* Mobile centering and touch optimizations */
@media (max-width: 768px) {
    .testimonials-track {
        justify-content: flex-start; /* Allow proper scrolling */
    }
    
    .testimonial-card {
        flex-shrink: 0; /* Prevent shrinking */
        scroll-snap-align: center; /* Snap to center when scrolling */
    }
    
    /* Center the first card on load */
    .testimonials-track .testimonial-card:first-child {
        margin-left: calc((100vw - 100%) / 2);
    }
    
    /* Add margin to last card for proper scrolling */
    .testimonials-track .testimonial-card:last-child {
        margin-right: calc((100vw - 100%) / 2);
    }
}

/* Touch device optimizations */
.touch-device .testimonials-track {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.touch-device .testimonial-card:hover {
    transform: none;
}

.touch-device .testimonial-card:active {
    transform: scale(0.98);
}

/* Prevent text selection during drag */
.testimonials-track * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Loading state */
.testimonials-track.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Smooth transitions */
.testimonials-track:not(.dragging) {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.testimonials-track.dragging {
    transition: none;
}