/**
 * Animaciones y efectos visuales para mejorar la experiencia de usuario
 */

/* Efectos de pulsación para botones de envío */
.pulse-button {
    position: relative;
    transition: all 0.3s ease;
}

.pulse-button:hover {
    transform: scale(1.05);
}

.pulse-button.success {
    animation: button-success-pulse 1.5s ease-out;
}

@keyframes button-success-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* Animación para mensaje de éxito */
.success-message {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.success-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* Efecto de entrada de formulario flotante */
.float-label-group {
    position: relative;
    margin-bottom: 20px;
}

.float-label-group input, 
.float-label-group textarea {
    font-size: 16px;
    padding: 10px 10px 10px 5px;
    display: block;
    width: 100%;
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
}

.float-label-group input:focus,
.float-label-group textarea:focus {
    outline: none;
}

.float-label-group label {
    color: #999;
    font-size: 16px;
    font-weight: normal;
    position: absolute;
    pointer-events: none;
    left: 5px;
    top: 10px;
    transition: 0.2s ease all;
}

.float-label-group input:focus ~ label, 
.float-label-group input:valid ~ label,
.float-label-group textarea:focus ~ label, 
.float-label-group textarea:valid ~ label {
    top: -20px;
    font-size: 14px;
    color: #4285f4;
}

/* Barra de progreso animada para envío */
.progress-bar-container {
    width: 100%;
    height: 4px;
    background-color: #f1f1f1;
    position: relative;
    overflow: hidden;
    display: none;
}

.progress-bar-container.active {
    display: block;
}

.progress-bar {
    height: 100%;
    background-color: #4285f4;
    position: absolute;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-bar.indeterminate {
    width: 30%;
    animation: progress-indeterminate 2s infinite linear;
}

@keyframes progress-indeterminate {
    0% {
        left: -30%;
    }
    100% {
        left: 100%;
    }
}

/* Animación de verificación para campos válidos */
.input-check-mark {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    color: #28a745;
    transition: transform 0.3s ease;
}

.input-valid .input-check-mark {
    transform: translateY(-50%) scale(1);
}

/* Animación de sacudida para notificar errores */
@keyframes shake {
    0%, 100% {transform: translateX(0);}
    10%, 30%, 50%, 70%, 90% {transform: translateX(-5px);}
    20%, 40%, 60%, 80% {transform: translateX(5px);}
}

.shake-error {
    animation: shake 0.6s ease-in-out;
}

/* Avión de papel animado para indicar envío */
.paper-plane-container {
    position: fixed;
    overflow: hidden;
    pointer-events: none;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

.paper-plane-container.active {
    display: block;
}

.paper-plane {
    position: absolute;
    width: 40px;
    height: 40px;
    background-image: url('/assets/images/paper-plane.svg');
    background-size: contain;
    background-repeat: no-repeat;
    animation: fly-plane 3s forwards ease-in-out;
}

@keyframes fly-plane {
    0% {
        top: 80%;
        left: 10%;
        transform: rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    70% {
        top: 30%;
        left: 70%;
        transform: rotate(20deg);
        opacity: 1;
    }
    100% {
        top: 10%;
        left: 90%;
        transform: rotate(45deg);
        opacity: 0;
    }
}

/**
 * Estilos para efectos de animación
 */

/* Contenedor para el avión de papel */
#paper-plane-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1001;
    pointer-events: none;
    overflow: hidden;
}

/* Animación del avión de papel */
.paper-plane-animation {
    position: absolute;
    animation: flyPlane 3s ease-in-out forwards;
}

#paper-plane {
    width: 150px;
    height: 150px;
    transform: rotate(-15deg);
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

/* Keyframes para el vuelo del avión */
@keyframes flyPlane {
    0% {
        top: 50%;
        left: -80px;
        transform: translateY(-50%) scale(0.3);
    }
    15% {
        top: 40%;
        left: 20%;
        transform: translateY(-50%) scale(0.5);
    }
    40% {
        top: 30%;
        left: 50%;
        transform: translateY(-50%) scale(0.8);
    }
    65% {
        top: 40%;
        left: 75%;
        transform: translateY(-50%) scale(0.6);
    }
    100% {
        top: 50%;
        left: 120%;
        transform: translateY(-50%) scale(0.3);
    }
}

/* Mensaje de éxito */
.success-message-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1002;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease-in;
}

.success-message-content {
    background: white;
    border-radius: 10px;
    padding: 30px 50px;
    text-align: center;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    animation: bounceIn 0.8s ease-in-out;
    max-width: 90%;
}

.success-message-content h2 {
    color: #28a745;
    margin-bottom: 15px;
}

.success-message-content p {
    margin-bottom: 0;
    color: #333;
}

/* Animaciones para el mensaje */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
} 