/* Hero Carousel Styles */
.carousel-item {
    height: 600px;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    overflow: hidden;
}

/* Loading skeleton shimmer effect */
.slide-loading {
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg,
            rgba(30, 41, 59, 0.8) 0%,
            rgba(51, 65, 85, 0.9) 45%,
            rgba(30, 41, 59, 0.8) 55%,
            rgba(30, 41, 59, 0.8) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    z-index: 5;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Pulse glow effect for loading */
.slide-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%,
            rgba(34, 197, 94, 0.15) 0%,
            transparent 70%);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* Image fade-in animation - заполнение всего слайда */
.slide-image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    opacity: 0;
    transition: opacity 1s ease-in-out, transform 12s ease-out;
    /* Центрирование и заполнение */
    min-width: 100%;
    min-height: 100%;
    max-width: none;
    max-height: none;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(1);
}

/* Loading placeholder image should be visible immediately */
.carousel-item.active .slide-image {
    opacity: 1;
}

.slide-image.loaded {
    opacity: 1;
}

/* Ken Burns effect - плавное увеличение без искажений */
.slide-image.loaded.ken-burns {
    animation: kenBurns 12s ease-out forwards;
}

@keyframes kenBurns {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        transform: translate(-50%, -50%) scale(1.15);
    }
}

/* Sharp focus effect - появление с лёгким фокусом */
.slide-image.loaded.sharp {
    animation: sharpFocus 1.8s ease-out forwards;
}

@keyframes sharpFocus {
    0% {
        opacity: 0;
        filter: blur(5px) brightness(1.2);
        transform: translate(-50%, -50%) scale(1.05);
    }

    100% {
        opacity: 1;
        filter: blur(0) brightness(1);
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Fallback for background images */
.carousel-item .slide-background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

/* Gradient overlay for better text readability regardless of image */
.carousel-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    /* Dual gradient: dark at bottom for caption, subtle dark at top */
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0.15) 0%,
            rgba(0, 0, 0, 0.1) 40%,
            rgba(0, 0, 0, 0.4) 85%,
            rgba(0, 0, 0, 0.7) 100%);
}

/* Additional vignette effect for focus */
.carousel-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center,
            transparent 0%,
            rgba(0, 0, 0, 0.3) 100%);
}

.carousel-caption-custom {
    position: absolute;
    top: 50%;
    left: 8%;
    transform: translateY(-50%);
    z-index: 2;
    text-align: left;
    max-width: 650px;
    background: linear-gradient(90deg,
            rgba(0, 0, 0, 0.6) 0%,
            rgba(0, 0, 0, 0.3) 60%,
            transparent 100%);
    padding: 30px 40px;
    border-left: 4px solid #22c55e;
    border-radius: 0 8px 8px 0;
}

.carousel-caption-custom h2 {
    color: #fff;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 15px;
    line-height: 1.2;
}

.carousel-caption-custom p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 0;
}

.carousel-control-prev,
.carousel-control-next {
    width: auto;
    z-index: 10;
}

.carousel-control-prev:hover .carousel-control-btn,
.carousel-control-next:hover .carousel-control-btn {
    background-color: #22c55e;
    transform: scale(1.1);
}

.carousel-control-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    width: 52px;
    height: 52px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.carousel-control-btn i {
    color: #1e293b;
    font-size: 20px;
}

/* Responsive */
@media (max-width: 992px) {
    .carousel-item {
        height: 500px;
    }

    .carousel-caption-custom {
        left: 5%;
        max-width: 60%;
        padding: 25px 30px;
    }

    .carousel-caption-custom h2 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .carousel-item {
        height: 420px;
    }

    .carousel-caption-custom {
        left: 3%;
        right: 3%;
        max-width: 94%;
        padding: 20px 25px;
    }

    .carousel-caption-custom h2 {
        font-size: 1.6rem;
    }

    .carousel-caption-custom p {
        font-size: 0.95rem;
    }

    .carousel-control-btn {
        width: 42px;
        height: 42px;
    }

    .carousel-control-btn i {
        font-size: 16px;
    }
}

/* Carousel Indicators Styling */
#heroCarousel .carousel-indicators {
    z-index: 10;
    margin-bottom: 25px;
}

#heroCarousel .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid transparent;
    margin: 0 6px;
    transition: all 0.3s ease;
}

#heroCarousel .carousel-indicators button:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

#heroCarousel .carousel-indicators button.active {
    background-color: #22c55e;
    border-color: #fff;
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

@media (max-width: 576px) {
    .carousel-item {
        height: 350px;
    }

    .carousel-caption-custom {
        left: 2%;
        right: 2%;
        max-width: 96%;
        padding: 15px 20px;
        border-left-width: 3px;
    }

    .carousel-caption-custom h2 {
        font-size: 1.3rem;
    }

    .carousel-caption-custom p {
        font-size: 0.85rem;
    }

    .carousel-control-btn {
        width: 36px;
        height: 36px;
    }
}