/**
 * Marthoma Church Theme - 3D Carousel Widget Styles
 * Stacked Behind Effect - Side cards peek from behind center
 *
 * @package MarthomaChurch
 */

/* Main Container */
.marthoma-carousel-3d {
    position: relative;
    width: 100%;
    padding: 60px 0 80px;
    overflow: visible !important;
    background: transparent !important;
}

.marthoma-carousel-3d .swiper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 0 60px;
    overflow: visible !important;
    background: transparent !important;
}

/* Slides Container */
.marthoma-carousel-3d .swiper-wrapper {
    align-items: center;
    overflow: visible !important;
}

/* Individual Slides - Fixed Size */
.marthoma-carousel-3d .swiper-slide {
    width: 600px !important;
    height: 400px !important;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    flex-shrink: 0;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    overflow: visible !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
}

/* Extra specificity for stubborn backgrounds */
.marthoma-carousel-3d .swiper .swiper-wrapper .swiper-slide {
    background: transparent !important;
    background-color: transparent !important;
    border-radius: 0 !important;
}

.elementor-widget-marthoma-carousel-3d .swiper-slide {
    background: transparent !important;
    background-color: transparent !important;
}

/* Nuclear option - target all possible elements (excluding buttons & overlay) */
.marthoma-carousel-3d .swiper-slide,
.marthoma-carousel-3d .swiper-slide > *:not(.swiper-button-prev):not(.swiper-button-next):not(.carousel-slide-overlay),
.marthoma-carousel-3d .swiper-slide-duplicate,
.marthoma-carousel-3d [class*="swiper-slide"]:not([class*="swiper-button"]):not(.carousel-slide-overlay) {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.marthoma-carousel-3d .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: transparent !important;
}

/* Ensure images in side slides have no extra styling */
.marthoma-carousel-3d .swiper-slide-prev img,
.marthoma-carousel-3d .swiper-slide-next img {
    background: transparent !important;
    border: none !important;
}

/* Center/Active Slide - Full size, front and center */
.marthoma-carousel-3d .swiper-slide-active {
    z-index: 10 !important;
    transform: scale(1);
    opacity: 1 !important;
    background: transparent !important;
    background-color: transparent !important;
}

.marthoma-carousel-3d .swiper-slide-active img {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Activity Slide Overlay */
.marthoma-carousel-3d .carousel-slide-overlay {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 40px 20px 16px !important;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.35) 60%, transparent 100%) !important;
    border-radius: 0 0 20px 20px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 6px !important;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.marthoma-carousel-3d .swiper-slide-active .carousel-slide-overlay {
    opacity: 1;
    pointer-events: auto;
}

.marthoma-carousel-3d .carousel-slide-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    line-height: 1.3 !important;
    text-align: center !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.marthoma-carousel-3d .carousel-slide-readmore {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    opacity: 0.85;
    transition: opacity 0.2s ease;
    background: transparent !important;
}

.marthoma-carousel-3d .carousel-slide-readmore:hover {
    opacity: 1;
    text-decoration: none !important;
}

.marthoma-carousel-3d .carousel-slide-readmore svg {
    width: 12px !important;
    height: 12px !important;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.marthoma-carousel-3d .carousel-slide-readmore:hover svg {
    transform: translate(2px, -2px);
}

/* Hide overlay on side slides */
.marthoma-carousel-3d .swiper-slide-prev .carousel-slide-overlay,
.marthoma-carousel-3d .swiper-slide-next .carousel-slide-overlay {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Remove ALL Swiper internal backgrounds and shadows (excluding navigation & overlay) */
.marthoma-carousel-3d .swiper-slide *:not(.swiper-button-prev):not(.swiper-button-next):not(.carousel-slide-overlay):not(.carousel-slide-title):not(.carousel-slide-readmore),
.marthoma-carousel-3d .swiper-slide::before,
.marthoma-carousel-3d .swiper-slide::after {
    background: transparent !important;
    background-color: transparent !important;
}

.marthoma-carousel-3d .swiper-slide-shadow,
.marthoma-carousel-3d .swiper-slide-shadow-left,
.marthoma-carousel-3d .swiper-slide-shadow-right,
.marthoma-carousel-3d .swiper-slide-shadow-top,
.marthoma-carousel-3d .swiper-slide-shadow-bottom {
    display: none !important;
    opacity: 0 !important;
    background: transparent !important;
}

/* Previous Slide (Left) - Behind center, peeking from left */
.marthoma-carousel-3d .swiper-slide-prev {
    z-index: 5 !important;
    transform: translateX(50%) scale(0.85);
    opacity: 1 !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

.marthoma-carousel-3d .swiper-slide-prev *:not(img) {
    background: none !important;
    background-color: transparent !important;
}

.marthoma-carousel-3d .swiper-slide-prev img {
    box-shadow: -10px 15px 30px -10px rgba(0, 0, 0, 0.3);
    filter: brightness(0.8);
}

/* Next Slide (Right) - Behind center, peeking from right */
.marthoma-carousel-3d .swiper-slide-next {
    z-index: 5 !important;
    transform: translateX(-50%) scale(0.85);
    opacity: 1 !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

.marthoma-carousel-3d .swiper-slide-next *:not(img) {
    background: none !important;
    background-color: transparent !important;
}

.marthoma-carousel-3d .swiper-slide-next img {
    box-shadow: 10px 15px 30px -10px rgba(0, 0, 0, 0.3);
    filter: brightness(0.8);
}

/* Hide other slides completely */
.marthoma-carousel-3d .swiper-slide:not(.swiper-slide-active):not(.swiper-slide-prev):not(.swiper-slide-next) {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Disable Swiper's default shadows */
.marthoma-carousel-3d .swiper-slide-shadow-left,
.marthoma-carousel-3d .swiper-slide-shadow-right {
    display: none !important;
}

/* Remove any Elementor container restrictions */
.elementor-widget-marthoma-carousel-3d,
.elementor-widget-marthoma-carousel-3d .elementor-widget-container {
    overflow: visible !important;
    background: transparent !important;
}

/* Ensure parent containers allow overflow */
.elementor-widget-marthoma-carousel-3d .e-con,
.elementor-widget-marthoma-carousel-3d .e-con-inner {
    overflow: visible !important;
}

/* Navigation Arrows - with !important to override nuclear rules */
.marthoma-carousel-3d .swiper-button-prev,
.marthoma-carousel-3d .swiper-button-next {
    width: 50px !important;
    height: 50px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease;
    top: 50%;
    margin-top: -25px;
    z-index: 20;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.marthoma-carousel-3d .swiper-button-prev:hover,
.marthoma-carousel-3d .swiper-button-next:hover {
    background: #ffffff !important;
    background-color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
    transform: scale(1.1);
}

.marthoma-carousel-3d .swiper-button-prev::after,
.marthoma-carousel-3d .swiper-button-next::after {
    font-size: 20px !important;
    font-weight: bold !important;
    color: var(--marthoma-primary, #000000) !important;
    background: transparent !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-family: inherit !important;
}

.marthoma-carousel-3d .swiper-button-prev::after {
    content: '❮' !important;
}

.marthoma-carousel-3d .swiper-button-next::after {
    content: '❯' !important;
}

.marthoma-carousel-3d .swiper-button-prev {
    left: 20px;
}

.marthoma-carousel-3d .swiper-button-next {
    right: 20px;
}

/* Pagination */
.marthoma-carousel-3d .swiper-pagination {
    bottom: 0;
    z-index: 20;
}

.marthoma-carousel-3d .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #B7D8FB;
    opacity: 1;
    transition: all 0.3s ease;
    margin: 0 6px;
}

.marthoma-carousel-3d .swiper-pagination-bullet-active {
    background: #375EFB;
    transform: scale(1.3);
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .marthoma-carousel-3d .swiper {
        max-width: 800px;
    }

    .marthoma-carousel-3d .swiper-slide {
        width: 500px !important;
        height: 340px !important;
    }

    .marthoma-carousel-3d .swiper-slide-prev {
        transform: translateX(45%) scale(0.8);
    }

    .marthoma-carousel-3d .swiper-slide-next {
        transform: translateX(-45%) scale(0.8);
    }
}

@media (max-width: 900px) {
    .marthoma-carousel-3d .swiper {
        max-width: 100%;
    }

    .marthoma-carousel-3d .swiper-slide {
        width: 60vw !important;
        max-width: 400px !important;
        height: 260px !important;
    }

    .marthoma-carousel-3d .swiper-slide-prev {
        transform: translateX(35%) scale(0.75);
    }

    .marthoma-carousel-3d .swiper-slide-next {
        transform: translateX(-35%) scale(0.75);
    }

    .marthoma-carousel-3d .swiper-button-prev,
    .marthoma-carousel-3d .swiper-button-next {
        width: 44px !important;
        height: 44px !important;
        margin-top: -22px;
    }

    .marthoma-carousel-3d .swiper-button-prev::after,
    .marthoma-carousel-3d .swiper-button-next::after {
        font-size: 16px !important;
    }
}

/* Tablet landscape */
@media (max-width: 768px) {
    .marthoma-carousel-3d {
        padding: 30px 0 50px;
        overflow: hidden !important;
    }

    .marthoma-carousel-3d .swiper {
        overflow: hidden !important;
    }

    .marthoma-carousel-3d .swiper-slide {
        width: 70vw !important;
        max-width: 380px !important;
        height: 240px !important;
    }

    .marthoma-carousel-3d .swiper-slide-prev {
        transform: translateX(25%) scale(0.75);
        opacity: 0.6 !important;
    }

    .marthoma-carousel-3d .swiper-slide-next {
        transform: translateX(-25%) scale(0.75);
        opacity: 0.6 !important;
    }

    .marthoma-carousel-3d .swiper-button-prev,
    .marthoma-carousel-3d .swiper-button-next {
        width: 40px !important;
        height: 40px !important;
        margin-top: -20px;
    }

    .marthoma-carousel-3d .swiper-button-prev::after,
    .marthoma-carousel-3d .swiper-button-next::after {
        font-size: 14px !important;
    }

    .marthoma-carousel-3d .swiper-button-prev {
        left: 10px;
    }

    .marthoma-carousel-3d .swiper-button-next {
        right: 10px;
    }

    /* Elementor container overflow fix */
    .elementor-widget-marthoma-carousel-3d,
    .elementor-widget-marthoma-carousel-3d .elementor-widget-container {
        overflow: hidden !important;
    }
}

/* Overlay responsive - tablet */
@media (max-width: 768px) {
    .marthoma-carousel-3d .carousel-slide-overlay {
        padding: 30px 14px 12px !important;
    }

    .marthoma-carousel-3d .carousel-slide-title {
        font-size: 13px !important;
    }

    .marthoma-carousel-3d .carousel-slide-readmore {
        font-size: 12px !important;
    }
}

/* Mobile styles - simplified single card view */
@media (max-width: 600px) {
    .marthoma-carousel-3d {
        padding: 20px 0 40px;
        overflow: hidden !important;
    }

    .marthoma-carousel-3d .swiper {
        max-width: 100%;
        padding: 10px 0 30px;
        overflow: hidden !important;
    }

    .marthoma-carousel-3d .swiper-slide {
        width: 85vw !important;
        max-width: 320px !important;
        height: 220px !important;
    }

    /* Hide side slides on mobile for cleaner look */
    .marthoma-carousel-3d .swiper-slide-prev,
    .marthoma-carousel-3d .swiper-slide-next {
        opacity: 0.3 !important;
        transform: scale(0.85) translateX(0) !important;
    }

    .marthoma-carousel-3d .swiper-slide-prev img,
    .marthoma-carousel-3d .swiper-slide-next img {
        filter: brightness(0.6);
    }

    .marthoma-carousel-3d .swiper-slide img {
        border-radius: 12px;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .marthoma-carousel-3d .swiper-button-prev,
    .marthoma-carousel-3d .swiper-button-next {
        width: 36px !important;
        height: 36px !important;
        margin-top: -18px;
    }

    .marthoma-carousel-3d .swiper-button-prev::after,
    .marthoma-carousel-3d .swiper-button-next::after {
        font-size: 12px !important;
    }

    .marthoma-carousel-3d .swiper-button-prev {
        left: 8px;
    }

    .marthoma-carousel-3d .swiper-button-next {
        right: 8px;
    }

    .marthoma-carousel-3d .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
        margin: 0 4px;
    }

    /* Elementor container overflow fix */
    .elementor-widget-marthoma-carousel-3d,
    .elementor-widget-marthoma-carousel-3d .elementor-widget-container {
        overflow: hidden !important;
    }
}

/* Samsung & small mobile screens (S20 Ultra 412px, S8+ 360px) */
@media (max-width: 480px) {
    .marthoma-carousel-3d {
        padding: 15px 0 35px;
    }

    .marthoma-carousel-3d .swiper {
        padding: 10px 0 25px;
    }

    .marthoma-carousel-3d .swiper-slide {
        width: 90vw !important;
        max-width: none !important;
        height: 220px !important;
    }

    /* Completely hide side slides on small screens */
    .marthoma-carousel-3d .swiper-slide-prev,
    .marthoma-carousel-3d .swiper-slide-next {
        opacity: 0 !important;
        visibility: hidden !important;
        transform: scale(0.8) translateX(0) !important;
    }

    .marthoma-carousel-3d .swiper-slide img {
        border-radius: 10px;
    }

    .marthoma-carousel-3d .swiper-button-prev,
    .marthoma-carousel-3d .swiper-button-next {
        width: 34px !important;
        height: 34px !important;
        margin-top: -17px;
    }

    .marthoma-carousel-3d .swiper-button-prev::after,
    .marthoma-carousel-3d .swiper-button-next::after {
        font-size: 11px !important;
    }

    .marthoma-carousel-3d .swiper-button-prev {
        left: 8px;
    }

    .marthoma-carousel-3d .swiper-button-next {
        right: 8px;
    }

    .marthoma-carousel-3d .swiper-pagination-bullet {
        width: 7px;
        height: 7px;
        margin: 0 4px;
    }
}

/* Very small screens (iPhone SE, Galaxy S8+, etc.) */
@media (max-width: 375px) {
    .marthoma-carousel-3d .swiper-slide {
        width: 92vw !important;
        height: 200px !important;
    }

    .marthoma-carousel-3d .swiper-button-prev,
    .marthoma-carousel-3d .swiper-button-next {
        width: 30px !important;
        height: 30px !important;
        margin-top: -15px;
    }

    .marthoma-carousel-3d .swiper-button-prev::after,
    .marthoma-carousel-3d .swiper-button-next::after {
        font-size: 10px !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .marthoma-carousel-3d .swiper-slide,
    .marthoma-carousel-3d .swiper-slide img,
    .marthoma-carousel-3d .swiper-button-prev,
    .marthoma-carousel-3d .swiper-button-next,
    .marthoma-carousel-3d .swiper-pagination-bullet {
        transition: none;
    }
}

/* Editor Preview */
.elementor-editor-active .marthoma-carousel-3d .swiper {
    overflow: visible !important;
}
