/* ============================================================
   HERMOSILLO IA — ADICIONES v2.0
   Agregar al FINAL de assets/style.css
   ============================================================ */

/* ── Fix footer: armonía tipográfica ── */
.chat-input-area__hint,
.chat-legal-footer {
    font-size: 0.64rem;
    color: var(--color-text-dim);
    text-align: center;
    line-height: 1.55;
    opacity: 0.8;
}

.chat-input-area__hint {
    margin-top: 8px;
    margin-bottom: 2px;
}

.chat-legal-footer {
    margin-top: 0;
}

.chat-legal-footer a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity var(--transition-fast);
}

.chat-legal-footer a:hover { opacity: 1; }

[data-theme="light"] .chat-legal-footer a { color: #C94F1A; }

/* ── Fix quick-access-item ancho y foro button ── */
.quick-access-item {
    width: 100%;
    /* Asegurar que el flex no rompa en sidebar estrecho */
    min-width: 0;
}

.quick-access-item__label,
.quick-access-item__sub {
    /* Prevenir desbordamiento en texto largo */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* ── Fix typing-indicator: resolver conflicto display:none + hidden ── */
.typing-indicator[hidden] {
    display: none !important;
}

/* ── Fix toast en mobile: no solapar con FAB ── */
@media (max-width: 768px) {
    .toast {
        bottom: 90px;
    }
}

/* ── Noticias: estilos de soporte ── */
@keyframes shimmer {
    from { opacity: 0.35; }
    to   { opacity: 0.75; }
}

.noti-card {
    display: block;
    border-radius: 10px;
    padding: 13px 15px;
    text-decoration: none;
    color: var(--color-text);
    transition: background 0.15s, transform 0.15s;
}

.noti-card:hover {
    background: var(--color-bg-3) !important;
    transform: translateX(3px);
}

/* ── FAB reporte: ajuste z-index consistente en mobile ── */
#fabReporte {
    bottom: 80px; /* Por encima del input y el toast */
}

@media (max-width: 768px) {
    #fabReporte {
        bottom: 74px;
    }
}

/* ── Sidebar: separador visual entre secciones ── */
.sidebar__section-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 4px 0;
    opacity: 0.5;
}

/* ── Barra de features: ocultar scrollbar webkit correctamente ── */
#barraFeatures::-webkit-scrollbar { display: none; }
#barraFeatures { scrollbar-width: none; -ms-overflow-style: none; }

/* ── Foro: toast propio si app.js no está cargado aún ── */
.foro-toast-fallback {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-bg-3);
    color: var(--color-text);
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-size: 0.84rem;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    animation: fade-in 0.25s ease;
}
/* ══════════════════════════════════════════════════════
   ANIMACIÓN DE PENSAMIENTO IA — Nivel Grok/Gemini
══════════════════════════════════════════════════════ */

.typing-indicator {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    flex-shrink: 0;
}

.typing-indicator__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), #C94F1A);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px var(--color-accent-glow);
    animation: avatar-thinking 2s ease-in-out infinite;
}

@keyframes avatar-thinking {
    0%, 100% { box-shadow: 0 0 0 3px var(--color-accent-glow); }
    50%       { box-shadow: 0 0 0 6px rgba(232,98,42,0.1), 0 0 16px var(--color-accent-glow); }
}

.typing-indicator__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.typing-indicator__bubbles {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--color-ai-bubble);
    border: 1px solid var(--color-border);
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    border-bottom-left-radius: 4px;
    width: fit-content;
    position: relative;
    overflow: hidden;
}

/* Barra de progreso sutil en la parte inferior */
.typing-indicator__bubbles::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 40%;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    animation: progress-sweep 1.8s ease-in-out infinite;
    border-radius: 2px;
}

@keyframes progress-sweep {
    0%   { left: -40%; width: 40%; }
    100% { left: 140%; width: 40%; }
}

/* Puntos rediseñados */
.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    opacity: 0.4;
    animation: dot-wave 1.4s ease-in-out infinite;
    flex-shrink: 0;
}

.typing-dot:nth-child(1) { animation-delay: 0s;    }
.typing-dot:nth-child(2) { animation-delay: 0.18s; }
.typing-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes dot-wave {
    0%, 60%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.4;
        background: var(--color-accent);
    }
    30% {
        transform: translateY(-5px) scale(1.2);
        opacity: 1;
        background: var(--color-accent-hover);
    }
}

/* Texto rotativo de estado */
.typing-indicator__text {
    font-size: 0.68rem;
    color: var(--color-text-dim);
    font-style: italic;
    animation: text-pulse 3.5s ease-in-out infinite;
    letter-spacing: 0.02em;
}

@keyframes text-pulse {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 1; }
}

/* Tema claro */
[data-theme="light"] .typing-dot {
    background: var(--color-accent);
}
[data-theme="light"] .typing-indicator__bubbles::after {
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
}

/* =========================================
   ESTILOS DE AUTENTICACIÓN Y PERFIL
   ========================================= */
.btn-auth {
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.btn-auth:hover { 
    transform: translateY(-2px); 
    background: var(--bg2); 
}

.btn-auth img { width: 18px; height: 18px; }

.btn-auth--facebook { 
    background: #1877F2; 
    color: white; 
    border: none; 
}

.btn-auth--facebook:hover { 
    background: #166fe5; 
}

/* Tarjeta de perfil logueado */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    border: 1px solid var(--color-border);
}

#userPhoto { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    border: 2px solid var(--color-accent); 
    object-fit: cover;
}

.user-info { 
    display: flex; 
    flex-direction: column; 
    text-align: left; 
    overflow: hidden;
}

#userName { 
    font-weight: 700; 
    font-size: 0.9rem; 
    color: var(--color-text);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.btn-logout { 
    background: none; 
    border: none; 
    color: var(--color-error); 
    font-size: 0.75rem; 
    text-align: left; 
    cursor: pointer; 
    padding: 2px 0 0 0; 
    text-decoration: underline;
}

.input-auth-email {
    width: 100%;
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.85rem;
}

.btn-link-auth {
    display: block;
    width: 100%;
    background: none;
    border: none;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-decoration: underline;
    margin-top: 8px;
    cursor: pointer;
}

/* =========================================
   ESTILOS DE SUSCRIPCIÓN PREMIUM (STRIPE)
   ========================================= */
.btn-premium-active {
    background: #FFD700;
    color: #000;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    margin-bottom: 8px;
    width: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    line-height: 1.3;
    transition: transform 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-premium-active:hover {
    transform: scale(1.02);
    background: #fcc200;
}

.btn-premium-active:disabled {
    background: var(--color-border);
    color: var(--color-text-muted);
    cursor: not-allowed;
    transform: none;
}

.user-info .btn-premium-active {
    font-size: 0.88rem;
    padding: 8px 10px;
}