/* Estilos para el Componente de Rastreo de Guías */

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

.tracking-section-animate {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Mejora visual del input en focus */
#trackingForm input:focus {
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(1, 155, 220, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(1, 155, 220, 0);
    }
}

/* Mejora de accesibilidad */
#trackingForm button:focus {
    outline: 2px solid #019BDC;
    outline-offset: 4px;
}

#trackingForm input:focus-visible {
    outline: 2px solid #019BDC;
    outline-offset: 2px;
}

/* Animación de hover suave para el botón */
#trackingForm button {
    position: relative;
    overflow: hidden;
}

#trackingForm button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#trackingForm button:hover::before {
    width: 300px;
    height: 300px;
}

/* Animación de loading para el botón (opcional) */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.tracking-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Efectos hover para los círculos decorativos */
.tracking-section-animate .absolute.opacity-5 > div {
    transition: transform 0.8s ease-out;
}

.tracking-section-animate:hover .absolute.opacity-5 > div:nth-child(1) {
    transform: scale(1.05) rotate(5deg);
}

.tracking-section-animate:hover .absolute.opacity-5 > div:nth-child(2) {
    transform: scale(1.05) rotate(-5deg);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    #trackingForm input {
        font-size: 16px; /* Prevenir zoom en iOS */
    }
}

/* Mejora para el placeholder */
#trackingForm input::placeholder {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

#trackingForm input:focus::placeholder {
    opacity: 0.3;
}

/* Animación suave para mensajes de error/éxito */
.tracking-message {
    animation: slideDown 0.3s ease-out;
}

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

/* Estilo para el estado de validación */
#trackingForm input.invalid {
    border-color: #EF4444;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

#trackingForm input.valid {
    border-color: #10B981;
}

/* Transiciones suaves para todos los elementos interactivos */
#trackingForm * {
    transition-property: color, background-color, border-color, transform, box-shadow;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}
