/**
 * Custom Media Carousel Styles
 */

.cmc-carousel {
    position: relative;
    width: 100%;
}

.cmc-carousel .swiper-container {
    width: 100%;
    overflow: hidden;
}

.cmc-carousel .swiper-wrapper {
    display: flex;
}

.cmc-carousel .swiper-slide {
    flex-shrink: 0;
}

/* Slide Content */
.cmc-slide {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.cmc-slide img {
    width: 100%;
    height: auto;
    display: block;
}

.cmc-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Title Styles */
.cmc-slide-title {
    position: absolute;
    width: 100%;
    padding: 10px 20px;
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    z-index: 10;
    transition: all 0.3s ease;
    pointer-events: auto;
    text-align: center;
}

.cmc-slide-title a {
    color: inherit;
    text-decoration: none;
    display: block;
    transition: opacity 0.3s ease;
}

.cmc-slide-title a:hover {
    opacity: 0.8;
}

/* Title Vertical Positioning */
.cmc-slide-title.cmc-title-top {
    top: 20px;
    bottom: auto;
}

.cmc-slide-title.cmc-title-middle {
    top: 50%;
    transform: translateY(-50%);
    bottom: auto;
}

.cmc-slide-title.cmc-title-bottom {
    bottom: 20px;
    top: auto;
}

/* Title Horizontal Positioning */
.cmc-slide-title.cmc-title-h-left {
    text-align: left;
    left: 0;
    right: auto;
}

.cmc-slide-title.cmc-title-h-center {
    text-align: center;
    left: 0;
    right: 0;
}

.cmc-slide-title.cmc-title-h-right {
    text-align: right;
    left: auto;
    right: 0;
}

/* Icons Container */
.cmc-slide-icons {
    position: absolute;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    z-index: 11;
    pointer-events: auto;
}

/* Icons Vertical Positioning */
.cmc-slide-icons.cmc-icons-v-top {
    top: 20px;
    bottom: auto;
}

.cmc-slide-icons.cmc-icons-v-bottom {
    bottom: 20px;
    top: auto;
}

/* Icons Horizontal Positioning */
.cmc-slide-icons.cmc-icons-h-left {
    left: 20px;
    right: auto;
}

.cmc-slide-icons.cmc-icons-h-right {
    right: 20px;
    left: auto;
}

/* Individual Icon Styles */
.cmc-slide-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cmc-slide-icon:hover {
    background-color: rgba(0, 0, 0, 0.6);
    transform: translateY(-2px);
}

.cmc-slide-icon i,
.cmc-slide-icon svg {
    font-size: 20px;
    color: #ffffff;
    width: 20px;
    height: 20px;
}

/* Navigation Arrows */
.cmc-carousel .swiper-button-prev,
.cmc-carousel .swiper-button-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
}

/* Hide default Swiper icons */
.cmc-carousel .swiper-button-prev::after,
.cmc-carousel .swiper-button-next::after {
    content: none;
}

/* Custom navigation icons */
.cmc-carousel .cmc-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.cmc-carousel .cmc-nav-icon i,
.cmc-carousel .cmc-nav-icon svg {
    font-size: 20px;
    color: #333;
}

.cmc-carousel .swiper-button-prev:hover,
.cmc-carousel .swiper-button-next:hover {
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Default position - outside container */
.cmc-carousel .swiper-button-prev {
    left: 10px;
}

.cmc-carousel .swiper-button-next {
    right: 10px;
}

/* Inside container (relative position) */
.cmc-carousel.cmc-nav-inside .swiper-button-prev,
.cmc-carousel.cmc-nav-inside .swiper-button-next {
    position: absolute;
}

/* Together left position (absolute) */
.cmc-carousel.cmc-nav-together-left .swiper-button-prev,
.cmc-carousel.cmc-nav-together-left .swiper-button-next {
    /* transform will be overridden by inline styles from position controls */
}

/* Only apply defaults if position controls haven't been used */
.cmc-carousel.cmc-nav-together-left .swiper-button-prev:not([style*="top:"]):not([style*="bottom:"]) {
    top: auto;
    bottom: 20px;
    transform: translateY(0);
}

.cmc-carousel.cmc-nav-together-left .swiper-button-next:not([style*="top:"]):not([style*="bottom:"]) {
    top: auto;
    bottom: 20px;
    transform: translateY(0);
}

.cmc-carousel.cmc-nav-together-left .swiper-button-prev:not([style*="left:"]):not([style*="right:"]) {
    left: 20px;
    right: auto;
}

.cmc-carousel.cmc-nav-together-left .swiper-button-next:not([style*="left:"]):not([style*="right:"]) {
    left: 80px;
    right: auto;
}

/* Together right position (absolute) */
.cmc-carousel.cmc-nav-together-right .swiper-button-prev,
.cmc-carousel.cmc-nav-together-right .swiper-button-next {
    /* transform will be overridden by inline styles from position controls */
}

/* Only apply defaults if position controls haven't been used */
.cmc-carousel.cmc-nav-together-right .swiper-button-prev:not([style*="top:"]):not([style*="bottom:"]) {
    top: auto;
    bottom: 20px;
    transform: translateY(0);
}

.cmc-carousel.cmc-nav-together-right .swiper-button-next:not([style*="top:"]):not([style*="bottom:"]) {
    top: auto;
    bottom: 20px;
    transform: translateY(0);
}

.cmc-carousel.cmc-nav-together-right .swiper-button-prev:not([style*="left:"]):not([style*="right:"]) {
    right: 80px;
    left: auto;
}

.cmc-carousel.cmc-nav-together-right .swiper-button-next:not([style*="left:"]):not([style*="right:"]) {
    right: 20px;
    left: auto;
}

.cmc-carousel .swiper-button-prev::after,
.cmc-carousel .swiper-button-next::after {
    font-size: 20px;
    color: #333;
}

/* Pagination */
.cmc-carousel .swiper-pagination {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 20;
}

.cmc-carousel .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cmc-carousel .swiper-pagination-bullet-active {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.2);
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .cmc-slide-title {
        font-size: 18px;
        padding: 8px 15px;
    }

    /* Hide icons on mobile */
    .cmc-slide-icons {
        display: none !important;
    }

    .cmc-carousel .swiper-button-prev,
    .cmc-carousel .swiper-button-next {
        width: 36px;
        height: 36px;
    }

    .cmc-carousel .swiper-button-prev::after,
    .cmc-carousel .swiper-button-next::after {
        font-size: 16px;
    }
}

@media screen and (max-width: 480px) {
    .cmc-slide-title {
        font-size: 16px;
        padding: 6px 12px;
    }

    .cmc-carousel .swiper-button-prev,
    .cmc-carousel .swiper-button-next {
        width: 32px;
        height: 32px;
    }

    .cmc-carousel .swiper-button-prev::after,
    .cmc-carousel .swiper-button-next::after {
        font-size: 14px;
    }
}

/* Accessibility */
.cmc-slide-title:focus,
.cmc-slide-icon:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .cmc-slide-icon:hover {
        background-color: rgba(0, 0, 0, 0.3);
        transform: none;
    }
}
