/**
 * Forum Image Carousel Extension for phpBB.
 * @package salvocortesiano/carousel
 */

/* Carousel container */
.forum-image-carousel {
    background-color: #fff !important;
    border: 1px solid #e0e0e0 !important;
    margin-bottom: 15px;
    padding-bottom: 0;
    border-radius: 0;
    border-bottom: 4px solid #027fc9 !important;
}

.carousel-title {
    padding: 5px 10px;
    color: #027fc9 !important;
    background-color: #fff !important;
    text-transform: uppercase;
}

.carousel-title h3 {
    font-size: 16px !important;
    margin: 0;
    font-weight: bold;
}

.carousel-container,
.carousel-wrapper {
    background-color: #fff !important;
}

/* Carosello responsive con scroll automatico e loop infinito */
.carousel-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    background: #fff;
    height: 120px;
    transition: all 0.3s ease-in-out;
}

.carousel-items {
    display: flex;
    align-items: center;
    gap: 16px;
    animation: scroll-carousel 60s linear infinite;
    will-change: transform;
    width: max-content;
    position: relative;
}

.carousel-item {
    flex: 0 0 auto;
    width: 80px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-item img {
    height: 100px;
    width: auto;
    max-width: 100%;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

@keyframes scroll-carousel {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.carousel-item.active,
.carousel-item.carousel-active {
    z-index: 1;
}

.carousel-item a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative;
}

/* Lazy loading image styles */
.carousel-item img.lazy {
    opacity: 0;
}

.carousel-item img.lazy.loaded {
    opacity: 1;
}

/* Rimuovo le didascalie */
.carousel-caption {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Poster info styles */
.carousel-poster {
    padding: 5px 0;
    text-align: center;
    font-size: 11px;
    color: #666;
    margin-top: 5px;
}

.carousel-poster p {
    margin: 2px 0;
    font-style: italic;
}

/* Navigation buttons */
.carousel-prev,
.carousel-next {
    display: none !important;
}

/* Empty carousel message */
.carousel-empty {
    text-align: center;
    width: 100%;
    padding: 20px;
    font-style: italic;
    color: #fff;
}

@media (max-width: 600px) {
    .carousel-wrapper {
        height: 70px !important;
        padding: 0 !important;
    }
    .carousel-items {
        gap: 4px !important;
    }
    .carousel-item {
        width: 40px !important;
        height: 60px !important;
        margin: 0 2px !important;
        padding: 0 !important;
    }
    .carousel-item img {
        height: 50px !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .carousel-wrapper {
        height: 280px;
        padding: 15px 60px;
    }
    
    .carousel-item {
        width: 200px;
        height: 250px;
    }
    
    .carousel-item img {
        max-height: 140px;
    }

    .carousel-prev,
    .carousel-next {
        width: 50px;
        height: 30px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .carousel-wrapper {
        height: 240px;
        padding: 10px 40px;
    }
    
    .carousel-item {
        width: 170px;
        height: 220px;
    }
    
    .carousel-item img {
        max-height: 120px;
    }
    
    .carousel-caption {
        padding: 5px 0;
        font-size: 12px;
    }
    
    .carousel-prev,
    .carousel-next {
        width: 30px;
        padding: 2px;
    }
}

/* Tooltip scuro e responsive */
.carousel-tooltip {
    position: fixed;
    left: 50% !important;
    bottom: auto;
    top: 0;
    transform: translateX(-50%);
    background: #222 !important;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    white-space: pre-line;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    max-width: 320px;
    min-width: 120px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    text-align: center;
    font-weight: 500;
}
.carousel-tooltip.active {
    opacity: 1;
}
@media (max-width: 600px) {
    .carousel-tooltip {
        font-size: 12px;
        max-width: 180px;
        min-width: 80px;
        padding: 6px 8px;
    }
}
