/* ============================================
   TICKER.CSS - Cotações de Bolsa de Valores
   Central de Notícias Brasil
   ============================================ */

/* ====== CONTAINER DO TICKER ====== */
.stock-ticker-section {
    background: #ffffff;
    padding: 0;
    overflow: hidden;
    border-bottom: 2px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stock-ticker-header {
    background: #f8fafc;
    padding: 6px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
}

.ticker-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--azul-primario);
    font-weight: 600;
    font-size: 0.75rem;
}

.ticker-title-icon {
    font-size: 0.9rem;
}

.ticker-update {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 0.65rem;
}

.ticker-update-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-update 2s infinite;
}

@keyframes pulse-update {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ====== TICKER SCROLLING ====== */
.stock-ticker-wrapper {
    overflow: hidden;
    position: relative;
}

.stock-ticker {
    display: flex;
    animation: ticker-scroll 35s linear infinite;
    padding: 8px 0;
}

.stock-ticker:hover {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ====== ITEM DO TICKER ====== */
.ticker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    margin: 0 4px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    min-width: 203px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.ticker-item:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ====== LOGO DA EMPRESA/ÍNDICE ====== */
.ticker-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    flex-shrink: 0;
}

.ticker-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

/* Logos por tipo */
.ticker-logo.ibovespa {
    background: linear-gradient(135deg, #00875a 0%, #00a86b 100%);
    color: white;
}

.ticker-logo.sp500 {
    background: linear-gradient(135deg, #1a56db 0%, #3b82f6 100%);
    color: white;
}

.ticker-logo.nasdaq {
    background: linear-gradient(135deg, #0891b2 0%, #22d3ee 100%);
    color: white;
}

.ticker-logo.dowjones {
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
    color: white;
}

.ticker-logo.dolar {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: white;
}

.ticker-logo.euro {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    color: white;
}

.ticker-logo.btc {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    color: white;
}

.ticker-logo.petrobras {
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
    color: white;
}

.ticker-logo.vale {
    background: linear-gradient(135deg, #0369a1 0%, #0ea5e9 100%);
    color: white;
}

.ticker-logo.itau {
    background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
    color: white;
}

.ticker-logo.bradesco {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: white;
}

.ticker-logo.weg {
    background: linear-gradient(135deg, #0369a1 0%, #0ea5e9 100%);
    color: white;
}

.ticker-logo.ambev {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    color: white;
}

/* ====== INFORMAÇÕES DO TICKER ====== */
.ticker-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
}

.ticker-name {
    font-size: 0.55rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ticker-symbol {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--azul-primario);
}

/* ====== VALORES E VARIAÇÃO ====== */
.ticker-values {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.ticker-price {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e293b;
}

.ticker-change {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 4px;
}

.ticker-change.up {
    background: #dcfce7;
    color: #16a34a;
}

.ticker-change.down {
    background: #fee2e2;
    color: #dc2626;
}

.ticker-change.neutral {
    background: #f1f5f9;
    color: #64748b;
}

.change-arrow {
    font-size: 0.55rem;
}

/* ====== GRID DE COTAÇÕES (ALTERNATIVO) ====== */
.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.stock-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.stock-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stock-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.stock-card-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
}

.stock-card-info h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--branco);
    margin-bottom: 2px;
}

.stock-card-info span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.stock-card-value {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.stock-card-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--branco);
}

.stock-card-change {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.stock-card-change .percent {
    font-size: 1rem;
    font-weight: 700;
}

.stock-card-change .value {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.stock-card-change.up .percent {
    color: #22c55e;
}

.stock-card-change.down .percent {
    color: #ef4444;
}

/* ====== RESPONSIVO ====== */
@media (max-width: 768px) {
    .stock-ticker-header {
        padding: 4px 12px;
    }

    .ticker-title {
        font-size: 0.65rem;
    }

    .ticker-item {
        min-width: 160px;
        padding: 5px 10px;
        gap: 6px;
    }

    .ticker-logo {
        width: 24px;
        height: 24px;
        font-size: 0.6rem;
    }

    .ticker-symbol {
        font-size: 0.7rem;
    }

    .ticker-price {
        font-size: 0.7rem;
    }

    .ticker-change {
        font-size: 0.55rem;
        padding: 1px 4px;
    }

    .stock-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 12px;
        gap: 8px;
    }

    .stock-card {
        padding: 12px;
    }

    .stock-card-price {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .stock-ticker {
        padding: 6px 0;
    }

    .ticker-item {
        min-width: 160px;
    }

    .stock-grid {
        grid-template-columns: 1fr;
    }
}

