/* ============================================================
   Panorama Mercados — Header/Menu padronizado
   Estilos compartilhados pelo cabeçalho igual ao de panorama.html
   (mega menus, sino de Monitoramento Inteligente, botão PRO, menu mobile)
   ============================================================ */

.nav-mega-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.nav-mega-item:hover {
    background: rgba(251, 191, 36, 0.06);
}
.nav-mega-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.nav-mega-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #e6edf3;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-mega-item:hover .nav-mega-title { color: #fff; }
.nav-mega-icon-img {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    padding: 4px;
}
.nav-mega-icon-img img { width: 100%; height: 100%; object-fit: contain; border-radius: 4px; }
.nav-mega-desc {
    font-size: 0.66rem;
    color: var(--text-dim, #7c8ba1);
    margin-top: 2px;
}

.avatar-stack {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.avatar-stack img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #0a1017;
    margin-left: -10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.avatar-stack img:first-child { margin-left: 0; }

.nav-profile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(251, 191, 36, 0.04);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim, #7c8ba1);
    transition: all 0.3s ease;
}
.nav-profile-btn:hover {
    border-color: var(--accent-cyan, #fbbf24);
    color: white;
    background: rgba(251, 191, 36, 0.08);
    box-shadow: var(--glow-cyan, 0 0 24px rgba(251, 191, 36, 0.25));
    transform: scale(1.05);
}

/* Botão PRO Premium com efeito 3D e borda animada (igual ao de panorama.html) */
.pro-btn-premium {
    background: #060a10;
    color: #fff;
    position: relative;
    z-index: 1;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    border: none;
    perspective: 1000px;
    transform-style: preserve-3d;
}
.pro-btn-premium::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, #fbbf24, #fbbf24, #fbbf24, transparent);
    animation: rotate-border 4s linear infinite;
    z-index: -2;
}
.pro-btn-premium::after {
    content: "";
    position: absolute;
    inset: 2px;
    background: #060a10;
    border-radius: inherit;
    z-index: -1;
    transition: background 0.3s;
}
@keyframes rotate-border {
    100% { transform: rotate(360deg); }
}
.pro-btn-premium:hover {
    transform: rotateX(10deg) rotateY(-5deg) translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(251, 191, 36, 0.35);
}
.pro-btn-premium:hover::after {
    background: #101a26;
}

/* Sino de Monitoramento Inteligente (alertas) */
.alerts-trigger { position: relative; }
.alerts-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background-color: #ff3b5c;
    border-radius: 50%;
    border: 2px solid #05070a;
    display: none;
    animation: pulse-red 2s infinite;
}
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 59, 92, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(255, 59, 92, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 59, 92, 0); }
}

#alerts-panel {
    position: absolute;
    top: 60px;
    right: 0;
    width: 320px;
    background: rgba(10, 16, 23, 0.97);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(251, 191, 36, 0.15);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 24px rgba(251, 191, 36, 0.25);
    padding: 1rem;
    z-index: 100;
    display: none;
    max-height: 400px;
    overflow-y: auto;
    transform-origin: top right;
    animation: scaleIn 0.2s ease-out;
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.alert-item {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 12px;
    transition: background 0.2s;
    cursor: pointer;
}
.alert-item:last-child { border-bottom: none; }
.alert-item:hover { background: rgba(251, 191, 36, 0.05); }

.alert-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}
.alert-icon.urgent { background: rgba(255, 59, 92, 0.18); color: #ff3b5c; }
.alert-icon.info { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }
.alert-icon.trend { background: rgba(57, 255, 140, 0.18); color: #39ff8c; }
.alert-icon.gold { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }

.alert-content h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px 0;
}
.alert-content p {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0;
    line-height: 1.3;
}
.alert-time {
    font-size: 0.65rem;
    color: #6b7280;
    margin-top: 4px;
    display: block;
    font-family: 'JetBrains Mono', monospace;
}

.tag-badge {
    font-size: 0.6rem;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    display: inline-block;
}
.tag-high { background: #ff3b5c; color: white; }
.tag-break { background: #fbbf24; color: black; }
.tag-event { background: #fbbf24; color: black; }

.custom-scroll::-webkit-scrollbar { width: 6px; }
.custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(251, 191, 36, 0.15);
    border-radius: 10px;
}

/* Menu mobile (hambúrguer) */
#mobile-mercados-list, #mobile-dados-list {
    transition: all 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
}
#mobile-mercados-list.open, #mobile-dados-list.open {
    max-height: 300px;
    padding-top: 1rem;
}
