/* Testimonial Section Styles */
.testimonial-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 40px 30px;
    position: relative;
}

.testimonial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.header-text {
    flex: 1;
}

.testimonial-header h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #2c3e50;
    position: relative;
    display: inline-block;
}

.testimonial-header h2:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: #3498db;
    border-radius: 2px;
}

.testimonial-header p {
    color: #7f8c8d;
    font-size: 18px;
    margin-top: 15px;
}

/* Header Controls */
.header-controls {
    display: flex;
    gap: 10px;
}

.carousel-control1 {
    display: inline-flex;
    width: 50px;
    height: 50px;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #3498db;
    border-radius: 50%;
    border: 2px solid #3498db;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    opacity: 1;
    text-shadow: none;
    position: inherit!important;
}

.carousel-control1:hover {
    background: #3498db;
    color: #fff;
    text-decoration: none;
    transform: scale(1.1);
    opacity: 1;
}

.carousel-control1.left, 
.carousel-control1.right {
    background-image: none;
}

/* Testimonial Carousel - Specific to testimonial section only */
#testimonialCarouselDesktop.carousel,
#testimonialCarouselMobile.carousel {
    position: relative;
}

#testimonialCarouselDesktop .carousel-inner,
#testimonialCarouselMobile .carousel-inner {
    overflow: hidden;
    width: 100%;
    position: relative;
}

#testimonialCarouselDesktop .item,
#testimonialCarouselMobile .item {
    display: none;
    position: relative;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#testimonialCarouselDesktop .item.active,
#testimonialCarouselMobile .item.active {
    display: block;
    left: 0;
}

#testimonialCarouselDesktop .item.next,
#testimonialCarouselDesktop .item.prev,
#testimonialCarouselMobile .item.next,
#testimonialCarouselMobile .item.prev {
    display: block;
    position: absolute;
    width: 100%;
    top: 0;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#testimonialCarouselDesktop .item.next,
#testimonialCarouselMobile .item.next {
    left: 100%;
}

#testimonialCarouselDesktop .item.prev,
#testimonialCarouselMobile .item.prev {
    left: -100%;
}

#testimonialCarouselDesktop .item.active.left,
#testimonialCarouselMobile .item.active.left {
    left: -100%;
    transform: translate3d(-100%, 0, 0);
}

#testimonialCarouselDesktop .item.active.right,
#testimonialCarouselMobile .item.active.right {
    left: 100%;
    transform: translate3d(100%, 0, 0);
}

#testimonialCarouselDesktop .item.next.left,
#testimonialCarouselDesktop .item.prev.right,
#testimonialCarouselMobile .item.next.left,
#testimonialCarouselMobile .item.prev.right {
    left: 0;
    transform: translate3d(0, 0, 0);
}

/* Smooth transitions for modern browsers */
@media (prefers-reduced-motion: no-preference) {
    #testimonialCarouselDesktop .carousel-inner,
    #testimonialCarouselMobile .carousel-inner {
        perspective: 1000px;
    }
    
    #testimonialCarouselDesktop .item,
    #testimonialCarouselMobile .item {
        transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.8s ease;
        backface-visibility: hidden;
    }
}

/* Testimonial Items */
.testimonial-item {
    background: #fff;
    padding: 35px 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    min-height: 400px; /* Ensure minimum height for consistency */
}

.testimonial-item:before {
    content: ''';
    position: absolute;
    top: 15px;
    right: 30px;
    font-size: 90px;
    color: #3498db;
    opacity: 0.1;
    font-family: Arial;
    line-height: 1;
}

.testimonial-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.testimonial-img-container {
    position: relative;
    margin: 0 auto 20px;
    width: 110px;
    height: 110px;
    flex-shrink: 0;
}

.testimonial-item img {
    width: 100px;
    height: 100px!important;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.initials-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 40px;
    font-weight: 700;
    border: 3px solid #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.client-info {
    margin-bottom: 20px;
    flex-shrink: 0;
}

.testimonial-item h4 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
}

.testimonial-item .trip-name {
    display: block;
    font-size: 16px;
    color: #3498db;
    font-weight: 500;
}

.testimonial-content {
    position: relative;
    margin-bottom: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.testimonial-text {
    font-size: 17px;
    line-height: 1.7;
    color: #555;
    position: relative;
    padding: 0 10px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    flex-grow: 1;
    display: block;
    overflow: visible;
}

.testimonial-text.short {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-link {
    display: inline-block;
    color: #3498db;
    background: none;
    border: none;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    padding: 5px 0;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-top: auto;
    
}

.read-more-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

.testimonial-item .stars {
    margin-top: 20px;
    color: #ffc107;
    font-size: 18px;
    flex-shrink: 0;
}

/* Testimonial Carousel indicators */
#testimonialCarouselDesktop .carousel-indicators,
#testimonialCarouselMobile .carousel-indicators {
    bottom: -60px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: center;
    width: auto;
    z-index: 15;
}

#testimonialCarouselDesktop .carousel-indicators li,
#testimonialCarouselMobile .carousel-indicators li {
    background-color: #bdc3c7;
    border: none;
    width: 14px;
    height: 14px;
    margin: 0 6px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: inline-block;
    cursor: pointer;
    text-indent: -999px;
    overflow: hidden;
}

#testimonialCarouselDesktop .carousel-indicators .active,
#testimonialCarouselMobile .carousel-indicators .active {
    background-color: #3498db;
    width: 14px;
    height: 14px;
    transform: scale(1.2);
}

/* Testimonial Carousel row and columns */
#testimonialCarouselDesktop .carousel-inner .row,
#testimonialCarouselMobile .carousel-inner .row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}

#testimonialCarouselDesktop .carousel-inner .row > [class*="col-"],
#testimonialCarouselMobile .carousel-inner .row > [class*="col-"] {
    padding-left: 15px;
    padding-right: 15px;
    margin-bottom: 0;
    float: left;
}

/* Desktop Carousel - 3 testimonials per slide */
#testimonialCarouselDesktop {
    display: block;
}

#testimonialCarouselMobile {
    display: none;
}

/* Desktop - 3 columns */
#testimonialCarouselDesktop .carousel-inner .row > .col-md-4 {
    width: 33.33333333%;
}

/* Tablet - 2 columns */
@media (min-width: 768px) and (max-width: 991px) {
    #testimonialCarouselDesktop .carousel-inner .row > .col-sm-6 {
        width: 50%;
    }
}

/* Mobile - 1 column */
#testimonialCarouselDesktop .carousel-inner .row > .col-xs-12,
#testimonialCarouselMobile .carousel-inner .row > .col-xs-12 {
    width: 100%;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .testimonial-section {
        max-width: 1140px;
    }
}

@media (max-width: 992px) {
    .testimonial-section {
        max-width: 960px;
        padding: 30px 15px;
    }
    
    .testimonial-item {
        padding: 25px 20px;
        min-height: 380px;
    }
}

/* MOBILE FIXES - COMPLETELY REVISED */
@media (max-width: 767px) {
    .testimonial-section {
        padding: 20px 15px;
        margin: 20px auto;
    }
    
    .testimonial-header {
        flex-direction: column;
        text-align: center;
        margin-bottom: 30px;
    }
    
    .testimonial-header h2 {
        font-size: 28px;
    }
    
    .testimonial-header h2:after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .testimonial-header p {
        font-size: 16px;
    }
    
    .header-controls {
        margin-top: 20px;
        display: none;
    }
    
    /* COMPLETE REDESIGN FOR MOBILE HEIGHT */
    .testimonial-item {
        margin-bottom: 0;
        padding: 30px 25px;
        height: auto !important;
        min-height: auto !important;
        display: block;
        flex-direction: row;
        justify-content: flex-start;
        align-items: flex-start;
    }
    
    .testimonial-img-container {
        width: 100px;
        height: 100px;
        margin: 0 auto 20px;
    }
    
    .initials-avatar {
        font-size: 32px;
    }
    
    .testimonial-item h4 {
        font-size: 20px;
        margin-bottom: 6px;
    }
    
    .testimonial-item .trip-name {
        font-size: 16px;
        margin-bottom: 20px;
    }
    
    .testimonial-content {
        margin-bottom: 20px;
        flex-grow: 0;
        display: block;
        justify-content: flex-start;
    }
    
    .testimonial-text {
        font-size: 16px;
        display: block;
        -webkit-line-clamp: unset;
        -webkit-box-orient: unset;
        overflow: visible;
        line-height: 1.7;
        margin-bottom: 20px;
        flex-grow: 0;
        padding: 0;
        text-align: left;
    }
    
    .testimonial-text.short {
        display: block;
        -webkit-line-clamp: unset;
        -webkit-box-orient: unset;
        overflow: visible;
    }
    
    .carousel-control1 {
        width: 40px;
        height: 40px;
    }
    
    .read-more-link {
        font-size: 15px;
        margin: 15px 0 10px 0;
        align-self: flex-start;
    }
    
    .testimonial-item .stars {
        font-size: 18px;
        margin: 20px 0 10px 0;
        text-align: center;
    }
    
    .client-info {
        margin-bottom: 25px;
    }
    
    /* Switch to mobile carousel on small screens */
    #testimonialCarouselDesktop {
        display: none;
    }
    
    #testimonialCarouselMobile {
        display: block;
    }
    
    /* Mobile carousel container fixes */
    #testimonialCarouselMobile .carousel-inner {
        height: auto !important;
    }
    
    #testimonialCarouselMobile .item {
        height: auto !important;
        min-height: auto !important;
    }
    
    #testimonialCarouselMobile .carousel-inner .row {
        margin-left: 0;
        margin-right: 0;
        height: auto !important;
    }
    
    #testimonialCarouselMobile .carousel-inner .row > [class*="col-"] {
        padding-left: 0;
        padding-right: 0;
        height: auto !important;
        margin-bottom: 30px;
    }
    
    /* Better mobile indicators */
    #testimonialCarouselMobile .carousel-indicators {
        bottom: -40px;
    }
    
    #testimonialCarouselMobile .carousel-indicators li {
        width: 12px;
        height: 12px;
        margin: 0 4px;
    }
    
    #testimonialCarouselMobile .carousel-indicators .active {
        width: 12px;
        height: 12px;
    }
    
    /* Ensure proper spacing between mobile items */
    #testimonialCarouselMobile .item.active {
        padding-bottom: 20px;
    }
}

/* Additional testimonial detail styles */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #4cc9f0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --text-color: #495057;
    --border-radius: 16px;
    --transition: all 0.3s ease;
}

.section-titleTesti {
    font-weight: 700;
    color: var(--dark-color);
    font-size: 2.8rem;
    margin: 3rem 0;
    text-align: center;
}

.section-subtitleTesti {
    font-size: 1.6rem;
    color: var(--text-color);
    max-width: 700px;
    margin: 0 auto 6rem;
    opacity: 0.8;
    text-align: center;
}

.trip-card {
    overflow: hidden;
    margin-bottom: 3rem;
}

.trip-image {
    height: 100%;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    position: relative;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    display: flex;
    align-items: flex-end;
    padding: 30px;
}

.trip-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.3) 100%);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    z-index: 1;
}

.image-content {
    position: relative;
    z-index: 2;
    color: white;
}

.image-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.trip-content {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.trip-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    font-size: 2.2rem;
    line-height: 1.2;
}

.rating {
    color: #ffc107;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rating i {
    font-size: 1.6rem;
}

.rating-text {
    color: var(--text-color);
    font-weight: 500;
    font-size: 1.4rem;
}

.trip-description {
    margin-bottom: 2rem;
    color: var(--text-color);
    font-size: 1.05rem;
    line-height: 1.7;
}

.user-info {
    display: flex;
    align-items: center;
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.4rem;
    margin-right: 20px;
}

.user-details {
    margin-bottom: 0.3rem;
}

.user-name {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 1.6rem;
    margin-bottom: 0.6rem;
}

.user-country {
    color: var(--primary-color);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Responsive adjustments for testimonial details */
@media (max-width: 992px) {
    .trip-image {
        min-height: 350px;
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }
    
    .trip-image::after {
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }
    
    .trip-content {
        padding: 2rem;
    }
    
    .trip-title {
        font-size: 2rem;
    }
    
    .section-titleTesti {
        font-size: 2.4rem;
    }
}

@media (max-width: 768px) {
    .trip-image {
        min-height: 300px;
        padding: 20px;
    }
    
    .image-title {
        font-size: 1.8rem;
    }
    
    .trip-content {
        padding: 1.5rem;
    }
    
    .section-titleTesti {
        font-size: 2rem;
    }
    
    .section-subtitleTesti {
        font-size: 1.1rem;
    }
    
    .trip-description {
        font-size: 1rem;
        line-height: 1.6;
    }
}

/* Enhanced smooth transitions */
#testimonialCarouselDesktop .carousel-inner,
#testimonialCarouselMobile .carousel-inner {
    transition: transform 0.6s ease-in-out;
}

/* Professional mobile touch enhancements */
@media (max-width: 767px) {
    #testimonialCarouselMobile .carousel-inner {
        touch-action: pan-y pinch-zoom;
    }
    
    .testimonial-item {
        box-shadow: 0 8px 25px rgba(0,0,0,0.12);
        border: 1px solid rgba(0,0,0,0.08);
    }
    
    /* Ensure content is fully visible */
    .testimonial-item * {
        max-height: none !important;
        height: auto !important;
    }
}

/* Force full height display on mobile */
@media (max-width: 767px) {
    #testimonialCarouselMobile .carousel-inner,
    #testimonialCarouselMobile .item,
    #testimonialCarouselMobile .testimonial-item {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
    }
    
    .testimonial-item {
        overflow: visible;
    }
}