/**
 * BannerCarouselV2 - Estilos do componente
 * @version 2.0.0
 */

/* ========================================
   Container Principal
   ======================================== */
.bc-v2 {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #f5f5f5;
}

.bc-v2:focus {
    outline: 2px solid var(--tp-theme-1, #4CAF50);
    outline-offset: 4px;
}

/* ========================================
   Slides Container
   ======================================== */
.bc-v2__slides {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: transparent;
}

/* Aspect Ratios */
.bc-v2__slides--16-9 {
    aspect-ratio: 16 / 9;
}

.bc-v2__slides--21-9 {
    aspect-ratio: 21 / 9;
}

.bc-v2__slides--4-3 {
    aspect-ratio: 4 / 3;
}

.bc-v2__slides--1-1 {
    aspect-ratio: 1 / 1;
}

.bc-v2__slides--full {
    aspect-ratio: auto;
    min-height: 400px;
}

@media (max-width: 991px) {
    .bc-v2__slides--full {
        min-height: 300px;
    }
}

@media (max-width: 575px) {
    .bc-v2__slides--full {
        min-height: 250px;
    }
}

.bc-v2__slides-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    touch-action: pan-y; /* Permite scroll vertical, mas captura swipe horizontal */
    cursor: grab;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.bc-v2__slides-wrapper:active {
    cursor: grabbing;
}

@media (hover: none) and (pointer: coarse) {
    /* Mobile: cursor padrão */
    .bc-v2__slides-wrapper {
        cursor: default;
    }
    
    .bc-v2__slides-wrapper:active {
        cursor: default;
    }
}

/* ========================================
   Slides
   ======================================== */
.bc-v2__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    will-change: opacity, transform;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.98);
}

.bc-v2__slide--active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
    transform: scale(1);
}

/* Estado durante swipe - animação mais rápida */
.bc-v2--swiping .bc-v2__slide {
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.bc-v2__slide-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.bc-v2__slide-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    max-width: 100%;
    max-height: 100%;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none; /* Previne interferência no drag */
}

/* Zoom sutil na imagem ativa */
.bc-v2__slide--active .bc-v2__slide-image {
    transform: scale(1);
}

.bc-v2__slide:not(.bc-v2__slide--active) .bc-v2__slide-image {
    transform: scale(0.95);
}

.bc-v2__slide-image--lazy {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   Controls (Prev/Next/Play-Pause)
   ======================================== */
.bc-v2__controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 767px) {
    .bc-v2__controls {
        bottom: 20px;
        gap: 10px;
    }
}

.bc-v2__control {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 767px) {
    .bc-v2__control {
        width: 36px;
        height: 36px;
    }
    
    .bc-v2__control svg {
        width: 16px;
        height: 16px;
    }
}

.bc-v2__control:hover {
    background: linear-gradient(135deg, var(--tp-dynamic-color-primary, #EB008B) 0%, var(--tp-dynamic-color-accent, #ec3ca3) 100%);
    color: #fff;
    transform: scale(1.05);
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.2);
}

.bc-v2__control:active {
    transform: scale(0.96);
}

.bc-v2__control:focus {
    outline: 2px solid var(--tp-dynamic-color-primary, #EB008B);
    outline-offset: 2px;
}

/* Play/Pause Button */
.bc-v2__control--play-pause {
    position: relative;
}

.bc-v2__control--play-pause .bc-v2__icon-play {
    display: block;
}

.bc-v2__control--play-pause .bc-v2__icon-pause {
    display: none;
}

.bc-v2__control--play-pause.bc-v2__control--playing .bc-v2__icon-play {
    display: none;
}

.bc-v2__control--play-pause.bc-v2__control--playing .bc-v2__icon-pause {
    display: block;
}

/* ========================================
   Pagination (Dots)
   ======================================== */
.bc-v2__pagination {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 767px) {
    .bc-v2__pagination {
        bottom: 80px;
        gap: 8px;
    }
}

.bc-v2__pagination-dot {
    width: 28px;
    height: 5px;
    border-radius: 12px;
    border: none;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.bc-v2__pagination-dot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--tp-dynamic-color-primary, #EB008B) 0%, var(--tp-dynamic-color-accent, #ec3ca3) 100%);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 767px) {
    .bc-v2__pagination-dot {
        width: 24px;
        height: 4px;
    }
}

.bc-v2__pagination-dot:hover {
    background-color: rgba(255, 255, 255, 0.45);
    transform: scaleX(1.1);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
}

.bc-v2__pagination-dot--active {
    width: 40px;
    background: transparent;
    box-shadow: 0 2px 12px rgba(235, 0, 139, 0.4);
}

.bc-v2__pagination-dot--active::before {
    opacity: 1;
}

@media (max-width: 767px) {
    .bc-v2__pagination-dot--active {
        width: 32px;
    }
}

.bc-v2__pagination-dot:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* ========================================
   Progress Bar
   ======================================== */
.bc-v2__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.15);
    z-index: 10;
    overflow: hidden;
}

.bc-v2__progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--tp-dynamic-color-primary, #EB008B) 0%, var(--tp-dynamic-color-accent, #ec3ca3) 100%);
    transition: width 0.05s linear;
    box-shadow: 0 0 16px rgba(235, 0, 139, 0.6);
}

/* ========================================
   Variações de Tema
   ======================================== */

/* Dark Theme */
.bc-v2--dark .bc-v2__control {
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
}

.bc-v2--dark .bc-v2__control:hover {
    background-color: var(--tp-theme-1, #4CAF50);
}

.bc-v2--dark .bc-v2__pagination-dot {
    border-color: rgba(0, 0, 0, 0.5);
}

.bc-v2--dark .bc-v2__pagination-dot--active {
    background-color: var(--tp-theme-1, #4CAF50);
    border-color: var(--tp-theme-1, #4CAF50);
}

/* Light Theme */
.bc-v2--light .bc-v2__control {
    background-color: rgba(255, 255, 255, 0.95);
    color: #333;
}

/* Minimal Theme (sem bordas arredondadas nos controles) */
.bc-v2--minimal .bc-v2__control {
    border-radius: 4px;
}

/* ========================================
   Animações de Transição
   ======================================== */

/* Fade */
.bc-v2--transition-fade .bc-v2__slide {
    transition: opacity 0.8s ease-in-out;
}

/* Slide */
.bc-v2--transition-slide .bc-v2__slide {
    transition: transform 0.8s ease-in-out, opacity 0.8s ease-in-out;
}

.bc-v2--transition-slide .bc-v2__slide {
    transform: translateX(100%);
}

.bc-v2--transition-slide .bc-v2__slide--active {
    transform: translateX(0);
}

/* Zoom */
.bc-v2--transition-zoom .bc-v2__slide {
    transition: transform 0.8s ease-in-out, opacity 0.8s ease-in-out;
}

.bc-v2--transition-zoom .bc-v2__slide {
    transform: scale(1.1);
}

.bc-v2--transition-zoom .bc-v2__slide--active {
    transform: scale(1);
}

/* ========================================
   Responsividade
   ======================================== */

@media (max-width: 991px) and (min-width: 768px) {
    .bc-v2__slides--16-9 {
        aspect-ratio: 16 / 9; /* Mantém 16:9 para evitar bordas */
    }
    
    .bc-v2__slides--21-9 {
        aspect-ratio: 16 / 9;
    }
}

@media (max-width: 767px) {
    .bc-v2__slides--16-9 {
        aspect-ratio: 16 / 9; /* Mantém 16:9 consistente no mobile */
    }
    
    .bc-v2__slides--21-9 {
        aspect-ratio: 16 / 9;
    }
}

/* ========================================
   Estados de Loading e Erro
   ======================================== */

.bc-v2--loading {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.bc-v2--error {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    color: #999;
    font-size: 16px;
}

/* ========================================
   Acessibilidade
   ======================================== */

/* Reduzir movimento para usuários com preferência */
@media (prefers-reduced-motion: reduce) {
    .bc-v2__slide,
    .bc-v2__slides-wrapper,
    .bc-v2__slide-image,
    .bc-v2__control,
    .bc-v2__pagination-dot,
    .bc-v2__progress-bar {
        transition: none !important;
        animation: none !important;
    }
}

/* Performance: GPU acceleration */
.bc-v2__slides-wrapper,
.bc-v2__slide,
.bc-v2__slide-image {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000px;
    perspective: 1000px;
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .bc-v2__control {
        border: 2px solid currentColor;
    }
    
    .bc-v2__pagination-dot {
        border-width: 3px;
    }
}
