/* ========================================================= 
   COMPONENT: FINANCIAL TICKER (TOP 1% GLOBAL / FINTECH)
   ========================================================= */

:root {
    --ticker-bg: #0d1f1f;
    --ticker-border: rgba(255, 255, 255, 0.08);
    --ticker-text-main: #ffffff;
    --ticker-text-muted: rgba(255, 255, 255, 0.5);
    --ticker-text-dim: rgba(255, 255, 255, 0.3);
    --ticker-height: 52px;
    --token-bg: rgba(255, 255, 255, 0.08);
}

.aiba-ticker-wrap {
    background-color: var(--ticker-bg);
    border-bottom: 1px solid var(--ticker-border);
    color: var(--ticker-text-main);
    height: var(--ticker-height);
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
}

/* --- INDICADOR LIVE (ESQUERDA) --- */
.ticker-live-indicator {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    z-index: 100;
    background-color: var(--ticker-bg); 
    display: flex;
    align-items: center;
    padding: 0 15px 0 20px;
}

.ticker-live-indicator::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0; right: -50px;
    width: 50px;
    background: linear-gradient(to right, var(--ticker-bg), transparent);
    pointer-events: none;
}

.live-badge-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-dot {
    width: 6px; height: 6px;
    background-color: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff88;
    animation: pulse-live 2s infinite;
}

.live-text {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- TRILHO DE ANIMAÇÃO --- */
.aiba-ticker-track {
    display: flex;
    align-items: center;
    gap: 60px;
    width: max-content;
    animation: ticker-scroll 60s linear infinite;
    padding-left: 200px; /* Offset para não nascer sob o badge */
}

.aiba-ticker-wrap:hover .aiba-ticker-track {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-33.3333%); }
}

/* --- ITEM DO TICKER --- */
.ticker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    white-space: nowrap;
}

.ticker-item::after {
    content: "";
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 18px;
    background-color: var(--ticker-border);
}

/* --- TOKEN ICON (UI AVANÇADA) --- */
.t-token {
    width: 34px; height: 34px;
    background: var(--token-bg);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.t-token svg {
    width: 18px; height: 18px;
    color: rgba(255, 255, 255, 0.6);
    transform: translateY(-5px); /* Espaço para o badge */
    stroke-width: 2.5px;
}

/* Badge do Ticker (Ex: SOJ, MIL) */
.t-token::after {
    content: attr(data-symbol);
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    color: #000000;
    font-size: 7px;
    font-weight: 900;
    padding: 1.5px 5px;
    border-radius: 3px;
    line-height: 1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

/* --- DADOS E TIPOGRAFIA --- */
.t-data {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.t-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.t-name {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--ticker-text-muted);
    text-transform: uppercase;
}

.t-unit {
    font-size: 0.6rem;
    color: var(--ticker-text-dim);
}

.t-vals {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.t-price {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

.t-var {
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* --- ESTADOS DE VARIAÇÃO --- */
.ticker-item.up .t-var { color: #00ff88; }
.ticker-item.down .t-var { color: #ff4d4d; }
.ticker-item.stable .t-var { color: var(--ticker-text-dim); }

/* --- GRADIENTE DIREITO --- */
.ticker-fade-r {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 80px;
    background: linear-gradient(to left, var(--ticker-bg), transparent);
    pointer-events: none;
    z-index: 5;
}

/* --- RESPONSIVO --- */
@media (max-width: 768px) {
    .live-text { display: none; }
    .aiba-ticker-track { padding-left: 80px; gap: 40px; }
    .t-token { width: 30px; height: 30px; }
    .t-price { font-size: 0.9rem; }
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.9); }
}