/**
 * Frontend styles for Hui Image Carousel
 */

.hic-carousel-wrapper {
    width: 100%;
    margin: 20px 0;
}

.hic-swiper {
    width: 100%;
    position: relative;
}

.hic-swiper .swiper-slide {
    height: auto;
}

.hic-slide-fixed-height {
    height: auto !important;
}

.hic-slide-fixed-height .hic-slide-inner {
    height: 100%;
}

.hic-slide {
    display: flex;
    align-items: stretch;
}

.hic-slide-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.hic-slide-link {
    display: block;
    text-decoration: none;
    width: 100%;
    height: 100%;
}

.hic-slide-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.hic-slide-image {
    width: 100%;
    height: auto;
    display: block;
    /* object-fit and object-position are set inline per slide */
}

.hic-wrapper-square,
.hic-wrapper-circle {
    aspect-ratio: 1 / 1;
}

.hic-image-square,
.hic-image-circle {
    width: 100%;
    height: 100%;
    /* object-fit is set inline per slide, defaults to cover if not specified */
}

.hic-image-circle {
    border-radius: 50%;
}

.hic-slide-overlay {
    position: absolute;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Match overlay shape to image shape */
.hic-overlay-square {
    border-radius: 0;
}

.hic-overlay-circle {
    border-radius: 50%;
}

/* Overlay visibility - hover by default */
.hic-overlay-hover {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.hic-slide-image-wrapper:hover .hic-overlay-hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.hic-overlay-always {
    opacity: 1;
    visibility: visible;
}

/* Transition types */
.hic-transition-fade {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hic-transition-slide-up {
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.hic-slide-image-wrapper:hover .hic-transition-slide-up {
    transform: translateY(0);
}

.hic-transition-slide-down {
    transform: translateY(-20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.hic-slide-image-wrapper:hover .hic-transition-slide-down {
    transform: translateY(0);
}

.hic-transition-zoom {
    transform: scale(0.8);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.hic-slide-image-wrapper:hover .hic-transition-zoom {
    transform: scale(1);
}

.hic-overlay-center {
    /* Position already set in .hic-slide-overlay base class */
}

.hic-overlay-top {
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-bottom: 0;
}

.hic-overlay-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-top: 0;
}

.hic-overlay-top-left {
    top: 0;
    left: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding-bottom: 0;
    padding-right: 0;
}

.hic-overlay-top-right {
    top: 0;
    right: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-bottom: 0;
    padding-left: 0;
}

.hic-overlay-bottom-left {
    bottom: 0;
    left: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding-top: 0;
    padding-right: 0;
}

.hic-overlay-bottom-right {
    bottom: 0;
    right: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding-top: 0;
    padding-left: 0;
}

.hic-slide-overlay-content {
    line-height: 1.5;
    z-index: 1;
    word-wrap: break-word;
}

/* Error messages */
.hic-error {
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    margin: 20px 0;
}

/* Responsive font sizes for default text overlay */
.hic-responsive-font {
    font-size: var(--hic-font-mobile, 16px);
}

@media (min-width: 768px) {
    .hic-responsive-font {
        font-size: var(--hic-font-tablet, 18px);
    }
}

@media (min-width: 1024px) {
    .hic-responsive-font {
        font-size: var(--hic-font-desktop, 20px);
    }
}

@media (min-width: 1920px) {
    .hic-responsive-font {
        font-size: var(--hic-font-extra-large, 22px);
    }
}

/* Navigation buttons */
.hic-swiper .swiper-button-next,
.hic-swiper .swiper-button-prev {
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.hic-swiper .swiper-button-next:hover,
.hic-swiper .swiper-button-prev:hover {
    background: rgba(0, 0, 0, 0.8);
}

.hic-swiper .swiper-button-next::after,
.hic-swiper .swiper-button-prev::after {
    font-size: 20px;
}

/* Pagination */
.hic-swiper .swiper-pagination {
    position: relative;
    margin-top: 20px;
}

.hic-swiper .swiper-pagination-top {
    margin-top: 0;
    margin-bottom: 20px;
}

.hic-swiper .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: #ccc;
    opacity: 1;
    transition: background 0.3s ease;
}

.hic-swiper .swiper-pagination-bullet-active {
    background: #0073aa;
}

.hic-swiper .swiper-pagination-fraction {
    color: #333;
    font-size: 14px;
}

.hic-swiper .swiper-pagination-progressbar {
    background: #e0e0e0;
    height: 4px;
}

.hic-swiper .swiper-pagination-progressbar .swiper-pagination-progressbar-fill {
    background: #0073aa;
}

/* Lazy loading */
.hic-swiper .swiper-lazy-preloader {
    width: 42px;
    height: 42px;
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -21px;
    margin-top: -21px;
    z-index: 10;
    box-sizing: border-box;
    border: 4px solid #0073aa;
    border-radius: 50%;
    border-top-color: transparent;
    animation: swiper-preloader-spin 1s linear infinite;
}

@keyframes swiper-preloader-spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Default Image Overlay */
.hic-default-overlay-layer {
    transition: opacity 0.3s ease;
}

.hic-slide-image-wrapper:hover .hic-default-overlay-layer {
    opacity: 0;
}

/* Hover Effects (when text overlay is disabled) */
.hic-hover-effect-shadow .hic-slide-image {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.hic-slide-image-wrapper.hic-hover-effect-shadow:hover .hic-slide-image {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(-5px);
}

.hic-hover-effect-highlight .hic-slide-image {
    transition: filter 0.3s ease;
}

.hic-slide-image-wrapper.hic-hover-effect-highlight:hover .hic-slide-image {
    filter: brightness(1.2);
}

.hic-hover-effect-zoom .hic-slide-image {
    transition: transform 0.3s ease;
}

.hic-slide-image-wrapper.hic-hover-effect-zoom:hover .hic-slide-image {
    transform: scale(1.1);
}

.hic-hover-effect-darken .hic-slide-image {
    transition: filter 0.3s ease;
}

.hic-slide-image-wrapper.hic-hover-effect-darken:hover .hic-slide-image {
    filter: brightness(0.7);
}

.hic-hover-effect-brighten .hic-slide-image {
    transition: filter 0.3s ease;
}

.hic-slide-image-wrapper.hic-hover-effect-brighten:hover .hic-slide-image {
    filter: brightness(1.3);
}

.hic-hover-effect-grayscale .hic-slide-image {
    transition: filter 0.3s ease;
    filter: grayscale(100%);
}

.hic-slide-image-wrapper.hic-hover-effect-grayscale:hover .hic-slide-image {
    filter: grayscale(0%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hic-slide-overlay-content {
        font-size: 16px;
    }
    
    .hic-swiper .swiper-button-next,
    .hic-swiper .swiper-button-prev {
        width: 36px;
        height: 36px;
    }
    
    .hic-swiper .swiper-button-next::after,
    .hic-swiper .swiper-button-prev::after {
        font-size: 16px;
    }
}
