/* ============================================
   VOYDBIT - Estilos Principales
   ============================================ */

/* === BASE === */
html { 
    scroll-behavior: smooth; 
}

body { 
    margin: 0; 
    background-color: #030305; 
    color: white; 
    font-family: system-ui, -apple-system, sans-serif; 
    overflow-x: hidden; 
}

/* === TRANSICIONES DE PÁGINA === */
.page-wrapper {
    animation: pageEnter 0.6s ease-out forwards;
}

@keyframes pageEnter {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade out al salir */
.page-exit {
    animation: pageExit 0.3s ease-in forwards;
}

@keyframes pageExit {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.98);
    }
}

/* Animación stagger para elementos */
.animate-stagger > * {
    opacity: 0;
    animation: staggerIn 0.5s ease-out forwards;
}

.animate-stagger > *:nth-child(1) { animation-delay: 0.1s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.15s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.2s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.25s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.3s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.35s; }
.animate-stagger > *:nth-child(7) { animation-delay: 0.4s; }
.animate-stagger > *:nth-child(8) { animation-delay: 0.45s; }
.animate-stagger > *:nth-child(9) { animation-delay: 0.5s; }
.animate-stagger > *:nth-child(10) { animation-delay: 0.55s; }

@keyframes staggerIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in suave */
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Slide up */
.slide-up {
    animation: slideUp 0.6s ease-out forwards;
}

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

/* Scale in */
.scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* === ANIMACIONES PERSONALIZADAS === */
@keyframes pulse-slow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.15; transform: scale(1.1); }
}

.animate-pulse-slow { 
    animation: pulse-slow 8s ease-in-out infinite; 
}

/* === SCROLLBAR GLOBAL === */
::-webkit-scrollbar { 
    width: 8px; 
    height: 8px; 
}

::-webkit-scrollbar-track { 
    background: #030305; 
}

::-webkit-scrollbar-thumb { 
    background: #333; 
    border-radius: 4px; 
}

::-webkit-scrollbar-thumb:hover { 
    background: #4f46e5; 
}

/* === SCROLLBAR HORIZONTAL PROYECTOS === */
.projects-scroll::-webkit-scrollbar { 
    height: 6px; 
}

.projects-scroll::-webkit-scrollbar-track { 
    background: rgba(255,255,255,0.05); 
    border-radius: 3px; 
    margin: 0 20px; 
}

.projects-scroll::-webkit-scrollbar-thumb { 
    background: rgba(99, 102, 241, 0.5); 
    border-radius: 3px; 
}

.projects-scroll::-webkit-scrollbar-thumb:hover { 
    background: rgba(99, 102, 241, 0.8); 
}

/* Firefox scrollbar */
.projects-scroll { 
    scrollbar-width: thin; 
    scrollbar-color: rgba(99, 102, 241, 0.5) rgba(255,255,255,0.05); 
}

/* === SELECCIÓN DE TEXTO === */
::selection { 
    background: rgba(99, 102, 241, 0.3); 
    color: #c7d2fe; 
}

/* === BOTÓN FLOTANTE VOLVER ARRIBA === */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.05);
}

.back-to-top:active {
    transform: translateY(0) scale(0.95);
}

/* Animación de pulso suave para el botón */
@keyframes gentlePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
}

.back-to-top.visible {
    animation: gentlePulse 2s ease-in-out infinite;
}

.back-to-top:hover {
    animation: none;
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.3);
}
