/* ==========================================
   APPFUTURE GROUP SAS - ESTILOS PERSONALIZADOS
   Complemento a Tailwind CSS
   ========================================== */

/* Reset y configuración base */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Compensar el header fijo */
}

body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Selección de texto */
::selection {
    background-color: rgba(6, 182, 212, 0.3);
    color: #0f172a;
}

/* ==========================================
   LOGO
   ========================================== */

#header img[src*="LogoApp_7.png"],
footer img[src*="LogoApp_7.png"] {
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    display: block;
}

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

/* Animación de entrada desde abajo */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* Animación de entrada desde la izquierda */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* Animación de entrada desde la derecha */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* Animación de escala */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation: scaleIn 0.6s ease-out forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* Animación de pulso personalizada */
@keyframes pulse-soft {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.animate-pulse-soft {
    animation: pulse-soft 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Animación de brillo en bordes */
@keyframes borderGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(6, 182, 212, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(6, 182, 212, 0.4), 0 0 40px rgba(6, 182, 212, 0.2);
    }
}

.service-card:focus-within,
.service-card:hover {
    animation: borderGlow 2s ease-in-out infinite;
}

/* ==========================================
   HEADER / NAVBAR
   ========================================== */

/* Estado del header al hacer scroll */
.header-scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background-color: rgba(15, 23, 42, 0.98) !important;
}

/* Efecto hover en enlaces de navegación */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #06b6d4, #14b8a6);
    transition: width 0.3s ease;
    border-radius: 1px;
}

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

/* ==========================================
   HERO SECTION
   ========================================== */

/* Efecto de texto gradiente */
.text-gradient {
    background: linear-gradient(135deg, #06b6d4, #14b8a6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Indicador de scroll animado */
@keyframes bounce-custom {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}

.scroll-indicator {
    animation: bounce-custom 2s ease-in-out infinite;
}

/* ==========================================
   TARJETAS DE SERVICIOS
   ========================================== */

.service-card {
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, transparent, rgba(6, 182, 212, 0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.service-card:hover::before {
    opacity: 1;
}

/* Enlace "Más información" con detalle visual */
.service-card a[href="#contacto"] {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.service-card a[href="#contacto"]::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
}

.service-card a[href="#contacto"]:hover::after {
    width: 100%;
}

.service-card a[href="#contacto"]:hover {
    transform: translateX(2px);
}

/* Efecto de sombra dinámica */
.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(6, 182, 212, 0.1);
}

/* Icono con efecto de escala */
.service-card:hover .w-14 {
    transform: scale(1.1) rotate(5deg);
    transition: transform 0.3s ease;
}

/* ==========================================
   SECCIÓN DE DOLOR
   ========================================== */

.dolor-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dolor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.3);
}

/* Icono con animación de pulso en hover */
.dolor-card:hover .w-12 {
    animation: pulse-soft 1.5s ease-in-out infinite;
}

/* ==========================================
   FORMULARIO DE CONTACTO
   ========================================== */

/* Estilos de inputs */
.form-input {
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.form-input:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.1);
    outline: none;
}

.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
    background-color: #fef2f2;
}

.form-input.success {
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* Select personalizado */
select.form-input {
    background-image: none;
    cursor: pointer;
}

/* Checkbox personalizado */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

input[type="checkbox"]:checked {
    background-color: #06b6d4;
    border-color: #06b6d4;
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="checkbox"]:focus {
    ring: 2px;
    ring-color: #06b6d4;
}

/* Textarea */
textarea.form-input {
    resize: vertical;
    min-height: 120px;
}

/* Botón de envío */
.submit-btn {
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.submit-btn:active::before {
    width: 300px;
    height: 300px;
}

/* ==========================================
   MODAL DE ÉXITO
   ========================================== */

.modal-overlay {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-panel {
    animation: modalEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* ==========================================
   FOOTER
   ========================================== */

.footer-link {
    position: relative;
    display: inline-block;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #06b6d4;
    transition: width 0.3s ease;
}

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

/* ==========================================
   ANIMACIONES DE SCROLL EN SECCIONES
   ========================================== */

section {
    opacity: 1;
}

section.section-visible {
    opacity: 1;
}

/* ==========================================
   UTILIDADES Y RESPONSIVE
   ========================================== */

/* Ocultar elementos (útil para accesibilidad) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Estilos de scrollbar personalizada (Webkit) */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 5px;
    border: 2px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Ajustes para móviles pequeños */
@media (max-width: 640px) {
    html {
        scroll-padding-top: 70px;
    }

    .service-card:hover {
        transform: translateY(-4px);
    }

    .dolor-card:hover {
        transform: translateY(-3px);
    }
}

/* Mejora de rendimiento: usa GPU para animaciones */
.service-card,
.dolor-card,
.nav-link,
.footer-link {
    will-change: transform;
}

/* Patrón de fondo sutil */
.pattern-bg {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2306b6d4' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ==========================================
   BANNER DE COOKIES
   ========================================== */

#cookie-banner {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#cookie-banner.show {
    transform: translateY(0);
}

#cookie-banner.hide {
    transform: translateY(100%);
}

/* Efecto de carga suave */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==========================================
   IMÁGENES DE FONDO EN SECCIONES
   ========================================== */

section img.bg-image {
    object-position: center;
    display: block !important;
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
}

#hero img.bg-image[src*="home.jpg"] {
    object-position: center 30%;
}

#servicios img.bg-image[src*="soluciones.jpg"] {
    object-position: center;
}

#por-que img.bg-image[src*="desafios.jpg"] {
    object-position: center 40%;
}
