/* =====================================================
   UTILIDADES Y ANIMACIONES ADICIONALES
   Estilos para el funcionamiento del app-standalone.js
   ===================================================== */

/* Animaciones de entrada */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

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

/* Fade-in para elementos con scroll */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Form error states */
.form-group.error .form-input,
.form-group.error .form-textarea {
    border-color: var(--color-error);
    background: rgba(239, 68, 68, 0.05);
}

.form-error {
    display: block;
    color: var(--color-error);
    font-size: var(--text-xs);
    margin-top: var(--space-2);
    animation: fadeInUp 0.3s ease;
}

/* Sticky header cuando hace scroll */
.site-header.scrolled {
    background: rgba(13, 13, 20, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* Toast notifications */
.toast {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

/* Canvas container para hero */
#hero-3d-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#hero-3d-container canvas {
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

/* Loading states para botones */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Smooth scrolling para navegadores que no lo soporten nativamente */
html {
    scroll-behavior: smooth;
}

/* Prevent scroll cuando menu móvil está abierto */
body.menu-open {
    overflow: hidden;
}

/* Improved focus states */
*:focus-visible {
    outline: 2px solid var(--color-brand-secondary);
    outline-offset: 2px;
}

/* Animación para items del portfolio filtrados */
[data-category] {
    opacity: 1;
    transform: scale(1);
}

/* Stagger animation para cards */
.card-grid > * {
    animation: fadeInUp 0.6s ease forwards;
}

.card-grid > *:nth-child(1) { animation-delay: 0s; }
.card-grid > *:nth-child(2) { animation-delay: 0.1s; }
.card-grid > *:nth-child(3) { animation-delay: 0.2s; }
.card-grid > *:nth-child(4) { animation-delay: 0.3s; }
.card-grid > *:nth-child(5) { animation-delay: 0.4s; }
.card-grid > *:nth-child(6) { animation-delay: 0.5s; }

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .hero-cta,
    .portfolio-filters,
    #hero-3d-container {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}
