/**
 * ESTILOS PERSONALIZADOS - MAGDA RANGEL
 * Complemento a Tailwind CSS
 */

/* ============================================
   ANIMACIONES
   ============================================ */

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate-slide-up {
    animation: slideUp 0.6s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.animate-fade-in-scale {
    animation: fadeInScale 0.7s ease-out;
}

.animate-slide-down {
    animation: slideDown 0.6s ease-out;
}

/* ============================================
   ANIMACIONES DE ENTRADA PARA SECCIONES
   ============================================ */

/* Animación de entrada suave */
.section-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-animate.active {
    opacity: 1;
    transform: translateY(0);
}

/* Animación con delay para elementos hijos */
.stagger-animate > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out,
                transform 0.6s ease-out;
}

.stagger-animate.active > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-animate.active > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-animate.active > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-animate.active > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-animate.active > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-animate.active > *:nth-child(6) { transition-delay: 0.6s; }

.stagger-animate.active > * {
    opacity: 1;
    transform: translateY(0);
}

/* Animación de escala suave */
.scale-animate {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.7s ease-out,
                transform 0.7s ease-out;
}

.scale-animate.active {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   MENÚ MÓVIL ESTILO APPLE
   ============================================ */

/* Overlay del menú */
#mobile-menu {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.72);
}

/* Animación del overlay */
#mobile-menu.menu-opening {
    animation: menuSlideIn 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

#mobile-menu.menu-closing {
    animation: menuSlideOut 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes menuSlideIn {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes menuSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-100%);
    }
}

/* Items del menú móvil con animación stagger */
#mobile-menu .menu-item {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
}

#mobile-menu.active .menu-item {
    opacity: 1;
    transform: translateX(0);
}

#mobile-menu.active .menu-item:nth-child(1) { transition-delay: 0.1s; }
#mobile-menu.active .menu-item:nth-child(2) { transition-delay: 0.15s; }
#mobile-menu.active .menu-item:nth-child(3) { transition-delay: 0.2s; }
#mobile-menu.active .menu-item:nth-child(4) { transition-delay: 0.25s; }
#mobile-menu.active .menu-item:nth-child(5) { transition-delay: 0.3s; }

/* Efecto hover mejorado para items del menú */
#mobile-menu .menu-item:active {
    transform: scale(0.96);
}

/* Botón de cerrar con animación */
.menu-close-btn {
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.menu-close-btn:active {
    transform: scale(0.9);
}

/* ============================================
   SMOOTH SCROLL
   ============================================ */

html {
    scroll-behavior: smooth;
}

/* Offset para scroll con navbar fijo */
section[id] {
    scroll-margin-top: 80px;
}

/* ============================================
   NAVBAR EFFECTS
   ============================================ */

#navbar {
    transition: all 0.3s ease-in-out;
}

#navbar.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background: linear-gradient(to right, #0EA5E9, #8B5CF6);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ============================================
   GRADIENT EFFECTS
   ============================================ */

.gradient-text {
    background: linear-gradient(135deg, #0EA5E9, #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0EA5E9, #8B5CF6);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0284C7, #7C3AED);
}

/* ============================================
   FORM FOCUS EFFECTS
   ============================================ */

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #0EA5E9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.spinner {
    border: 3px solid rgba(14, 165, 233, 0.1);
    border-top-color: #0EA5E9;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE VIDEO EMBED
   ============================================ */

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.backdrop-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ============================================
   ANIMATIONS ON SCROLL
   ============================================ */

.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   CUSTOM SHADOWS
   ============================================ */

.shadow-custom {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.shadow-custom-hover {
    transition: box-shadow 0.3s ease;
}

.shadow-custom-hover:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .mobile-padding {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .no-print {
        display: none !important;
    }
}