/**
 * =====================================================
 * PREMIUM WELCOME MESSAGE - Red Social Profesional
 * Diseño de clase mundial para mensajes de bienvenida
 * =====================================================
 */

/* ===== CONTENEDOR PRINCIPAL ===== */
.premium-welcome-message {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 1rem;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    animation: premiumWelcomeSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.2s ease;
}

.premium-welcome-message:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
}

/* ===== CONTENIDO INTERNO ===== */
.premium-welcome-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    position: relative;
    overflow: hidden;
}

/* ===== FONDO GRADIENTE ANIMADO (SUBTIL) ===== */
.premium-welcome-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(83, 252, 27, 0.02) 0%,
        rgba(83, 252, 27, 0.01) 50%,
        rgba(83, 252, 27, 0.02) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.premium-welcome-message:hover::before {
    opacity: 1;
}

/* ===== ICONO (SUBTIL) ===== */
.premium-welcome-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: none;
    position: relative;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.premium-welcome-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    z-index: 1;
}

.premium-welcome-icon svg {
    width: 32px;
    height: 32px;
    display: block;
    position: relative;
    z-index: 2;
    filter: none;
    opacity: 0.9;
}

/* Eliminado el efecto glow para hacerlo más sutil */

/* ===== TEXTO (SUBTIL) ===== */
.premium-welcome-text {
    flex: 1;
    min-width: 0;
}

.premium-welcome-title {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #0f1419;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.premium-welcome-subtitle {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 400;
    color: #536471;
    line-height: 1.4;
}

/* ===== VARIANTE PARA CUENTAS VINCULADAS (SUBTIL) ===== */
.premium-welcome-linked {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}

.premium-welcome-linked .premium-welcome-icon {
    background: #f8f9fa;
    box-shadow: none;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* ===== ANIMACIONES (SUBTILES) ===== */
@keyframes premiumWelcomeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Eliminadas animaciones de pulso y glow para hacerlo más sutil */

/* ===== TEMA OSCURO (SUBTIL) ===== */
[data-theme="dark"] .premium-welcome-message,
body.dark-mode .premium-welcome-message {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .premium-welcome-title,
body.dark-mode .premium-welcome-title {
    color: #e7e9ea;
}

[data-theme="dark"] .premium-welcome-subtitle,
body.dark-mode .premium-welcome-subtitle {
    color: #71767b;
}

[data-theme="dark"] .premium-welcome-linked,
body.dark-mode .premium-welcome-linked {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .premium-welcome-icon,
body.dark-mode .premium-welcome-icon {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.1);
}

/* ===== RESPONSIVE ===== */
/* ===== RESPONSIVE MÓVIL - DISEÑO PROFESIONAL ===== */
@media (max-width: 768px) {
    .premium-welcome-message {
        margin: 0 auto 1rem;
        border-radius: 14px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    }
    
    .premium-welcome-content {
        padding: 1rem 1.25rem;
        gap: 1rem;
    }
    
    .premium-welcome-icon {
        width: 52px;
        height: 52px;
        border-radius: 12px;
        flex-shrink: 0;
    }
    
    .premium-welcome-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .premium-welcome-title {
        font-size: 1rem;
        margin-bottom: 0.375rem;
        line-height: 1.3;
    }
    
    .premium-welcome-subtitle {
        font-size: 0.875rem;
        line-height: 1.4;
    }
    
    .premium-welcome-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        border-radius: 8px;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        touch-action: manipulation;
    }
    
    .premium-welcome-close svg {
        width: 16px;
        height: 16px;
    }
    
    .premium-welcome-close:active {
        transform: scale(0.9);
        background: rgba(0, 0, 0, 0.12);
    }
}

@media (max-width: 480px) {
    .premium-welcome-message {
        margin: 0 auto 0.875rem;
        border-radius: 12px;
    }
    
    .premium-welcome-content {
        padding: 0.875rem 1rem;
        gap: 0.875rem;
    }
    
    .premium-welcome-icon {
        width: 48px;
        height: 48px;
        border-radius: 11px;
    }
    
    .premium-welcome-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .premium-welcome-title {
        font-size: 0.9375rem;
        margin-bottom: 0.25rem;
        line-height: 1.35;
    }
    
    .premium-welcome-subtitle {
        font-size: 0.8125rem;
        line-height: 1.4;
    }
    
    .premium-welcome-close {
        top: 0.625rem;
        right: 0.625rem;
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
        border-radius: 7px;
    }
    
    .premium-welcome-close svg {
        width: 14px;
        height: 14px;
    }
}

/* Móviles muy pequeños */
@media (max-width: 375px) {
    .premium-welcome-message {
        margin: 0 auto 0.75rem;
    }
    
    .premium-welcome-content {
        padding: 0.75rem 0.875rem;
        gap: 0.75rem;
    }
    
    .premium-welcome-icon {
        width: 44px;
        height: 44px;
    }
    
    .premium-welcome-icon svg {
        width: 26px;
        height: 26px;
    }
    
    .premium-welcome-title {
        font-size: 0.875rem;
    }
    
    .premium-welcome-subtitle {
        font-size: 0.75rem;
    }
    
    .premium-welcome-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
    }
}

/* Safe Areas para dispositivos con notch */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .premium-welcome-message {
            margin-left: max(0.5rem, env(safe-area-inset-left));
            margin-right: max(0.5rem, env(safe-area-inset-right));
        }
    }
}

/* Optimización de animaciones en móviles */
@media (prefers-reduced-motion: reduce) {
    .premium-welcome-message {
        animation: none !important;
    }
    
    .premium-welcome-icon {
        animation: none !important;
    }
}

/* ===== INTEGRACIÓN CON FLASH MESSAGES DE CAKEPHP ===== */
/* Ocultar completamente el contenedor Flash estándar cuando contiene mensaje premium */
.flash.flash--success.alert.alert-success:has(.premium-welcome-message),
.alert.alert-success:has(.premium-welcome-message),
.flash-message:has(.premium-welcome-message),
div.flash.flash--success.alert.alert-success:has(.premium-welcome-message),
div[class*="flash"][class*="success"]:has(.premium-welcome-message),
div[class*="alert"][class*="success"]:has(.premium-welcome-message) {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-width: 0 !important;
    padding: 0 !important;
    margin: 0 0 1rem 0 !important;
    box-shadow: none !important;
    color: transparent !important;
    min-height: 0 !important;
    height: auto !important;
    display: block !important;
}

/* Fallback para navegadores sin soporte :has() - aplicar directamente al contenedor cuando tiene clase premium-welcome-message */
.flash.flash--success.alert.alert-success .premium-welcome-message ~ *,
.alert.alert-success .premium-welcome-message ~ * {
    display: none !important;
}

/* Fallback para navegadores que no soportan :has() */
.flash.flash--success.alert.alert-success .premium-welcome-message,
.alert.alert-success .premium-welcome-message,
.flash-message .premium-welcome-message {
    margin: 0;
    border-radius: 12px;
    background: #ffffff;
}

/* Ocultar cualquier contenido adicional del Flash estándar */
.flash.flash--success.alert.alert-success:has(.premium-welcome-message)::before,
.flash.flash--success.alert.alert-success:has(.premium-welcome-message)::after,
.alert.alert-success:has(.premium-welcome-message)::before,
.alert.alert-success:has(.premium-welcome-message)::after {
    display: none !important;
    content: none !important;
}

/* Ocultar iconos o elementos adicionales del alert estándar */
.flash.flash--success.alert.alert-success:has(.premium-welcome-message) > *:not(.premium-welcome-message),
.alert.alert-success:has(.premium-welcome-message) > *:not(.premium-welcome-message) {
    display: none !important;
}

/* ===== EFECTO DE CIERRE SUAVE ===== */
.premium-welcome-message.closing {
    animation: premiumWelcomeSlideOut 0.4s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes premiumWelcomeSlideOut {
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
        max-height: 0;
        margin: 0;
        padding: 0;
    }
}

/* ===== BOTÓN DE CERRAR (DISEÑO PROFESIONAL) ===== */
.premium-welcome-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
    color: #536471;
    padding: 0;
    margin: 0;
}

.premium-welcome-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
    color: #0f1419;
    transform: scale(1);
}

.premium-welcome-close:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.1);
}

.premium-welcome-close svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
    margin: 0;
    padding: 0;
}

/* Asegurar que el SVG esté perfectamente centrado */
.premium-welcome-close svg path {
    vector-effect: non-scaling-stroke;
}

[data-theme="dark"] .premium-welcome-close,
body.dark-mode .premium-welcome-close {
    color: #71767b;
    background: transparent;
}

[data-theme="dark"] .premium-welcome-close:hover,
body.dark-mode .premium-welcome-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e7e9ea;
}

/* ===== MEJORAS DE ACCESIBILIDAD ===== */
.premium-welcome-message {
    outline: none;
}

.premium-welcome-message:focus-visible {
    outline: 2px solid #53fc1b;
    outline-offset: 2px;
}

/* ===== EFECTO DE PARTICULAS ELIMINADO PARA DISEÑO SUTIL ===== */
.premium-welcome-content {
    position: relative;
    z-index: 1;
}

/* ===== SOPORTE PARA MÚLTIPLES PROVEEDORES ===== */
.premium-welcome-message[data-provider="google"] .premium-welcome-icon {
    background: #f8f9fa;
    box-shadow: none;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.premium-welcome-message[data-provider="google"] .premium-welcome-icon::before {
    background: rgba(255, 255, 255, 0.5);
}

.premium-welcome-message[data-provider="facebook"] .premium-welcome-icon {
    background: #f8f9fa;
    box-shadow: none;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.premium-welcome-message[data-provider="facebook"] .premium-welcome-icon svg {
    filter: none;
    opacity: 0.9;
}
