/* ===== SCROLLBAR PERSONALIZADO - AJEDREZ DE SILICIO ===== */
/* Scrollbar sofisticado, elegante y tecnológico */

/* ===== VARIABLES CSS ===== */
:root {
    --scrollbar-width: 16px;
    --scrollbar-track-color: rgba(10, 10, 10, 0.8);
    --scrollbar-thumb-primary: linear-gradient(135deg, #c70039, #ff006e);
    --scrollbar-thumb-secondary: linear-gradient(135deg, #ff006e, #c70039);
    --scrollbar-thumb-border: rgba(255, 255, 255, 0.1);
    --scrollbar-thumb-shadow: 0 0 20px rgba(199, 0, 57, 0.6);
    --scrollbar-thumb-hover-shadow: 0 0 30px rgba(199, 0, 57, 0.8);
    --scrollbar-corner-color: rgba(10, 10, 10, 0.9);
    --scrollbar-glow-color: rgba(199, 0, 57, 0.4);
}

/* ===== SCROLLBAR PRINCIPAL ===== */
::-webkit-scrollbar {
    width: var(--scrollbar-width);
    height: var(--scrollbar-width);
}

/* ===== TRACK DEL SCROLLBAR ===== */
::-webkit-scrollbar-track {
    background: var(--scrollbar-track-color);
    border-radius: 10px;
    margin: 4px;
    position: relative;
    overflow: hidden;
}

/* Efecto de fondo animado para el track */
::-webkit-scrollbar-track::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, 
            transparent 30%, 
            rgba(199, 0, 57, 0.05) 30%, 
            rgba(199, 0, 57, 0.05) 70%, 
            transparent 70%),
        linear-gradient(-45deg, 
            transparent 30%, 
            rgba(199, 0, 57, 0.03) 30%, 
            rgba(199, 0, 57, 0.03) 70%, 
            transparent 70%);
    background-size: 20px 20px, 15px 15px;
    animation: scrollbarTrackPattern 20s linear infinite;
    border-radius: 10px;
}

/* ===== THUMB DEL SCROLLBAR ===== */
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb-primary);
    border-radius: 12px;
    border: 2px solid var(--scrollbar-thumb-border);
    box-shadow: var(--scrollbar-thumb-shadow);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Efecto de brillo interno en el thumb */
::-webkit-scrollbar-thumb::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transition: left 0.5s ease;
}

/* Efecto de patrón tecnológico en el thumb */
::-webkit-scrollbar-thumb::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    border-radius: 10px;
}

/* ===== HOVER EFFECTS ===== */
::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-secondary);
    box-shadow: var(--scrollbar-thumb-hover-shadow);
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-thumb:hover::before {
    left: 100%;
}

/* ===== ACTIVE STATE ===== */
::-webkit-scrollbar-thumb:active {
    background: linear-gradient(135deg, #ff006e, #c70039);
    box-shadow: 0 0 40px rgba(199, 0, 57, 1);
    transform: scale(1.1);
}

/* ===== CORNER DEL SCROLLBAR ===== */
::-webkit-scrollbar-corner {
    background: var(--scrollbar-corner-color);
    border-radius: 0 0 10px 0;
}

/* ===== SCROLLBAR HORIZONTAL ===== */
::-webkit-scrollbar:horizontal {
    height: var(--scrollbar-width);
}

::-webkit-scrollbar-track:horizontal {
    background: var(--scrollbar-track-color);
    border-radius: 10px;
    margin: 4px;
}

::-webkit-scrollbar-thumb:horizontal {
    background: var(--scrollbar-thumb-primary);
    border-radius: 12px;
    border: 2px solid var(--scrollbar-thumb-border);
    box-shadow: var(--scrollbar-thumb-shadow);
    min-width: 40px;
}

::-webkit-scrollbar-thumb:horizontal:hover {
    background: var(--scrollbar-thumb-secondary);
    box-shadow: var(--scrollbar-thumb-hover-shadow);
}

/* ===== SCROLLBAR PARA ELEMENTOS ESPECÍFICOS ===== */
.custom-scroll-container::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.custom-scroll-container::-webkit-scrollbar-track {
    background: rgba(10, 10, 10, 0.6);
    border-radius: 8px;
    margin: 2px;
}

.custom-scroll-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #c70039, #ff006e);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(199, 0, 57, 0.5);
}

.custom-scroll-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff006e, #c70039);
    box-shadow: 0 0 20px rgba(199, 0, 57, 0.7);
}

/* ===== SCROLLBAR PARA MODALES ===== */
.modal-content::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(10, 10, 10, 0.7);
    border-radius: 6px;
    margin: 1px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #c70039, #ff006e);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 12px rgba(199, 0, 57, 0.4);
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff006e, #c70039);
    box-shadow: 0 0 18px rgba(199, 0, 57, 0.6);
}

/* ===== SCROLLBAR PARA SECCIONES ESPECÍFICAS ===== */
.nuestra-academia::-webkit-scrollbar,
.caballo-silicio::-webkit-scrollbar,
.contact::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

.nuestra-academia::-webkit-scrollbar-track,
.caballo-silicio::-webkit-scrollbar-track,
.contact::-webkit-scrollbar-track {
    background: rgba(10, 10, 10, 0.75);
    border-radius: 8px;
    margin: 3px;
}

.nuestra-academia::-webkit-scrollbar-thumb,
.caballo-silicio::-webkit-scrollbar-thumb,
.contact::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #c70039, #ff006e);
    border-radius: 8px;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 16px rgba(199, 0, 57, 0.5);
}

.nuestra-academia::-webkit-scrollbar-thumb:hover,
.caballo-silicio::-webkit-scrollbar-thumb:hover,
.contact::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff006e, #c70039);
    box-shadow: 0 0 24px rgba(199, 0, 57, 0.7);
}

/* ===== ANIMACIONES ===== */
@keyframes scrollbarTrackPattern {
    0% {
        background-position: 0 0, 0 0;
    }
    100% {
        background-position: 40px 40px, 30px 30px;
    }
}

@keyframes scrollbarGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(199, 0, 57, 0.6);
    }
    50% {
        box-shadow: 0 0 30px rgba(199, 0, 57, 0.8);
    }
}

/* ===== EFECTO DE RESPLANDOR AL SCROLL ===== */
::-webkit-scrollbar-thumb {
    animation: scrollbarGlow 3s ease-in-out infinite;
}

/* ===== SCROLLBAR PARA FIREFOX ===== */
/* Nota: Firefox tiene soporte limitado para scrollbars personalizados */
* {
    scrollbar-width: thin;
    scrollbar-color: #c70039 rgba(10, 10, 10, 0.8);
}

/* ===== SCROLLBAR PARA EDGE ===== */
/* Edge moderno usa WebKit, pero agregamos soporte específico */
@supports (-ms-ime-align: auto) {
    ::-webkit-scrollbar {
        width: var(--scrollbar-width);
        height: var(--scrollbar-width);
    }
    
    ::-webkit-scrollbar-track {
        background: var(--scrollbar-track-color);
        border-radius: 10px;
    }
    
    ::-webkit-scrollbar-thumb {
        background: var(--scrollbar-thumb-primary);
        border-radius: 12px;
        border: 2px solid var(--scrollbar-thumb-border);
    }
}

/* ===== RESPONSIVIDAD ===== */
@media (max-width: 768px) {
    :root {
        --scrollbar-width: 12px;
    }
    
    ::-webkit-scrollbar {
        width: 12px;
        height: 12px;
    }
    
    ::-webkit-scrollbar-thumb {
        border-width: 1.5px;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    :root {
        --scrollbar-width: 10px;
    }
    
    ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }
    
    ::-webkit-scrollbar-thumb {
        border-width: 1px;
        border-radius: 6px;
    }
}

/* ===== EFECTOS ESPECIALES PARA ELEMENTOS INTERACTIVOS ===== */
.revistas-container::-webkit-scrollbar,
.pagination-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.revistas-container::-webkit-scrollbar-track,
.pagination-container::-webkit-scrollbar-track {
    background: rgba(10, 10, 10, 0.5);
    border-radius: 4px;
    margin: 1px;
}

.revistas-container::-webkit-scrollbar-thumb,
.pagination-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #c70039, #ff006e);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 8px rgba(199, 0, 57, 0.4);
}

.revistas-container::-webkit-scrollbar-thumb:hover,
.pagination-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff006e, #c70039);
    box-shadow: 0 0 12px rgba(199, 0, 57, 0.6);
}

/* ===== SCROLLBAR PARA FORMULARIOS ===== */
textarea::-webkit-scrollbar,
input::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

textarea::-webkit-scrollbar-track,
input::-webkit-scrollbar-track {
    background: rgba(10, 10, 10, 0.4);
    border-radius: 3px;
    margin: 0.5px;
}

textarea::-webkit-scrollbar-thumb,
input::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #c70039, #ff006e);
    border-radius: 3px;
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 6px rgba(199, 0, 57, 0.3);
}

textarea::-webkit-scrollbar-thumb:hover,
input::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff006e, #c70039);
    box-shadow: 0 0 8px rgba(199, 0, 57, 0.5);
}

/* ===== EFECTO DE PULSO EN EL SCROLLBAR ===== */
::-webkit-scrollbar-thumb {
    position: relative;
}

::-webkit-scrollbar-thumb::before {
    animation: scrollbarPulse 2s ease-in-out infinite;
}

@keyframes scrollbarPulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* ===== SCROLLBAR PARA NAVEGADORES WEBKIT MODERNOS ===== */
/* Soporte para navegadores WebKit más recientes */
@supports (scrollbar-gutter: stable) {
    html {
        scrollbar-gutter: stable;
    }
}

/* ===== EFECTO DE TRANSICIÓN SUAVE ===== */
* {
    scroll-behavior: smooth;
}

/* ===== SCROLLBAR INVISIBLE PARA ELEMENTOS SIN SCROLL ===== */
.no-scroll::-webkit-scrollbar {
    display: none;
}

.no-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
