/* Main Container */
.vs-portfolio-slider-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0px;
    position: relative;
}

/* Tabs */
.vs-portfolio-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.vs-tab {
    padding: 10px 20px;
    background: #f5f5f5;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.vs-tab.active {
    background: var(--vs-primary-color, #009a5e);
    color: white;
}

/* Slider Wrapper */
.vs-slider-wrapper {
    position: relative;
    width: 100%;
    padding: 60px 0;
}

.vs-slider-track {
    display: flex;
    align-items: center;
    height: 500px;
    position: relative;
    overflow: hidden;
}

/* Slide Styles */
.vs-slide {
    position: absolute;
    width: 60%;
    height: 80%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center;
    z-index: 1;
    opacity: 0;
    filter: blur(3px);
    transform: translateX(-50%);
    left: 50%;
}

/* Active (Center) Slide */
.vs-slide.active {
    width: 60%;
    height: 100%;
    opacity: 1;
    z-index: 20;
    filter: blur(0);
    transform: translateX(-50%);
}

/* Adjacent Slides */
.vs-slide.prev {
    transform: translateX(-120%) scale(0.85);
    opacity: 0.8;
    z-index: 10;
    filter: blur(2px);
}

.vs-slide.next {
    transform: translateX(20%) scale(0.85);
    opacity: 0.8;
    z-index: 10;
    filter: blur(2px);
}

/* Far Slides */
.vs-slide.far-prev {
    transform: translateX(-180%) scale(0.75);
    opacity: 0.6;
    z-index: 5;
    filter: blur(3px);
    left: 0;
}

.vs-slide.far-next {
    transform: translateX(80%) scale(0.75);
    opacity: 0.6;
    z-index: 5;
    filter: blur(3px);
    left: auto;
    right: 0;
}

/* Slide Content */
.vs-slide-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.vs-slide-inner img {
    width: 100%;
    height: 100%;
    /* Ensure the image scales properly on all devices and stays centered */
    object-fit: cover;
    object-position: center center;
}

.vs-slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    /* Adjust the gradient overlay to darken the bottom without hiding content */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    opacity: 0;
}

/* Force all text in the slide content to appear white and override theme styles */
.vs-slide-content h3,
.vs-slide-content p,
.vs-slide-content span,
.vs-slide-content a {
    color: #ffffff !important;
}

.vs-slide:hover .vs-slide-content {
    transform: translateY(0);
    opacity: 1;
}

.vs-view-button {
    padding: 10px 25px;
    background: var(--vs-primary-color, #009a5e);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.vs-view-button:hover {
    background: var(--vs-primary-hover, #007a4b);
    transform: translateY(-2px);
}

.vs-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 30;
    transition: all 0.3s ease;
    opacity: 1 !important;
    visibility: visible !important;
    padding: 0 !important;
    border-radius: 50%;
}

.vs-slider-nav svg {
    width: 24px;
    height: 24px;
    display: block;
    fill: #fff;
    transition: fill 0.3s ease;
}

.vs-slider-prev {
    left: 5%;
}

.vs-slider-next {
    right: 5%;
}

.vs-slider-nav:hover {
    background: var(--vs-primary-color, #009a5e);
}

.vs-slider-nav:hover svg {
    fill: white;
}

/* Fixed Modal Positioning */
.vs-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999; /* Higher than everything */
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.vs-modal-content {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
    transform: none !important;
}

.vs-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
    color: #333;
    background: rgba(255, 255, 255, 0.8);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.vs-modal-image-container {
    width: 100%;
    overflow: hidden;
}

.vs-modal-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

.vs-modal-details {
    padding: 30px;
}

.vs-modal-title {
    margin-bottom: 20px;
    color: #333;
}

.vs-modal-excerpt {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #555;
}

.vs-modal-description {
    line-height: 1.7;
    margin-bottom: 20px;
    color: #666;
    overflow-wrap: break-word;
}

.vs-modal-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.vs-modal-category {
    background: var(--vs-primary-color, #009a5e);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .vs-slide {
        width: 70%;
    }
    .vs-slide.active {
        width: 80%;
    }
}

@media (max-width: 768px) {
    .vs-slider-track {
        height: 400px;
    }
    .vs-slide {
        width: 80%;
    }
    .vs-slide.active {
        width: 90%;
        height: 85%;
    }
    .vs-slider-nav {
        width: 40px;
        height: 40px;
    }
    .vs-modal-content {
        margin: 0px auto;
    }
}

@media (max-width: 480px) {
    .vs-slider-track {
        height: 350px;
    }
    .vs-slide {
        width: 90%;
    }
    .vs-slide.active {
        width: 95%;
        height: 80%;
    }
    .vs-slide-content {
        padding: 15px;
    }
    .vs-slider-nav {
        width: 35px;
        height: 35px;
    }
    .vs-modal-details {
        padding: 20px;
    }
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Fix for Elementor conflicts */
body.vs-modal-open {
    overflow: hidden !important;
}

body.vs-modal-open .elementor-section {
    position: static !important;
    z-index: auto !important;
}