﻿/* استایل‌های پایه کروسل */
.carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background: #fff;
    transition: all 0.3s ease;
}

.carousel-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-item {
    position: relative;
    width: 100%;
    min-height: 300px;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    transition: transform 0.5s ease-in-out;
}

    /* استایل پایه تصاویر با افکت‌های پیشرفته */
    .carousel-item img {
        width: 100%;
        height: auto;
        object-fit: cover;
        filter: brightness(95%) saturate(95%);
        transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        transform-origin: center;
    }

/* استایل کپشن */
.carousel-caption {
    position: absolute;
    left: 0 !important;
    right: 0 !important;
    bottom: 20px;
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

    .carousel-caption h3 {
        color: white;
        font-size: 1.5rem;
        margin: 0 0 10px 0;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
        transition: all 0.4s ease;
    }

    .carousel-caption p {
        color: white;
        font-size: 1rem;
        margin: 0;
        line-height: 1.4;
        transition: all 0.4s ease;
        opacity: 0.9;
        transform: translateY(5px);
    }

/* دکمه‌های کنترل */
.carousel-control-prev,
.carousel-control-next {
    width: 10%;
    opacity: 0;
    transition: all 0.3s ease;
}

.carousel:hover .carousel-control-prev,
.carousel:hover .carousel-control-next {
    opacity: 0.8;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 30px;
    height: 30px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 15px;
}

/* نشانگرها */
.carousel-indicators {
    bottom: 10px;
    margin-bottom: 0;
}

    .carousel-indicators button {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        margin: 0 4px;
        background-color: rgba(255, 255, 255, 0.7);
        border: none;
        transition: all 0.3s ease;
        transform: scale(1);
    }

    .carousel-indicators .active {
        background-color: white;
        transform: scale(1.2);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    }

/* افکت‌های هاور برای دسکتاپ */
@media (min-width: 992px) {
    .carousel-item:hover img {
        filter: brightness(105%) saturate(110%) contrast(105%);
        transform: scale(1.03);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    }

    .carousel-item:hover .carousel-caption {
        transform: translateY(-8px);
        background: rgba(0, 0, 0, 0.75);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }

        .carousel-item:hover .carousel-caption h3 {
            transform: scale(1.05);
            color: #fff;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
        }

        .carousel-item:hover .carousel-caption p {
            opacity: 1;
            transform: translateY(0);
            letter-spacing: 0.3px;
        }

    .carousel-control-prev:hover,
    .carousel-control-next:hover {
        opacity: 1;
        width: 12%;
    }

    .carousel-indicators button:hover {
        transform: scale(1.2);
    }
}

/* حالت تیره */
[data-theme="dark"] .carousel {
    background: #1a1a1a;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .carousel-item {
    background: linear-gradient(45deg, #2a2a2a, #1a1a1a);
}

    [data-theme="dark"] .carousel-item img {
        filter: brightness(85%) saturate(90%);
    }

    [data-theme="dark"] .carousel-item:hover img {
        filter: brightness(95%) saturate(105%);
        box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
    }

/* استایل‌های رسپانسیو */
@media (max-width: 1200px) {
    .carousel-caption {
        width: 85%;
        padding: 12px;
    }

        .carousel-caption h3 {
            font-size: 1.3rem;
        }
}

@media (max-width: 992px) {
    .carousel-item {
        min-height: 250px;
    }

    .carousel-caption {
        width: 90%;
        padding: 10px;
        bottom: 15px;
    }

        .carousel-caption h3 {
            font-size: 1.2rem;
        }

        .carousel-caption p {
            font-size: 0.9rem;
        }
}

@media (max-width: 768px) {
    .carousel-item {
        min-height: 200px;
    }

    .carousel-caption {
        width: 92%;
        padding: 8px;
        bottom: 10px;
    }

        .carousel-caption h3 {
            font-size: 1.1rem;
        }

        .carousel-caption p {
            font-size: 0.85rem;
        }

    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 25px;
        height: 25px;
        padding: 12px;
    }
}

@media (max-width: 576px) {
    .carousel-item {
        min-height: 150px;
    }

    .carousel-caption {
        width: 94%;
        padding: 6px;
        bottom: 8px;
    }

        .carousel-caption h3 {
            font-size: 1rem;
            margin-bottom: 3px;
        }

        .carousel-caption p {
            font-size: 0.8rem;
        }
}

@media (max-width: 410px) {
    .carousel-item {
        min-height: 120px;
    }

    .carousel-caption {
        width: 96%;
        padding: 5px;
        bottom: 5px;
    }

        .carousel-caption h3 {
            font-size: 0.9rem;
            margin-bottom: 0;
        }

        .carousel-caption p {
            display: none;
        }
}

/* انیمیشن اسلاید */
.carousel-item.active {
    animation: slideZoom 0.7s ease-in-out;
}

@keyframes slideZoom {
    0% {
        opacity: 0.5;
        transform: scale(1.05);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}
