/**
 * Custom Alert Component - ZUMAC
 * Alerta personalizada amigable y responsive para validaciones
 */

/* Overlay (fondo oscuro) */
.zumac-custom-alert {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10006; /* ✅ OPTIMIZADO: Reducido de 99999 a 10006 - Máxima prioridad sobre otros modales */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.zumac-custom-alert.zumac-alert-show {
    opacity: 1;
    pointer-events: all;
}

.zumac-alert-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

/* Contenido de la alerta - Estilo Boarding Pass */
.zumac-alert-content {
    position: relative;
    background: var(--zumac-card, #1a202c);
    border: 2px solid var(--zumac-accent, #0ea5e9);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.15),
                0 10px 25px -5px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 90%;
    margin: 20px;
    padding: 0; /* Sin padding, el contenido interno lo maneja */
    overflow: hidden;
    transform: scale(0.95) translateY(-10px);
    transition: transform 0.2s ease-out;
    animation: zumacAlertSlideIn 0.2s ease-out forwards;
}

.zumac-alert-show .zumac-alert-content {
    transform: scale(1) translateY(0);
}

/* Animación de entrada - más sutil */
@keyframes zumacAlertSlideIn {
    from {
        transform: scale(0.95) translateY(-10px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Cuerpo de la alerta - Estilo Boarding Pass */
.zumac-alert-body {
    text-align: center;
}

/* Header de la alerta - Similar a bp-header-compact */
.zumac-alert-title {
    font-size: 1rem;
    font-weight: 900;
    color: var(--zumac-white, white);
    margin: 0;
    padding: 14px 16px;
    background: var(--zumac-accent, linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%));
    border-bottom: 2px solid var(--zumac-accent, #0ea5e9);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-align: center;
}

/* Mensaje de la alerta - Similar a bp-details-compact */
.zumac-alert-message {
    padding: 16px;
    background: var(--zumac-primary, #0f172a);
    font-size: 14px;
    line-height: 1.6;
    color: var(--zumac-white, white);
    text-align: left;
}

.zumac-alert-message p {
    margin: 0 0 14px 0;
    color: var(--zumac-white, white);
}

.zumac-alert-message p:last-child {
    margin-bottom: 0;
}

/* Botón de cerrar (X) */
.zumac-alert-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    width: 32px;
    height: 32px;
}

.zumac-alert-close:hover {
    background: rgba(0, 0, 0, 0.7);
    color: white;
}

.zumac-alert-close:active {
    transform: scale(0.95);
}

/* El título siempre es blanco sobre el fondo azul */

/* Responsive: Mobile */
@media (max-width: 640px) {
    .zumac-alert-content {
        width: 92%;
        margin: 16px;
        padding: 0;
        border-radius: 12px;
    }

    .zumac-alert-title {
        font-size: 0.9rem;
        padding: 12px 16px;
    }

    .zumac-alert-message {
        font-size: 13px;
        padding: 14px;
    }

    .zumac-alert-close {
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        padding: 4px;
    }

    .zumac-alert-close svg {
        width: 16px;
        height: 16px;
    }

    /* En mobile, hacer las opciones más compactas */
    .zumac-alert-message > div {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .zumac-alert-message > div > div {
        padding: 10px !important;
        font-size: 13px !important;
    }

    .zumac-alert-message > div > div > span {
        font-size: 20px !important;
    }

    .zumac-alert-message > div > div > span:not([style*="font-size"]) {
        font-size: 13px !important;
    }
}

/* Responsive: Tablet */
@media (min-width: 641px) and (max-width: 1024px) {
    .zumac-alert-content {
        max-width: 450px;
    }
}

/* Accesibilidad: Reducir movimiento si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
    .zumac-alert-content {
        animation: none;
        transition: opacity 0.2s ease;
    }

    .zumac-alert-close:hover {
        transform: none;
    }
}

/* ===========================
   COMBINACIONES VÁLIDAS - Estilo Boarding Pass
   =========================== */

/* Cajas de combinaciones - Similar a bp-route-compact */
.zumac-alert-message > div > div[style*="border-left: 3px solid"] {
    background: var(--zumac-primary, rgba(15, 23, 42, 0.8)) !important;
    border: 1px solid var(--zumac-border, rgba(255, 255, 255, 0.1)) !important;
    border-left: 3px solid var(--zumac-accent, #0ea5e9) !important;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
    transition: all 0.2s ease;
}

.zumac-alert-message > div > div[style*="border-left: 3px solid"]:hover {
    background: var(--zumac-card, rgba(26, 32, 44, 0.9)) !important;
    border-left-color: var(--zumac-accent, #06b6d4) !important;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

/* ===========================
   SECCIÓN DE WHATSAPP
   =========================== */

.zumac-alert-body > div[style*="border-top"] {
    background: var(--zumac-background, #0f172a) !important;
    border-top: 1px solid var(--zumac-border, rgba(255, 255, 255, 0.1)) !important;
    padding: 16px !important;
    margin-top: 16px !important;
}

.zumac-alert-body > div[style*="border-top"] p {
    color: var(--zumac-text-secondary, rgba(255, 255, 255, 0.7)) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

/* ===========================
   BOTÓN DE WHATSAPP - Estilo consistente con "Otros Destinos"
   =========================== */

.zumac-whatsapp-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #25D366, #128C7E) !important;
    color: white !important;
    padding: 1rem 2rem !important;
    border-radius: 50px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3) !important;
    gap: 10px !important;
}

.zumac-whatsapp-button:hover {
    background: linear-gradient(135deg, #128C7E, #075E54) !important;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4) !important;
    transform: translateY(-2px) !important;
}

.zumac-whatsapp-button:active {
    transform: translateY(0) !important;
    box-shadow: 0 3px 10px rgba(37, 211, 102, 0.3) !important;
}

.zumac-whatsapp-button svg {
    width: 24px !important;
    height: 24px !important;
}

/* Responsive para botón de WhatsApp */
@media (max-width: 768px) {
    .zumac-whatsapp-button {
        padding: 0.85rem 1.75rem !important;
        font-size: 1rem !important;
    }
}

/* ===========================
   SOPORTE MODO OSCURO
   =========================== */

@media (prefers-color-scheme: dark) {
    .zumac-alert-content {
        background: var(--zumac-card, #1a202c);
        border-color: var(--zumac-accent, #0ea5e9);
        box-shadow: 0 4px 16px rgba(14, 165, 233, 0.2),
                    0 20px 25px -5px rgba(0, 0, 0, 0.5);
    }

    .zumac-alert-title {
        color: var(--zumac-white, #f3f4f6);
        background: var(--zumac-accent, linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%));
    }

    .zumac-alert-message {
        background: var(--zumac-primary, #0f172a);
        color: var(--zumac-white, #d1d5db);
    }

    .zumac-alert-close {
        color: var(--zumac-white, white);
        background: rgba(0, 0, 0, 0.6);
    }

    .zumac-alert-close:hover {
        background: rgba(0, 0, 0, 0.8);
        color: var(--zumac-white, white);
    }

    .zumac-alert-overlay {
        background: rgba(0, 0, 0, 0.7);
    }
}
