/* Animaciones globales */

/* Keyframes principales */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes float-up {
    0% {
        opacity: 0;
        transform: translateY(100%) translateX(0);
    }

    5% {
        opacity: var(--opacity);
        transform: translateY(90%) translateX(var(--translateX));
    }

    95% {
        opacity: var(--opacity);
        transform: translateY(5%) translateX(calc(-1 * var(--translateX)));
    }

    100% {
        opacity: 0;
        transform: translateY(0) translateX(0);
    }
}

@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    }

    50% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.6), 0 0 0 8px rgba(37, 211, 102, 0.1);
    }

    100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    }
}

/* Animación de pulsación */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animación de pulsación para WhatsApp */
@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    }

    50% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.6), 0 0 0 8px rgba(37, 211, 102, 0.1);
    }

    100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    }
}

/* =================================
   MODALES GLOBALES DE ANIMACIONES
   ================================= */

/* Clase para prevenir scroll cuando los modales están activos */
.no-scroll {
    overflow: hidden !important;
}

/* Estilos base para todos los modales de animación */
.global-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.global-animation.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.animation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.animation-content {
    position: relative;
    background: rgba(30, 30, 30, 0.95);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(245, 124, 0, 0.2);
    backdrop-filter: blur(15px);
}

.global-animation.active .animation-content {
    transform: scale(1) translateY(0);
}

.animation-message {
    font-size: 1.1rem;
    color: #ffffff;
    margin: var(--spacing-md) 0 0 0;
    line-height: 1.5;
}

/* =================================
   ANIMACIÓN DE CARGA (LOADING)
   ================================= */

.loading-animation .animation-overlay {
    background: rgba(0, 0, 0, 0.85);
}

.loading-content {
    background: rgba(30, 30, 30, 0.95);
    border: 2px solid var(--color-accent);
}

.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto var(--spacing-md) auto;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(1) {
    animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
    animation-delay: 0.1s;
    transform: scale(0.8);
    border-top-color: var(--color-accent-hover);
}

.spinner-ring:nth-child(3) {
    animation-delay: 0.2s;
    transform: scale(0.6);
    border-top-color: var(--color-accent);
}

.spinner-ring:nth-child(4) {
    animation-delay: 0.3s;
    transform: scale(0.4);
    border-top-color: #E65100;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-content .animation-message {
    color: var(--color-accent);
    font-weight: 500;
}

/* =================================
   ANIMACIÓN DE ÉXITO (SUCCESS)
   ================================= */

.success-animation .animation-overlay {
    background: rgba(76, 175, 80, 0.15);
}

.success-content {
    background: rgba(30, 30, 30, 0.95);
    border: 2px solid #4CAF50;
}

.success-icon {
    font-size: 4rem;
    color: #4CAF50;
    margin-bottom: var(--spacing-md);
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-content .animation-message {
    color: #4CAF50;
    font-weight: 600;
}

/* =================================
   ANIMACIÓN DE ERROR
   ================================= */

.error-animation .animation-overlay {
    background: rgba(244, 67, 54, 0.15);
}

.error-content {
    background: rgba(30, 30, 30, 0.95);
    border: 2px solid #FF5252;
}

.error-icon {
    font-size: 4rem;
    color: #FF5252;
    margin-bottom: var(--spacing-md);
    animation: shake 0.6s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.error-content .animation-message {
    color: #FF5252;
    font-weight: 600;
}

/* =================================
   ANIMACIÓN DE ADVERTENCIA (WARNING)
   ================================= */

.warning-animation .animation-overlay {
    background: rgba(255, 193, 7, 0.15);
}

.warning-content {
    background: rgba(30, 30, 30, 0.95);
    border: 2px solid #FFC107;
}

.warning-icon {
    font-size: 4rem;
    color: #FFC107;
    margin-bottom: var(--spacing-md);
    animation: pulse 1s ease infinite;
}

.warning-content .animation-message {
    color: #FFC107;
    font-weight: 600;
}

/* =================================
   ANIMACIÓN DE CONFIRMACIÓN
   ================================= */

.confirm-animation .animation-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.confirm-content {
    background: rgba(30, 30, 30, 0.95);
    border: 2px solid var(--color-accent);
    max-width: 450px;
}

.confirm-icon {
    font-size: 3.5rem;
    color: var(--color-accent);
    margin-bottom: var(--spacing-md);
    animation: pulse 2s ease infinite;
}

.confirm-title {
    font-size: 1.3rem;
    color: #ffffff;
    margin: 0 0 var(--spacing-sm) 0;
    font-weight: 600;
}

.confirm-content .animation-message {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--spacing-lg);
}

.confirm-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

.confirm-btn {
    min-width: 120px;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

/* Botón secundario (Cancelar) */
.confirm-btn.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.confirm-btn.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Botón primario (Aceptar) */
.confirm-btn.btn-primary {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light)100%);
    color: #ffffff;
    border: 1px solid var(--color-accent);
}

.confirm-btn.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-accent-hover) 0%, var(--color-accent) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 124, 0, 0.4);
}

.confirm-btn:active {
    transform: translateY(0);
}

/* =================================
   RESPONSIVE DESIGN
   ================================= */

@media (max-width: 480px) {
    .animation-content {
        width: 95%;
        padding: var(--spacing-lg);
        margin: var(--spacing-md);
    }

    .confirm-buttons {
        flex-direction: column;
    }

    .confirm-btn {
        width: 100%;
    }

    .loading-spinner,
    .success-icon,
    .error-icon,
    .warning-icon,
    .confirm-icon {
        font-size: 3rem;
    }

    .animation-message {
        font-size: 1rem;
    }

    .confirm-title {
        font-size: 1.2rem;
    }
}

/* =================================
   TEMA OSCURO SERVETEC
   ================================= */

@media (prefers-color-scheme: dark) {
    .animation-content {
        background: rgba(30, 30, 30, 0.98);
        border-color: rgba(245, 124, 0, 0.3);
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
    }

    .animation-overlay {
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(10px);
    }

    .loading-content,
    .success-content,
    .error-content,
    .warning-content,
    .confirm-content {
        background: rgba(30, 30, 30, 0.98);
    }
}