/* Image Gallery Styles - css/image-gallery.css */
.image-gallery {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0;
    height: 500px;
    overflow: hidden;
    border-radius: 0;
    /* box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15); */
    background: #002238;
    backdrop-filter: blur(10px);
}

.gallery-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.gallery-item {
    position: absolute;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    display: none;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

/* Show first item by default until JavaScript initializes */
.gallery-item:first-child {
    display: block;
    width: 500px;
    height: 380px;
    z-index: 10;
    filter: blur(0px);
    opacity: 1;
    transform: translateX(0) scale(1);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-item:hover {
    /* box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25); */
    border-color: rgba(255, 255, 255, 0.4);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 34, 56, 0.9));
    color: white;
    padding: 30px 20px 20px;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(10px);
}

.gallery-caption h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    /* text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); */
    color: white;
}

.gallery-caption p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    /* text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); */
    color: white;
}

.gallery-item.active .gallery-caption {
    opacity: 1;
    transform: translateY(0);
}

/* Main center image */
.gallery-item.active {
    width: 500px;
    height: 380px;
    z-index: 10;
    filter: blur(0px);
    opacity: 1;
    transform: translateX(0) scale(1);
    display: block;
    /* box-shadow: 0 15px 60px rgba(0, 0, 0, 0.25); */
}

/* Left side images */
.gallery-item.left-1 {
    width: 270px;
    height: 200px;
    z-index: 5;
    filter: blur(0.5px);
    opacity: 0.85;
    transform: translateX(-320px) scale(0.85);
    display: block;
}

.gallery-item.left-2 {
    width: 220px;
    height: 165px;
    z-index: 4;
    filter: blur(1px);
    opacity: 0.7;
    transform: translateX(-480px) scale(0.75);
    display: block;
}

.gallery-item.left-3 {
    width: 180px;
    height: 135px;
    z-index: 3;
    filter: blur(1.5px);
    opacity: 0.5;
    transform: translateX(-600px) scale(0.65);
    display: block;
}

/* Right side images */
.gallery-item.right-1 {
    width: 270px;
    height: 200px;
    z-index: 5;
    filter: blur(0.5px);
    opacity: 0.85;
    transform: translateX(320px) scale(0.85);
    display: block;
}

.gallery-item.right-2 {
    width: 220px;
    height: 165px;
    z-index: 4;
    filter: blur(1px);
    opacity: 0.7;
    transform: translateX(480px) scale(0.75);
    display: block;
}

.gallery-item.right-3 {
    width: 180px;
    height: 135px;
    z-index: 3;
    filter: blur(1.5px);
    opacity: 0.5;
    transform: translateX(600px) scale(0.65);
    display: block;
}

/* Navigation controls */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #002238;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(15px);
    /* box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15); */
    border: 2px solid rgba(255, 255, 255, 0.3);
    outline: none !important;
}

.gallery-nav:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    /* box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25); */
    border-color: rgba(255, 255, 255, 0.6);
    outline: none !important;
}

.gallery-nav:active {
    transform: translateY(-50%) scale(0.95);
    outline: none !important;
}

.gallery-nav:focus {
    outline: none !important;
    /* box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25), 0 0 0 3px rgba(255, 255, 255, 0.3); */
}

.gallery-nav.prev {
    left: 25px;
}

.gallery-nav.next {
    right: 25px;
}

/* Remove default content and use pseudo-elements */
.gallery-nav.prev,
.gallery-nav.next {
    font-size: 0;
}

.gallery-nav.prev::before,
.gallery-nav.next::before {
    font-size: 24px;
    font-weight: bold;
    display: block;
    line-height: 1;
}

/* Navigation icons - Simple and clear */
.gallery-nav.prev::before {
    content: "❮";
}

.gallery-nav.next::before {
    content: "❯";
}

/* RTL Support - Just reverse the arrows, keep positions */
[dir="rtl"] .gallery-nav.prev::before {
    content: "❯";
}

[dir="rtl"] .gallery-nav.next::before {
    content: "❮";
}

/* Indicators */
.gallery-indicators {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 20;
    padding: 12px 20px;
    background: rgba(0, 34, 56, 0.8);
    border-radius: 30px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15); */
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    border: none;
    padding: 0;
    position: relative;
    outline: none !important;
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
    outline: none !important;
}

.indicator:focus {
    outline: none !important;
    /* box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3); */
}

.indicator.active {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.4);
    /* box-shadow: 0 0 20px rgba(255, 255, 255, 0.6); */
}

.indicator.active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    z-index: -1;
}

/* Loading state */
.gallery-item.loading {
    background: #002238;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item.loading::after {
    content: '';
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* No images message */
.gallery-no-images {
    text-align: center;
    padding: 60px 40px;
    background: #002238;
    border-radius: 16px;
    margin: 20px 0;
    /* box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1); */
}

.gallery-no-images p {
    color: white;
    font-size: 18px;
    margin: 0;
    font-weight: 500;
}

/* Visual Composer Integration - Make gallery full width within stretched rows */
.vc_row[data-vc-stretch-content="true"] .image-gallery {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* For full width rows without stretch content */
.vc_row[data-vc-full-width="true"] .image-gallery {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* For stretch_row_content_no_spaces - this is what you're using */
.vc_row.vc_row-no-padding .image-gallery {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* Responsive design */
@media (max-width: 1024px) {
    .image-gallery {
        height: 400px;
    }
    
    /* Ensure full width on tablets for stretched rows */
    .vc_row[data-vc-stretch-content="true"] .image-gallery,
    .vc_row[data-vc-full-width="true"] .image-gallery,
    .vc_row.vc_row-no-padding .image-gallery {
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
    }
    
    .gallery-item.active {
        width: 400px;
        height: 300px;
    }
    
    .gallery-item.left-1,
    .gallery-item.right-1 {
        width: 220px;
        height: 165px;
        filter: blur(0.8px);
    }
    
    .gallery-item.left-1 {
        transform: translateX(-260px) scale(0.8);
    }
    
    .gallery-item.right-1 {
        transform: translateX(260px) scale(0.8);
    }
    
    .gallery-item.left-2,
    .gallery-item.right-2 {
        width: 180px;
        height: 135px;
        filter: blur(1.5px);
    }
    
    .gallery-item.left-2 {
        transform: translateX(-410px) scale(0.7);
    }
    
    .gallery-item.right-2 {
        transform: translateX(410px) scale(0.7);
    }
    
    .gallery-nav {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .gallery-nav.prev::before,
    .gallery-nav.next::before {
        font-size: 20px;
        line-height: 1;
    }
}

@media (max-width: 768px) {
    .image-gallery {
        height: 300px;
    }
    
    /* Ensure full width on mobile for stretched rows */
    .vc_row[data-vc-stretch-content="true"] .image-gallery,
    .vc_row[data-vc-full-width="true"] .image-gallery,
    .vc_row.vc_row-no-padding .image-gallery {
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
    }
    
    .gallery-item.active {
        width: 320px;
        height: 240px;
    }
    
    .gallery-item.left-1,
    .gallery-item.right-1 {
        width: 180px;
        height: 135px;
        filter: blur(1px);
    }
    
    .gallery-item.left-1 {
        transform: translateX(-210px) scale(0.75);
    }
    
    .gallery-item.right-1 {
        transform: translateX(210px) scale(0.75);
    }
    
    .gallery-item.left-2,
    .gallery-item.left-3,
    .gallery-item.right-2,
    .gallery-item.right-3 {
        display: none !important;
    }
    
    .gallery-nav {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .gallery-nav.prev::before,
    .gallery-nav.next::before {
        font-size: 18px;
        line-height: 1;
    }
    
    .gallery-nav.prev {
        left: 15px;
    }
    
    .gallery-nav.next {
        right: 15px;
    }
    
    .gallery-indicators {
        bottom: 25px;
        padding: 10px 16px;
        gap: 10px;
    }
    
    .indicator {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .image-gallery {
        height: 250px;
    }
    
    /* Ensure full width on small mobile for stretched rows */
    .vc_row[data-vc-stretch-content="true"] .image-gallery,
    .vc_row[data-vc-full-width="true"] .image-gallery,
    .vc_row.vc_row-no-padding .image-gallery {
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
    }
    
    .gallery-item.active {
        width: 260px;
        height: 195px;
    }
    
    .gallery-item.left-1,
    .gallery-item.right-1 {
        width: 140px;
        height: 105px;
        filter: blur(1px);
    }
    
    .gallery-item.left-1 {
        transform: translateX(-170px) scale(0.7);
    }
    
    .gallery-item.right-1 {
        transform: translateX(170px) scale(0.7);
    }
    
    .gallery-indicators {
        bottom: 20px;
        gap: 8px;
        padding: 8px 12px;
    }
    
    .indicator {
        width: 8px;
        height: 8px;
    }
    
    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .gallery-nav.prev::before,
    .gallery-nav.next::before {
        font-size: 16px;
        line-height: 1;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .image-gallery {
        background: #002238;
        /* box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); */
    }
    
    .gallery-container {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    }
    
    .gallery-item {
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .gallery-nav {
        background: rgba(255, 255, 255, 0.9);
        color: #002238;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .gallery-nav:hover {
        background: rgba(255, 255, 255, 1);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .gallery-indicators {
        background: rgba(0, 34, 56, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .gallery-item.loading {
        background: #002238;
    }
    
    .gallery-no-images {
        background: #002238;
    }
    
    .gallery-no-images p {
        color: white;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .gallery-item,
    .gallery-nav,
    .indicator,
    .gallery-caption {
        transition: none;
    }
    
    .gallery-item img {
        transition: none;
    }
}

/* Focus styles for keyboard navigation - Remove blue outline */
.gallery-nav:focus,
.indicator:focus {
    outline: none !important;
}

.gallery-nav:focus-visible,
.indicator:focus-visible {
    outline: none !important;
}

/* Print styles */
@media print {
    .image-gallery {
        height: auto;
        /* box-shadow: none; */
        border-radius: 0;
    }
    
    .gallery-nav,
    .gallery-indicators {
        display: none;
    }
    
    .gallery-item {
        position: static !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
        margin-bottom: 1rem;
        filter: none !important;
        opacity: 1 !important;
        transform: none !important;
        border-radius: 0;
        /* box-shadow: none; */
    }
    
    .gallery-caption {
        position: static;
        background: none;
        color: #000;
        opacity: 1;
        transform: none;
        padding: 10px 0;
    }
}

/* Enhanced animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item.active {
    animation: fadeInUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Pulse effect for active indicator */
@keyframes pulse {
    0% {
        /* box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); */
    }
    70% {
        /* box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); */
    }
    100% {
        /* box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); */
    }
}

.indicator.active {
    animation: pulse 2s infinite;
}