/**
 * Layered Carousel CSS
 * Modern stacked carousel effect with lightbox
 */

/* Main Carousel Container */
.layered-carousel {
    position: relative;
    max-width: 800px;
    margin: 0 auto 20px auto;
    
    overflow: visible;
}

/* Carousel Wrapper */
.layered-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 60px;
}

/* Slides Container */
.layered-slides-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    overflow: hidden;
    perspective: 1000px;
}

/* Slides Track */
.layered-slides-track {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    height: 190px;
}

/* Individual Slide Items */
.layered-slide-item {
    position: absolute;
    width: 250px;
    height: 180px;
    border-radius: 0px;
    border: 1px solid #ffffff;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform-origin: center center;
}

.layered-slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Positioning for 5 slides */
.layered-slide-item:nth-child(1) {
    left: 0;
    z-index: 1;
    transform: scale(0.8) translateX(-20px);
    opacity: 1;
}

.layered-slide-item:nth-child(2) {
    left: 120px;
    z-index: 3;
    transform: scale(0.9) translateX(-10px);
    opacity: 1;
}

.layered-slide-item:nth-child(3) {
    left: 50%;
    transform: translateX(-50%) scale(1.1);
    z-index: 5;
    opacity: 1;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.layered-slide-item:nth-child(4) {
    right: 120px;
    z-index: 3;
    transform: scale(0.9) translateX(10px);
    opacity: 1;
}

.layered-slide-item:nth-child(5) {
    right: 0;
    z-index: 1;
    transform: scale(0.8) translateX(20px);
    opacity: 1;
}

/* Hide slides beyond 5 */
.layered-slide-item:nth-child(n+6) {
    opacity: 0;
    transform: scale(0.6);
    z-index: 0;
}

/* Hover Effects - Images stay in place but scale slightly */
.layered-slide-item:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    filter: brightness(1.05);
}

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

/* Navigation Buttons */
.layered-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: #ccc;
    border: none;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.layered-nav-prev {
    background-image: url('https://eloquent-chandrasekhar.3-82-33-92.plesk.page/wp-content/uploads/2025/09/arrow-left-gsm.png');
    background-size: 70%;
    background-repeat: no-repeat;
    background-position: center;
    left: 10px;
}

.layered-nav-next {
    background-image: url('https://eloquent-chandrasekhar.3-82-33-92.plesk.page/wp-content/uploads/2025/09/arrow-right-gsm.png');
    background-size: 60%;
    background-repeat: no-repeat;
    background-position: center;
    right: 10px;
}

/* Dots Container */
.layered-dots-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    
    padding: 10px 0;
}

/* Individual Dots */
.layered-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d0d0d0;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.layered-dot:hover {
    background: #a0a0a0;
    transform: scale(1.2);
}

.layered-dot.active {
    background: #666;
    transform: scale(1.2);
    box-shadow: 0 0 0 1px rgba(102, 102, 102, 0.2);
}

.layered-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: transparent;
}

/* ========== LIGHTBOX STYLES ========== */

.layered-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.layered-lightbox.active {
    display: block;
    opacity: 1;
}

.layered-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
}

.layered-lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.layered-lightbox-image-container {
    max-width: 90%;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lightboxZoomIn 0.3s ease-out;
    position: relative;
    min-height: 200px;
}

.layered-lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

/* Lightbox Loader */
.layered-lightbox-image-container.loading::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: lightboxSpin 0.8s linear infinite;
    z-index: 1;
}

.layered-lightbox-image-container.loading::after {
    content: 'Loading...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin-top: 40px;
    color: #fff;
    font-size: 14px;
    letter-spacing: 1px;
    z-index: 1;
}

@keyframes lightboxSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.layered-lightbox-caption {
    color: #fff;
    font-size: 16px;
    margin-top: 20px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    max-width: 80%;
    text-align: center;
}

/* Lightbox Close Button */
.layered-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.layered-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Lightbox Navigation Buttons */
.layered-lightbox-prev,
.layered-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 55px;
    height: 55px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.layered-lightbox-prev {
    left: 30px;
}

.layered-lightbox-next {
    right: 30px;
}

.layered-lightbox-prev:hover,
.layered-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

@keyframes lightboxZoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .layered-carousel-wrapper {
        padding: 0 40px;
    }
    
    .layered-slides-track {
        height: 110px;
    }
    
    .layered-slide-item {
        width: 140px;
        height: 105px;
    }
    
    /* Adjust positioning for mobile */
    .layered-slide-item:nth-child(1) {
        left: -10px;
        transform: scale(0.75) translateX(-15px);
    }
    
    .layered-slide-item:nth-child(2) {
        left: 80px;
        transform: scale(0.85) translateX(-8px);
    }
    
    .layered-slide-item:nth-child(3) {
        transform: translateX(-50%) scale(1.05);
    }
    
    .layered-slide-item:nth-child(4) {
        right: 80px;
        transform: scale(0.85) translateX(8px);
    }
    
    .layered-slide-item:nth-child(5) {
        right: -10px;
        transform: scale(0.75) translateX(15px);
    }
    
    .layered-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .layered-nav-prev {
        left: 5px;
    }
    
    .layered-nav-next {
        right: 5px;
    }
    
    .layered-dots-container {
        gap: 8px;
        margin-top: 20px;
    }
    
    .layered-dot {
        width: 10px;
        height: 10px;
    }
    
    /* Lightbox mobile adjustments */
    .layered-lightbox-prev,
    .layered-lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 36px;
    }
    
    .layered-lightbox-prev {
        left: 15px;
    }
    
    .layered-lightbox-next {
        right: 15px;
    }
    
    .layered-lightbox-close {
        width: 45px;
        height: 45px;
        top: 15px;
        right: 15px;
        font-size: 32px;
    }
    
    .layered-lightbox-caption {
        font-size: 14px;
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .layered-carousel-wrapper {
        padding: 0 30px;
    }
    
    .layered-slides-track {
        height: 90px;
    }
    
    .layered-slide-item {
        width: 120px;
        height: 85px;
    }
    
    /* Tighter positioning for small screens */
    .layered-slide-item:nth-child(1) {
        left: -20px;
        transform: scale(0.7) translateX(-10px);
    }
    
    .layered-slide-item:nth-child(2) {
        left: 60px;
        transform: scale(0.8) translateX(-5px);
    }
    
    .layered-slide-item:nth-child(3) {
        transform: translateX(-50%) scale(1.0);
    }
    
    .layered-slide-item:nth-child(4) {
        right: 60px;
        transform: scale(0.8) translateX(5px);
    }
    
    .layered-slide-item:nth-child(5) {
        right: -20px;
        transform: scale(0.7) translateX(10px);
    }
    
    .layered-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    /* Lightbox small mobile adjustments */
    .layered-lightbox-prev,
    .layered-lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 28px;
    }
    
    .layered-lightbox-prev {
        left: 10px;
    }
    
    .layered-lightbox-next {
        right: 10px;
    }
    
    .layered-lightbox-close {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
        font-size: 28px;
    }
}

/* Animation classes for slide transitions */
.layered-slide-item.slide-in-left {
    animation: slideInLeft 0.5s ease-out forwards;
}

.layered-slide-item.slide-in-right {
    animation: slideInRight 0.5s ease-out forwards;
}

.layered-slide-item.slide-out-left {
    animation: slideOutLeft 0.5s ease-out forwards;
}

.layered-slide-item.slide-out-right {
    animation: slideOutRight 0.5s ease-out forwards;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100px) scale(0.6);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) scale(1.1);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100px) scale(0.6);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) scale(1.1);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(-50%) scale(1.1);
        opacity: 1;
    }
    to {
        transform: translateX(-100px) scale(0.6);
        opacity: 0;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(-50%) scale(1.1);
        opacity: 1;
    }
    to {
        transform: translateX(100px) scale(0.6);
        opacity: 0;
    }
}

/* Focus states for accessibility */
.layered-nav-btn:focus,
.layered-dot:focus,
.layered-slide-item:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.layered-lightbox-close:focus,
.layered-lightbox-prev:focus,
.layered-lightbox-next:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Loading state */
.layered-carousel.loading .layered-slide-item {
    opacity: 0.3;
}

.layered-carousel.loading .layered-slides-track::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.layered-carousel-single {
    width: 100%;
    max-width: 100%;
}

.layered-single-image {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.layered-single-image img {
    width: 800px;
    height: auto;
    display: block;
}

.layered-single-image a {
    display: block;
    width: 100%;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

