/* ── AI Stock Ticker ─────────────────────────────── */

.ai-ticker-wrap {
    display: flex;
    align-items: stretch;
    overflow: hidden;
    width: 100%;
    font-family: 'JetBrains Mono', 'Fira Mono', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1;
    position: relative;
    z-index: 100;
    border-radius: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
    user-select: none;
}

/* ── DARK THEME (default) ── */
.ai-ticker-theme-dark {
    background: #0a0e17;
    color: #e2e8f0;
    border-top: 1px solid #1e293b;
    border-bottom: 1px solid #1e293b;
}
.ai-ticker-theme-dark .ai-ticker-label {
    background: #6366f1;
    color: #fff;
}
.ai-ticker-theme-dark .ai-ticker-item {
    border-right: 1px solid #1e293b;
}
.ai-ticker-theme-dark .ai-ticker-symbol {
    color: #c7d2fe;
}
.ai-ticker-theme-dark .ai-ticker-price {
    color: #f1f5f9;
}
.ai-ticker-theme-dark .ai-ticker-loading {
    color: #475569;
}
.ai-ticker-theme-dark .ai-ticker-sep {
    color: #334155;
}

/* ── LIGHT THEME ── */
.ai-ticker-theme-light {
    background: #f8fafc;
    color: #1e293b;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}
.ai-ticker-theme-light .ai-ticker-label {
    background: #6366f1;
    color: #fff;
}
.ai-ticker-theme-light .ai-ticker-item {
    border-right: 1px solid #e2e8f0;
}
.ai-ticker-theme-light .ai-ticker-symbol {
    color: #6366f1;
}
.ai-ticker-theme-light .ai-ticker-price {
    color: #0f172a;
}
.ai-ticker-theme-light .ai-ticker-loading {
    color: #94a3b8;
}
.ai-ticker-theme-light .ai-ticker-sep {
    color: #cbd5e1;
}

/* ── LABEL ── */
.ai-ticker-label {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    white-space: nowrap;
    z-index: 2;
    position: relative;
}
.ai-ticker-label::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 0;
    bottom: 0;
    width: 10px;
    background: inherit;
    clip-path: polygon(0 0, 0% 100%, 100% 50%);
    z-index: 3;
}

/* ── SCROLL OUTER ── */
.ai-ticker-outer {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    height: 40px;
}

/* Left fade */
.ai-ticker-outer::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 40px;
    z-index: 1;
    pointer-events: none;
}
.ai-ticker-theme-dark  .ai-ticker-outer::before { background: linear-gradient(to right, #0a0e17, transparent); }
.ai-ticker-theme-light .ai-ticker-outer::before { background: linear-gradient(to right, #f8fafc, transparent); }

/* ── TRACK ── */
.ai-ticker-track {
    display: flex;
    align-items: center;
    white-space: nowrap;
    will-change: transform;
    /* JS drives the animation */
}

/* ── ITEM ── */
.ai-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    height: 40px;
    cursor: default;
    transition: background .15s;
}
.ai-ticker-item:hover {
    background: rgba(99, 102, 241, .08);
}

.ai-ticker-symbol {
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .04em;
}
.ai-ticker-name {
    font-size: 11px;
    opacity: .55;
    letter-spacing: .02em;
}
.ai-ticker-price {
    font-weight: 600;
    font-size: 13px;
}
.ai-ticker-change {
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 4px;
}
.ai-ticker-change.up {
    color: #22c55e;
    background: rgba(34, 197, 94, .1);
}
.ai-ticker-change.down {
    color: #ef4444;
    background: rgba(239, 68, 68, .1);
}
.ai-ticker-change .arrow {
    font-size: 9px;
}

/* separator dot */
.ai-ticker-sep {
    font-size: 16px;
    opacity: .3;
    margin: 0 4px;
}

/* loading / warning */
.ai-ticker-loading,
.ai-ticker-warning {
    padding: 0 20px;
    font-size: 12px;
    letter-spacing: .04em;
}
.ai-ticker-warning {
    color: #f59e0b;
}

/* ── Blinking dot – live indicator ── */
.ai-ticker-label::before {
    content: '●';
    font-size: 7px;
    margin-right: 6px;
    color: #22c55e;
    animation: ai-ticker-blink 2s infinite;
}
@keyframes ai-ticker-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: .2; }
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .ai-ticker-label { padding: 0 10px; font-size: 9px; }
    .ai-ticker-name  { display: none; }
    .ai-ticker-item  { padding: 0 14px; gap: 6px; }
}
