/* =========================================================================
   PORTFOLIO SHOWCASE - CINEMATIC SLIDER & INTERACTIVE CAROUSEL v3.0
   ========================================================================= */

.cu-portfolio {
    padding: clamp(4rem, 8vw, 7rem) 0;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 50%, #f8fafc 100%);
    position: relative;
    overflow: hidden;
}

/* Orbes animados de fondo */
.cu-portfolio::before,
.cu-portfolio::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.08;
    animation: float-portfolio 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.cu-portfolio::before {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #ff006e, #8338ec);
    top: -5%;
    right: -10%;
}

.cu-portfolio::after {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #00b4d8, #8338ec);
    bottom: -10%;
    left: -10%;
    animation-delay: 4s;
}

@keyframes float-portfolio {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -40px) scale(1.15); }
    66% { transform: translate(-30px, 20px) scale(0.9); }
}

.cu-portfolio .container {
    position: relative;
    z-index: 1;
}

/* =========================================================================
   HEADER & SLIDER CONTROLS
   ========================================================================= */

.cu-portfolio-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: clamp(2rem, 4vw, 3rem);
    flex-wrap: wrap;
    gap: 2rem;
}

.cu-portfolio-title-wrap {
    flex: 1;
    min-width: 290px;
}

.cu-portfolio-eyebrow {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ff006e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.cu-portfolio-eyebrow-dot {
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #ff006e, #8338ec);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px rgba(255, 0, 110, 0.6);
}

.cu-portfolio-subtitle {
    font-size: 1.05rem;
    color: #64748b;
    margin-top: 0.6rem;
    max-width: 580px;
    line-height: 1.5;
}

.cu-portfolio-nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Controles del Deslizador */
.cu-slider-controls {
    display: flex;
    gap: 0.75rem;
}

.cu-slider-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #1e293b;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.cu-slider-btn:hover {
    background: linear-gradient(135deg, #ff006e 0%, #8338ec 100%);
    color: #ffffff;
    border-color: transparent;
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 0, 110, 0.3);
}

.cu-slider-btn:active {
    transform: scale(0.95);
}

/* =========================================================================
   FILTERS CAPSULE
   ========================================================================= */

.cu-portfolio-filters {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: clamp(2rem, 4vw, 3rem);
    padding: 0.4rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px);
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    width: fit-content;
}

.cu-filter-btn {
    padding: 0.65rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 100px;
    color: #64748b;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    overflow: hidden;
}

.cu-filter-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #ff006e 0%, #8338ec 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 100px;
}

.cu-filter-btn span {
    position: relative;
    z-index: 1;
}

.cu-filter-btn:hover {
    color: #ff006e;
}

.cu-filter-btn.active {
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(255, 0, 110, 0.2);
}

.cu-filter-btn.active::before {
    opacity: 1;
}

/* =========================================================================
   CINEMATIC SLIDER WRAP & CAROUSEL
   ========================================================================= */

.cu-projects-slider-wrap {
    position: relative;
    width: 100%;
}

/* Mascaras de desvanecimiento en bordes */
.cu-projects-slider-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 120px;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(248,250,252,1) 100%);
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.3s ease;
}

/* El carrusel horizontal */
.cu-projects-slider {
    display: flex;
    flex-direction: row;
    gap: clamp(1.5rem, 3vw, 2.5rem);
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 1.5rem 100px 2.5rem 0; /* Padding a la derecha para que la última tarjeta respire */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
}

.cu-projects-slider::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* =========================================================================
   CINEMATIC CARD
   ========================================================================= */

.cu-project-slider-card {
    flex-shrink: 0;
    width: clamp(285px, 23vw, 360px);
    aspect-ratio: 3/4.2;
    scroll-snap-align: start;
    text-decoration: none;
    position: relative;
    border-radius: 36px;
    overflow: hidden;
    background: #0f172a;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, box-shadow;
}

.cu-project-slider-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 
        0 30px 60px rgba(131, 56, 236, 0.15),
        0 0 50px rgba(255, 0, 110, 0.1);
    border-color: rgba(255, 0, 110, 0.2);
}

/* Media/Imagen de Fondo */
.cu-card-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.cu-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.cu-project-slider-card:hover .cu-card-media img {
    transform: scale(1.08);
}

/* Overlay cinematográfico con gradiente */
.cu-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, 
        rgba(15, 23, 42, 0.05) 0%, 
        rgba(15, 23, 42, 0.4) 40%, 
        rgba(15, 23, 42, 0.95) 100%
    );
    z-index: 2;
    transition: opacity 0.5s ease;
}

.cu-project-slider-card:hover .cu-card-overlay {
    background: linear-gradient(180deg, 
        rgba(15, 23, 42, 0.1) 0%, 
        rgba(15, 23, 42, 0.5) 30%, 
        rgba(15, 23, 42, 0.98) 100%
    );
}

/* Elementos suspendidos (Top-level badges) */
.cu-card-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.5rem 1.1rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 3;
    transition: all 0.4s ease;
}

.cu-project-slider-card:hover .cu-card-badge {
    background: rgba(255, 255, 255, 0.95);
    color: #ff006e;
    border-color: transparent;
    transform: translateY(-2px);
}

.cu-card-tech {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    display: flex;
    gap: 0.4rem;
    z-index: 3;
    opacity: 0.8;
    transition: opacity 0.4s ease;
}

.cu-project-slider-card:hover .cu-card-tech {
    opacity: 1;
}

.cu-tech-icon {
    width: 32px;
    height: 32px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #ffffff;
    transition: all 0.3s ease;
}

.cu-project-slider-card:hover .cu-tech-icon {
    border-color: rgba(255, 255, 255, 0.25);
}

/* Contenido de la Tarjeta (Base) */
.cu-card-content {
    position: relative;
    z-index: 3;
    padding: 2rem;
    color: #ffffff;
    display: flex;
    flex-direction: column;
}

.cu-card-category-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ff006e;
    font-weight: 700;
    margin-bottom: 0.6rem;
    display: block;
    transition: all 0.4s ease;
}

.cu-project-slider-card:hover .cu-card-category-label {
    letter-spacing: 2.5px;
}

.cu-card-title {
    font-size: clamp(1.3rem, 1.8vw, 1.75rem);
    font-weight: 800;
    line-height: 1.25;
    margin: 0;
    color: #ffffff;
    transition: all 0.4s ease;
}

.cu-card-desc {
    font-size: 0.88rem;
    color: #cbd5e1;
    line-height: 1.5;
    margin: 0.8rem 0 0 0;
    opacity: 0.9;
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cu-project-slider-card:hover .cu-card-desc {
    max-height: 80px;
    margin-bottom: 0.5rem;
}

/* Botón Ver Proyecto flotante dentro del card */
.cu-card-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffffff;
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cu-card-view-btn i {
    transition: transform 0.3s ease;
}

.cu-project-slider-card:hover .cu-card-view-btn {
    opacity: 1;
    transform: translateY(0);
}

.cu-card-view-btn:hover i {
    transform: translateX(4px);
}

/* =========================================================================
   SLIDER PROGRESS BAR
   ========================================================================= */

.cu-slider-progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 100px;
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
}

.cu-slider-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%; /* Vinculado por JS */
    background: linear-gradient(90deg, #ff006e, #8338ec);
    border-radius: 100px;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 6px rgba(255, 0, 110, 0.5);
}

/* =========================================================================
   RESPONSIVE DESIGN
   ========================================================================= */

/* Tablets */
@media (max-width: 1024px) {
    .cu-portfolio-header {
        align-items: center;
    }

    .cu-projects-slider {
        padding-right: 50px;
    }

    .cu-project-slider-card {
        width: 320px;
    }
}

/* Móviles grandes */
@media (max-width: 768px) {
    .cu-portfolio {
        padding: clamp(3rem, 8vw, 5rem) 0;
    }

    .cu-portfolio-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .cu-portfolio-nav-actions {
        width: 100%;
        justify-content: space-between;
    }

    .cu-projects-slider-wrap::after {
        width: 60px;
    }

    .cu-portfolio-filters {
        padding: 0.5rem;
        gap: 0.4rem;
        border-radius: 20px;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        white-space: nowrap;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .cu-filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.75rem;
        flex-shrink: 0;
    }

    .cu-projects-slider {
        padding-right: 20px;
        gap: 1.25rem;
    }

    .cu-project-slider-card {
        width: 290px;
        border-radius: 28px;
    }

    .cu-card-content {
        padding: 1.5rem;
    }

    .cu-card-desc {
        max-height: 80px; /* Siempre visible o semi visible en móvil para usabilidad */
        opacity: 0.95;
    }

    .cu-card-view-btn {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .cu-project-slider-card {
        width: 270px;
    }
}

/* Animaciones de filtrado de proyectos */
@keyframes cuFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes cuFadeOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
}

.cu-project-slider-card.filtering-in {
    animation: cuFadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cu-project-slider-card.filtering-out {
    animation: cuFadeOut 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: none;
}

