/* Sistema de Carrossel com Slides Interativos */

/* Container Principal do Carrossel */
.project-carousel-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* Carrossel Principal */
.project-carousel {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background: #000;
}

/* Slides Container */
.carousel-slides {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.5s ease;
}

/* Slide Individual */
.carousel-slide {
    position: relative;
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Slide Antes/Depois */
.slide-before-after {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: ew-resize;
    overflow: hidden;
    background: #000;
}

.before-after-container {
    position: relative;
    width: 100%;
    height: 100%;
    /* Otimização para performance durante o arrasto */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.before-after-container.dragging {
    /* Melhor performance durante o arrasto */
    will-change: transform;
}

.before-image, .after-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    pointer-events: none;
    /* Otimização para renderização */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.before-image {
    z-index: 1;
}

.after-image {
    z-index: 2;
    clip-path: inset(0 50% 0 0);
    /* Transição mais suave apenas quando não está sendo arrastado */
    transition: none;
}

.before-after-container:not(.dragging) .after-image {
    transition: clip-path 0.05s ease-out;
}

/* Barra deslizante do antes/depois */
.before-after-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: #fff;
    cursor: ew-resize;
    z-index: 10;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    /* Otimização para movimento suave */
    will-change: left;
    transition: none;
    /* Garantir que a barra seja sempre visível */
    pointer-events: auto;
}

.before-after-container.dragging .before-after-handle {
    /* Durante o arrasto, sem transição para resposta instantânea */
    transition: none;
}

.before-after-container:not(.dragging) .before-after-handle {
    /* Transição suave apenas quando não está sendo arrastado */
    transition: left 0.05s ease-out;
}

.before-after-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.before-after-handle::after {
    content: '⟷';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #333;
    font-weight: bold;
}

/* Labels Antes/Depois */
.before-label, .after-label {
    position: absolute;
    top: 20px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    z-index: 5;
}

.before-label {
    left: 20px;
}

.after-label {
    right: 20px;
}

/* Slide de Imagem Simples */
.slide-single {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide-single img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Setas de Navegação */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    z-index: 15;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-nav:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

/* Miniaturas */
.carousel-thumbnails {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 0 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    max-width: 100%;
}

.thumbnail-item {
    flex-shrink: 0;
    width: 60px;
    height: 45px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.thumbnail-item:hover {
    opacity: 1;
    transform: scale(1.05);
}

.thumbnail-item.active {
    border-color: #fff;
    opacity: 1;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Thumbnail para slide panorâmico */
.thumbnail-panoramic {
    position: relative;
}

.thumbnail-panoramic::after {
    content: '360°';
    position: absolute;
    top: 2px;
    right: 2px;
    background: linear-gradient(45deg, #0064c8, #00a8ff);
    color: white;
    font-size: 9px;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Container principal do tour virtual */
.slide-panoramic {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    border-radius: 8px;
}

.panoramic-viewer-container {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.panoramic-viewer-main {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: grab;
}

.panoramic-viewer-main:active {
    cursor: grabbing;
}

/* Overlay com indicadores */
.panoramic-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    transition: opacity 0.5s ease;
}

.panoramic-indicator {
    background: linear-gradient(45deg, #0064c8, #00a8ff);
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 100, 200, 0.3);
    animation: pulseGlow 2s infinite;
}

.indicator-icon {
    font-size: 20px;
    margin-right: 10px;
    animation: rotate 3s linear infinite;
}

@keyframes pulseGlow {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(0, 100, 200, 0.3);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 6px 30px rgba(0, 100, 200, 0.5);
    }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Instruções de uso */
.panoramic-instructions {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    color: white;
}

.instruction-item {
    display: flex;
    align-items: center;
    margin: 10px 0;
    font-size: 14px;
}

.instruction-icon {
    font-size: 18px;
    margin-right: 12px;
    width: 25px;
    text-align: center;
}

/* Controles avançados */
.panoramic-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 20px;
    border-radius: 30px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 15;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.control-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.control-group:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    padding-right: 15px;
}

.panoramic-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 45px;
    justify-content: center;
}

.panoramic-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.panoramic-btn.active {
    background: linear-gradient(45deg, #0064c8, #00a8ff);
    border-color: #0064c8;
    box-shadow: 0 4px 15px rgba(0, 100, 200, 0.4);
}

.panoramic-btn span:first-child {
    font-size: 14px;
}

.btn-text {
    font-size: 11px;
    font-weight: 500;
}

/* Estados de erro */
.panoramic-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    color: white;
    text-align: center;
    padding: 40px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.error-message h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #ff6b6b;
}

.error-message p {
    margin: 0 0 10px 0;
    opacity: 0.8;
}

.error-message small {
    opacity: 0.6;
    font-size: 12px;
}

/* Responsividade para tour virtual */
@media (max-width: 768px) {
    .panoramic-controls {
        bottom: 15px;
        padding: 12px 15px;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .control-group {
        gap: 6px;
    }
    
    .control-group:not(:last-child) {
        border-right: none;
        padding-right: 0;
    }
    
    .panoramic-btn {
        padding: 8px 12px;
        font-size: 11px;
        min-width: 40px;
    }
    
    .panoramic-indicator {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .instruction-item {
        font-size: 12px;
    }
    
    .instruction-icon {
        font-size: 16px;
        width: 20px;
    }
}

@media (max-width: 480px) {
    .panoramic-controls {
        bottom: 10px;
        padding: 10px;
        gap: 8px;
    }
    
    .panoramic-btn {
        padding: 6px 10px;
        min-width: 35px;
    }
    
    .btn-text {
        display: none;
    }
    
    .panoramic-instructions {
        padding: 15px;
    }
}

/* Animações */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.carousel-slide.active {
    animation: slideIn 0.5s ease;
}

/* Estados de hover e focus */
.carousel-nav:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.thumbnail-item:focus {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}

/* Melhorias de acessibilidade */
.carousel-nav[aria-disabled="true"] {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-nav[aria-disabled="true"]:hover {
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
}

/* Contador de slides - REMOVIDO conforme solicitação do usuário */
.slide-counter {
    display: none;
}

@media (max-width: 768px) {
    .project-carousel {
        height: 400px;
    }
    
    .carousel-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .carousel-prev {
        left: 10px;
    }
    
    .carousel-next {
        right: 10px;
    }
    
    .before-after-handle::before {
        width: 30px;
        height: 30px;
    }
    
    .before-after-handle::after {
        font-size: 14px;
    }
    
    .thumbnail-item {
        width: 60px;
        height: 45px;
    }
    
    .carousel-thumbnails {
        gap: 8px;
        padding: 0 10px;
    }
    
    .before-label,
    .after-label {
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .project-carousel {
        height: 300px;
    }
    
    .project-carousel-container {
        padding: 0 15px;
    }
    
    .thumbnail-item {
        width: 50px;
        height: 38px;
    }
    
    .carousel-thumbnails {
        gap: 6px;
    }
    
    .slide-info {
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 10px;
    }
    
    .slide-info h3 {
        font-size: 16px;
    }
    
    .slide-info p {
        font-size: 13px;
    }
}

/* Animações */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.carousel-slide.active {
    animation: slideIn 0.5s ease;
}

/* Estados de hover e focus */
.carousel-nav:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.thumbnail-item:focus {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}

/* Melhorias de acessibilidade */
.carousel-nav[aria-disabled="true"] {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-nav[aria-disabled="true"]:hover {
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
}
