/* Gallery Carousel Styles */
.gallery-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 0 20px;
}

.gallery-header .title5 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 2.8rem;
    color: #333;
    letter-spacing: 0.5px;
    position: relative;
    display: inline-block;
}

.gallery-header .title5::after {
    content: "";
    position: absolute;
    width: 40px;
    height: 4px;
    background: linear-gradient(to right, #7661b6, #2db797);
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
}

.gallery-header .header-line {
    width: 120px;
    height: 3px;
    background: linear-gradient(to right, #7661b6, #2db797);
    margin: 1.2rem auto 1.8rem;
    opacity: 0.7;
}

.gallery-header .gallery-subtitle {
    font-size: 1.2rem;
    color: #555;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
    font-weight: 300;
}

.gallery-carousel-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    margin-bottom: 30px;
    background: #000;
    aspect-ratio: 16/9;
    transform: translateZ(0); /* Hardware acceleration */
}

.gallery-carousel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.3);
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
}

.gallery-carousel-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
}

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s ease;
    display: flex;
    /* align-items: center; */
    justify-content: center;
    transform: scale(1.05);
    will-change: opacity, transform;
}

.carousel-item.active {
    opacity: 1;
    z-index: 1;
    transform: scale(1);
}

.gallery-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s ease;
}

.gallery-carousel:hover .gallery-image {
    transform: scale(1.01);
}

.gallery-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(0.9);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #333;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0.85;
}

.gallery-carousel:hover .gallery-control {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.gallery-control:hover {
    background: white;
    color: #7661b6;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.gallery-control:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(118, 97, 182, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
}

.gallery-prev {
    left: 25px;
}

.gallery-next {
    right: 25px;
}

.gallery-thumbnails {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    justify-content: flex-start;
    margin-bottom: 25px;
    padding: 0 15px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(118, 97, 182, 0.6) rgba(0, 0, 0, 0.1);
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    white-space: nowrap;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(118, 97, 182, 0.6);
    border-radius: 10px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
    background: rgba(118, 97, 182, 0.8);
}

.gallery-thumbnail {
    width: 70px;
    height: 50px;
    flex: 0 0 auto;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.gallery-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.gallery-thumbnail:hover::after {
    opacity: 0;
}

.gallery-thumbnail.active {
    border-color: #7661b6;
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(118, 97, 182, 0.25);
}

.gallery-thumbnail.active::after {
    opacity: 0;
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-thumbnail:hover img {
    transform: scale(1.15);
}

/* Responsive styles */
@media screen and (max-width: 1200px) {
    .gallery-carousel-container {
        max-width: 90%;
    }
}

@media screen and (max-width: 992px) {
    .gallery-header .title5 {
        font-size: 2.4rem;
    }
    
    .gallery-carousel {
        aspect-ratio: 5/3;
    }
    
    .gallery-thumbnail {
        width: 80px;
        height: 60px;
    }
}

@media screen and (max-width: 768px) {
    .gallery-header .title5 {
        font-size: 2.2rem;
    }
    
    .gallery-header .gallery-subtitle {
        font-size: 1.1rem;
    }
    
    .gallery-carousel {
        aspect-ratio: 4/3;
        border-radius: 10px;
    }
    
    .gallery-control {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .gallery-prev {
        left: 15px;
    }
    
    .gallery-next {
        right: 15px;
    }
    
    .gallery-thumbnail {
        width: 70px;
        height: 50px;
    }
    
    .gallery-indicators {
        gap: 8px;
    }
}

@media screen and (max-width: 576px) {
    .gallery-header {
        margin-bottom: 2rem;
    }
    
    .gallery-header .title5 {
        font-size: 1.9rem;
    }
    
    .gallery-header .gallery-subtitle {
        font-size: 1rem;
    }
    
    .gallery-carousel {
        aspect-ratio: 1/1;
        border-radius: 8px;
        margin-bottom: 20px;
    }
    
    .gallery-control {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .gallery-prev {
        left: 10px;
    }
    
    .gallery-next {
        right: 10px;
    }
    
    .gallery-thumbnails {
        gap: 8px;
        margin-bottom: 20px;
    }
    
    .gallery-thumbnail {
        width: 55px;
        height: 40px;
        border-width: 2px;
    }
    
    .indicator {
        width: 10px;
        height: 10px;
    }
    
    .indicator.active {
        width: 12px;
        height: 12px;
    }
}

@media screen and (max-width: 380px) {
    .gallery-thumbnail {
        width: 45px;
        height: 35px;
    }
    
    .gallery-control {
        width: 32px;
        height: 32px;
    }
}
