/**
 * Estilos do Carrossel - Frontend
 *
 * @package Carrossel_Imagens_J3
 * @since 1.0.0
 */

/* ==========================================
   CONTAINER PRINCIPAL
========================================== */
.cij3-carrossel-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

.cij3-carrossel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.cij3-carrossel-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ==========================================
   SLIDES
========================================== */
.cij3-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    z-index: 1;
}

.cij3-slide.active {
    position: relative;
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.cij3-slide a {
    display: block;
    width: 100%;
    height: 100%;
}

.cij3-slide-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* ==========================================
   SETAS DE NAVEGAÇÃO
========================================== */
.cij3-arrow {
    position: absolute;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.cij3-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.cij3-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.cij3-arrow-prev {
    left: -25px; /* Meio dentro, meio fora */
}

.cij3-arrow-next {
    right: -25px; /* Meio dentro, meio fora */
}

.cij3-arrow svg {
    width: 24px;
    height: 24px;
}

/* ==========================================
   DOTS DE NAVEGAÇÃO
========================================== */
.cij3-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 10;
}

.cij3-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    outline: none;
}

.cij3-dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.cij3-dot.active {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.3);
}

/* ==========================================
   ANIMAÇÕES DE TRANSIÇÃO
========================================== */
/* Fade */
.cij3-transition-fade .cij3-slide {
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

/* Slide */
.cij3-transition-slide .cij3-slide {
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

.cij3-transition-slide .cij3-slide.slide-out-left {
    transform: translateX(-100%);
}

.cij3-transition-slide .cij3-slide.slide-out-right {
    transform: translateX(100%);
}

.cij3-transition-slide .cij3-slide.slide-in-left {
    transform: translateX(-100%);
}

.cij3-transition-slide .cij3-slide.slide-in-right {
    transform: translateX(100%);
}

/* ==========================================
   LOADING STATE
========================================== */
.cij3-carrossel-loading {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f1;
}

.cij3-carrossel-loading::after {
    content: "";
    width: 50px;
    height: 50px;
    border: 4px solid #dcdcde;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: cij3-spin 1s linear infinite;
}

@keyframes cij3-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   MENSAGEM DE ERRO/VAZIO
========================================== */
.cij3-carrossel-empty {
    padding: 40px 20px;
    text-align: center;
    background: #f0f0f1;
    border: 2px dashed #dcdcde;
    border-radius: 6px;
    color: #646970;
    font-size: 14px;
}

.cij3-carrossel-error {
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    margin: 10px 0;
}

/* ==========================================
   ACESSIBILIDADE
========================================== */
.cij3-arrow:focus,
.cij3-dot:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Screen readers only */
.cij3-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================
   RESPONSIVE - TABLET
========================================== */
@media screen and (max-width: 1024px) {
    .cij3-arrow {
        width: 45px;
        height: 45px;
    }
    
    .cij3-arrow-prev {
        left: -22px;
    }
    
    .cij3-arrow-next {
        right: -22px;
    }
    
    .cij3-arrow svg {
        width: 20px;
        height: 20px;
    }
    
    .cij3-dots {
        bottom: 15px;
    }
    
    .cij3-dot {
        width: 10px;
        height: 10px;
    }
}

/* ==========================================
   RESPONSIVE - MOBILE
========================================== */
@media screen and (max-width: 768px) {
    .cij3-arrow {
        width: 40px;
        height: 40px;
    }
    
    .cij3-arrow-prev {
        left: -20px;
    }
    
    .cij3-arrow-next {
        right: -20px;
    }
    
    .cij3-arrow svg {
        width: 18px;
        height: 18px;
    }
    
    .cij3-dots {
        bottom: 10px;
        gap: 8px;
    }
    
    .cij3-dot {
        width: 8px;
        height: 8px;
    }
}

@media screen and (max-width: 480px) {
    .cij3-arrow {
        width: 35px;
        height: 35px;
        opacity: 0.9;
    }
    
    .cij3-arrow-prev {
        left: 5px; /* Totalmente dentro em telas muito pequenas */
    }
    
    .cij3-arrow-next {
        right: 5px; /* Totalmente dentro em telas muito pequenas */
    }
    
    .cij3-arrow svg {
        width: 16px;
        height: 16px;
    }
    
    .cij3-dots {
        bottom: 8px;
        gap: 6px;
    }
    
    .cij3-dot {
        width: 7px;
        height: 7px;
    }
}

/* ==========================================
   PICTURE TAG - RESPONSIVIDADE DE IMAGENS
========================================== */
.cij3-slide picture {
    display: block;
    width: 100%;
    height: 100%;
}

.cij3-slide picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================
   LAZY LOADING
========================================== */
.cij3-slide-image.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.cij3-slide-image.lazy.loaded {
    opacity: 1;
}

/* ==========================================
   MODO ESCURO (Dark Mode)
========================================== */
@media (prefers-color-scheme: dark) {
    .cij3-carrossel-empty {
        background: #1d2327;
        border-color: #3c434a;
        color: #c3c4c7;
    }
    
    .cij3-carrossel-loading {
        background: #1d2327;
    }
}

/* ==========================================
   ANIMAÇÕES ADICIONAIS
========================================== */
@keyframes cij3-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes cij3-slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes cij3-slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==========================================
   TOUCH DEVICES - GESTOS
========================================== */
@media (hover: none) and (pointer: coarse) {
    .cij3-arrow:hover {
        transform: translateY(-50%); /* Remove scale em touch */
    }
    
    .cij3-dot:hover {
        transform: scale(1); /* Remove scale em touch */
    }
    
    /* Aumenta área de toque */
    .cij3-arrow,
    .cij3-dot {
        min-width: 44px;
        min-height: 44px;
    }
}

/* ==========================================
   PERFORMANCE - GPU ACCELERATION
========================================== */
.cij3-slide,
.cij3-arrow,
.cij3-dot {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ==========================================
   PRINT STYLES
========================================== */
@media print {
    .cij3-arrow,
    .cij3-dots {
        display: none !important;
    }
    
    .cij3-slide:not(.active) {
        display: none !important;
    }
}