/* ============================================
   ESTILOS PRINCIPALES - SALAUN CONSULTING
   ============================================ */

/* Scroll suave y evitar scroll horizontal */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

/* ============================================
   ANIMACIONES PERSONALIZADAS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(91, 45, 139, 0.5), 0 4px 15px rgba(0, 0, 0, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(91, 45, 139, 0.8), 0 8px 25px rgba(0, 0, 0, 0.4);
        transform: scale(1.05);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 1s ease-out 0.5s both, pulse-glow 3s ease-in-out 1.5s infinite;
}

/* ============================================
   HERO SWIPER
   ============================================ */
.hero-swiper {
    width: 100%;
    height: 100%;
    /* Aceleración por GPU */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

.hero-swiper .swiper-wrapper {
    /* Optimización para transiciones suaves */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.hero-swiper .swiper-slide {
    position: relative;
    /* Transición suave con aceleración GPU */
    will-change: opacity;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Asegurar que la transición sea suave */
    transition: opacity 0.6s ease-in-out;
    -webkit-transition: opacity 0.6s ease-in-out;
}

.hero-swiper .swiper-slide img {
    /* Optimización de renderizado de imágenes */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Suavizar la imagen */
    image-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

/* Optimizar el overlay del gradiente para no interferir con la transición */
.hero-swiper .swiper-slide > div {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: opacity;
}

.hero-swiper .swiper-slide > div > div[class*="bg-gradient"] {
    /* Optimizar el backdrop-blur para mejor rendimiento */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ============================================
   CONTENIDO HERO - MEJORAS DE LEGIBILIDAD
   ============================================ */
.fade-in {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mejora del contenedor del contenido hero */
header .backdrop-blur-sm {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Botones de navegación del hero */
.hero-button-next,
.hero-button-prev {
    color: white !important;
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(10px);
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
    z-index: 100 !important;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.hero-button-next:hover,
.hero-button-prev:hover {
    background: rgba(255, 255, 255, 0.4) !important;
    transform: scale(1.1) translateZ(0);
    -webkit-transform: scale(1.1) translateZ(0);
}

.hero-button-next::after,
.hero-button-prev::after {
    font-size: 24px !important;
    font-weight: bold !important;
}

/* Paginación del hero */
.hero-pagination {
    bottom: 30px !important;
    display: flex;
    justify-content: center;
    gap: 6px !important;
    z-index: 100 !important;
}

.hero-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
    transition: all 0.3s ease;
    border-radius: 50%;
    margin: 0 3px !important;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.hero-pagination .swiper-pagination-bullet-active {
    background: white;
    width: 24px;
    height: 6px;
    border-radius: 3px;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* ============================================
   PANELES DE CLIENTES
   ============================================ */
.proyecto-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 600px;
    height: 100vh;
    background: white;
    z-index: 1000;
    transition: right 0.5s ease-in-out, box-shadow 0.5s ease-in-out;
    overflow-y: auto;
}

.proyecto-panel.active {
    right: 0;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

#panelOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: none;
}

#panelOverlay.active {
    opacity: 1;
    visibility: visible;
    display: block;
}

#panelOverlay.hidden {
    display: none;
}

.panel-content {
    padding: 2rem;
}

.panel-close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #5B2D8B;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.3s ease;
}

.panel-close-button:hover {
    background: #3F1D63;
}

.panel-header {
    margin-bottom: 2rem;
}

.panel-header-image img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.panel-header-info h2 {
    font-size: 1.5rem;
    color: #5B2D8B;
    margin-bottom: 0.5rem;
}

.panel-body {
    margin-top: 2rem;
}

.panel-section {
    margin-bottom: 2rem;
}

.panel-section h3 {
    color: #5B2D8B;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.panel-section p {
    color: #2E2E2E;
    line-height: 1.6;
}

.panel-location {
    color: #6B6B6B;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-actions {
    margin-top: 2rem;
}

.panel-actions .btn-primary {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: #5B2D8B;
    color: white;
    border-radius: 9999px;
    text-decoration: none;
    transition: background 0.3s ease;
}

.panel-actions .btn-primary:hover {
    background: #3F1D63;
}

/* ============================================
   GALERÍA DEL PANEL
   ============================================ */
.panel-gallery {
    margin-top: 2rem;
}

.gallery-main-image {
    width: 100%;
    margin-bottom: 1rem;
}

.gallery-main-image img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
}

.gallery-thumbnails {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    margin-top: 1rem;
}

.gallery-thumb {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border 0.3s ease;
}

.gallery-thumb.active {
    border-color: #5B2D8B;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #D1D5DB;
    cursor: pointer;
    transition: background 0.3s ease;
}

.gallery-dot.active {
    background: #5B2D8B;
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* ============================================
   LOGOS DE CLIENTES
   ============================================ */
.logo-container {
    transition: all 0.3s ease;
    padding: 1rem !important;
    height: 7rem !important;
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%) !important;
    border-color: #4a5568 !important;
}

.logo-container:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(91, 45, 139, 0.3);
    background: linear-gradient(135deg, #5B2D8B 0%, #3F1D63 100%) !important;
}

.logo-img {
    max-width: 120px;
    max-height: 70px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: brightness(0) invert(1) opacity(0.9);
    transition: all 0.3s ease;
    display: block;
}

.logo-container:hover .logo-img {
    filter: brightness(0) invert(1) opacity(1);
    transform: scale(1.1);
}

.logo-img[alt] {
    background-color: transparent;
}

/* ============================================
   LIGHTBOX / PANTALLA COMPLETA
   ============================================ */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 80%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: white;
    color: #5B2D8B;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.lightbox-close:hover {
    background: #5B2D8B;
    color: white;
    transform: rotate(90deg);
}

/* Botones de navegación del lightbox */
.lightbox-prev,
.lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: #5B2D8B;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: #5B2D8B;
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev .material-icons,
.lightbox-next .material-icons {
    font-size: 32px;
}

.lightbox-caption {
    margin-top: 1rem;
    color: white;
    font-size: 0.95rem;
    text-align: center;
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    backdrop-filter: blur(10px);
}

/* Cursor pointer en imágenes clickeables */
.gallery-main-image img {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-main-image img:hover {
    transform: scale(1.02);
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .lightbox-close {
        top: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 44px;
        height: 44px;
    }
    
    .lightbox-prev {
        left: 1rem;
    }
    
    .lightbox-next {
        right: 1rem;
    }
    
    .lightbox-prev .material-icons,
    .lightbox-next .material-icons {
        font-size: 28px;
    }
    
    .lightbox-content {
        max-width: 95%;
    }
}
