/* ----------------------------- */
/* Slider                        */
/* ----------------------------- */

.slider-section {
    height: 100vh; /* Añade esta línea */
}

.glitch-slider {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background:black;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    overflow: hidden;
    z-index: 0;
}

.slide::before,
.slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    background-size: cover;
    background-position: center;
    opacity: 0;
}

.slide::before {
    transform: translateX(-10px);
    animation: glitch-anim-1 2s infinite linear alternate;
}

.slide::after {
    transform: translateX(10px);
    animation: glitch-anim-2 2s infinite linear alternate;
}

.slide.active {
    opacity: 1;
    animation: glitch-main 8s infinite;
}

.slide.active::before,
.slide.active::after {
    opacity: 0.7;
}

@keyframes glitch-main {
    0%, 70% { transform: translateX(0); }
    2% { transform: translateX(-5px); }
    4% { transform: translateX(5px); }
    6% { transform: translateX(-5px); }
    8% { transform: translateX(5px); }
    10% { transform: translateX(0); }
}

@keyframes glitch-anim-1 {
    0% { clip-path: polygon(0 20%, 100% 20%, 100% 30%, 0 30%); }
    10% { clip-path: polygon(0 50%, 100% 50%, 100% 60%, 0 60%); }
    20% { clip-path: polygon(0 10%, 100% 10%, 100% 20%, 0 20%); }
    30% { clip-path: polygon(0 70%, 100% 70%, 100% 80%, 0 80%); }
    40% { clip-path: polygon(0 40%, 100% 40%, 100% 50%, 0 50%); }
    50% { clip-path: polygon(0 60%, 100% 60%, 100% 70%, 0 70%); }
    60% { clip-path: polygon(0 30%, 100% 30%, 100% 40%, 0 40%); }
    70% { clip-path: polygon(0 80%, 100% 80%, 100% 90%, 0 90%); }
    80% { clip-path: polygon(0 15%, 100% 15%, 100% 25%, 0 25%); }
    90% { clip-path: polygon(0 65%, 100% 65%, 100% 75%, 0 75%); }
    100% { clip-path: polygon(0 5%, 100% 5%, 100% 15%, 0 15%); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: polygon(0 25%, 100% 25%, 100% 35%, 0 35%); }
    10% { clip-path: polygon(0 55%, 100% 55%, 100% 65%, 0 65%); }
    20% { clip-path: polygon(0 15%, 100% 15%, 100% 25%, 0 25%); }
    30% { clip-path: polygon(0 75%, 100% 75%, 100% 85%, 0 85%); }
    40% { clip-path: polygon(0 45%, 100% 45%, 100% 55%, 0 55%); }
    50% { clip-path: polygon(0 65%, 100% 65%, 100% 75%, 0 75%); }
    60% { clip-path: polygon(0 35%, 100% 35%, 100% 45%, 0 45%); }
    70% { clip-path: polygon(0 85%, 100% 85%, 100% 95%, 0 95%); }
    80% { clip-path: polygon(0 20%, 100% 20%, 100% 30%, 0 30%); }
    90% { clip-path: polygon(0 70%, 100% 70%, 100% 80%, 0 80%); }
    100% { clip-path: polygon(0 10%, 100% 10%, 100% 20%, 0 20%); }
}

.glitch-effect {
    animation: intense-glitch 0.5s linear;
}

@keyframes intense-glitch {
    0% { transform: translate(0); filter: hue-rotate(0); }
    10% { transform: translate(-5px, 2px); }
    20% { transform: translate(5px, -2px); }
    30% { transform: translate(-2px, 5px); }
    40% { transform: translate(2px, -5px); }
    50% { transform: translate(-8px, 0); filter: hue-rotate(45deg); }
    60% { transform: translate(8px, 0); }
    70% { transform: translate(0, 8px); filter: hue-rotate(90deg); }
    80% { transform: translate(0, -8px); }
    90% { transform: translate(-5px, 5px); filter: hue-rotate(135deg); }
    100% { transform: translate(0); filter: hue-rotate(0); }
}

/* ----------------------------- */
/* Efecto de TV                  */
/* ----------------------------- */

/* Efecto de líneas de TV */
.tv-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        transparent 50%,
        transparent 100%
    );
    background-size: 100% 4px;
    animation: tv-line-animation 4s linear infinite;
    pointer-events: none;
    z-index: 3;
    mix-blend-mode: overlay;
}

.tv-scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    animation: tv-scan-animation 10s linear infinite;
    pointer-events: none;
    z-index: 4;
}

/* Animaciones para líneas de TV */
@keyframes tv-line-animation {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 0 100%;
    }
}

@keyframes tv-scan-animation {
    0% {
        top: -2px;
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* Efecto glitch aleatorio */
.random-glitch {
    animation: random-glitch calc(var(--glitch-intensity, 0.5) * 1s) linear;
}

@keyframes random-glitch {
    0%, 100% {
        transform: translate(0);
        filter: hue-rotate(0);
    }
    10% {
        transform: translate(calc(var(--glitch-intensity, 0.5) * -5px), calc(var(--glitch-intensity, 0.5) * 2px));
    }
    20% {
        transform: translate(calc(var(--glitch-intensity, 0.5) * 5px), calc(var(--glitch-intensity, 0.5) * -2px));
    }
    30% {
        transform: translate(calc(var(--glitch-intensity, 0.5) * -3px), calc(var(--glitch-intensity, 0.5) * 5px));
    }
    40% {
        transform: translate(calc(var(--glitch-intensity, 0.5) * 3px), calc(var(--glitch-intensity, 0.5) * -5px));
    }
    50% {
        transform: translate(calc(var(--glitch-intensity, 0.5) * -8px), 0);
        filter: hue-rotate(calc(var(--glitch-intensity, 0.5) * 45deg));
    }
    60% {
        transform: translate(calc(var(--glitch-intensity, 0.5) * 8px), 0);
    }
    70% {
        transform: translate(0, calc(var(--glitch-intensity, 0.5) * 8px));
        filter: hue-rotate(calc(var(--glitch-intensity, 0.5) * 90deg));
    }
    80% {
        transform: translate(0, calc(var(--glitch-intensity, 0.5) * -8px));
    }
    90% {
        transform: translate(calc(var(--glitch-intensity, 0.5) * -5px), calc(var(--glitch-intensity, 0.5) * 5px));
        filter: hue-rotate(calc(var(--glitch-intensity, 0.5) * 135deg));
    }
}

/* ----------------------------- */
/* Capa de color con transparencia */
/* ----------------------------- */
.color-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #e8c6a2;
    opacity: 0.5;
    mix-blend-mode: multiply;
    z-index: 1; /* Asegúrate de que esté entre el slide y los efectos de TV */
    pointer-events: none; /* Para que no interfiera con los eventos del mouse */
}