/* ─────────────────────────────────────────────
   AtlasData Ticker — ticker-style.css
   Financial Data for Everyone | AtlasBase
   ───────────────────────────────────────────── */

/* Wrapper — sits inline with surrounding text */
.atlasdata-wrapper {
    position: relative;
    display: inline-block;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* The clickable ticker link */
.atlasdata-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    text-decoration: none !important;
    font-weight: 600;
    border-bottom: 1px dotted currentColor;
    transition: opacity 0.15s ease;
}

.atlasdata-link:hover {
    opacity: 0.85;
}

/* UP — green */
.atlasdata-ticker--up .atlasdata-link {
    color: #16a34a !important;
}

.atlasdata-ticker--up .atlasdata-change {
    color: #16a34a;
}

/* DOWN — red */
.atlasdata-ticker--down .atlasdata-link {
    color: #dc2626 !important;
}

.atlasdata-ticker--down .atlasdata-change {
    color: #dc2626;
}

/* Symbol */
.atlasdata-symbol {
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* Price */
.atlasdata-price {
    font-weight: 500;
}

/* Change % + arrow */
.atlasdata-change {
    font-weight: 600;
    font-size: 0.92em;
}

/* Error state */
.atlasdata-error {
    color: #6b7280;
    font-style: italic;
    font-size: 0.9em;
}

/* Crypto / Stock Badge */
.atlasdata-badge {
    display: inline-block;
    font-size: 0.65em;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 1px 5px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 3px;
    text-transform: uppercase;
}

.atlasdata-badge-crypto {
    background: #f59e0b;
    color: #fff;
}

/* ─────────────────────────────────────────────
   TOOLTIP
   ───────────────────────────────────────────── */
.atlasdata-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    min-width: 200px;
    background: #1e293b;
    color: #f1f5f9;
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    font-size: 13px;
    line-height: 1.5;
    white-space: nowrap;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Tooltip arrow */
.atlasdata-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

/* Show on hover */
.atlasdata-wrapper:hover .atlasdata-tooltip {
    display: block;
    animation: atlasdata-fadein 0.15s ease;
}

@keyframes atlasdata-fadein {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Tooltip rows */
.atlasdata-tooltip-name {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    margin-bottom: 8px;
    border-bottom: 1px solid #334155;
    padding-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.atlasdata-tooltip-price {
    margin-bottom: 4px;
    color: #94a3b8;
}

.atlasdata-tooltip-price strong {
    color: #fff;
}

.atlasdata-tooltip-row {
    color: #94a3b8;
    margin-bottom: 2px;
}

.atlasdata-tooltip-row strong {
    color: #fff;
}

.atlasdata-tooltip-footer {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #334155;
    font-size: 10px;
    color: #475569;
    text-align: center;
    letter-spacing: 0.03em;
}

/* ─────────────────────────────────────────────
   RESPONSIVE — keep tooltip from clipping
   ───────────────────────────────────────────── */
@media (max-width: 480px) {
    .atlasdata-tooltip {
        left: 0;
        transform: none;
        min-width: 180px;
    }

    .atlasdata-tooltip::after {
        left: 20%;
    }
}
