/**
 * Envoy Pro — Stock Ticker CSS
 * File: assets/css/stock-ticker.css
 * Finance skin for commercenews.pk
 */

/* ── TICKER CONTAINER ──────────────────────────────────────────── */
#envoy-stock-ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    font-family: 'DM Sans', 'Roboto', Arial, sans-serif;
    font-size: 12px;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
}

/* ── STRIP BASE ────────────────────────────────────────────────── */
.ticker-strip {
    display: flex;
    align-items: center;
    height: 30px;
    overflow: hidden;
    width: 100%;
}

/* ── STRIP 1: PSX ──────────────────────────────────────────────── */
.ticker-strip-psx {
    background-color: #00843D; /* PSX Green */
    color: #ffffff;
}

.ticker-strip-psx .ticker-strip-label {
    background-color: #005c2b;
}

/* ── STRIP 2: WORLD MARKETS ────────────────────────────────────── */
.ticker-strip-world {
    background-color: #1B2A4A; /* Dark Navy */
    color: #e0e0e0;
}

.ticker-strip-world .ticker-strip-label {
    background-color: #111c33;
}

/* ── LABEL (LEFT BADGE) ────────────────────────────────────────── */
.ticker-strip-label {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 12px;
    height: 100%;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
}

.ticker-strip-label .flag {
    font-size: 14px;
}

/* ── SCROLLING TRACK ───────────────────────────────────────────── */
.ticker-track-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.ticker-track {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: envoy-ticker-scroll 60s linear infinite;
    will-change: transform;
}

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

@keyframes envoy-ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* -50% because content is duplicated */
}

/* ── TICKER ITEMS ──────────────────────────────────────────────── */
.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 6px;
}

.ticker-label-name {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.85;
}

.ticker-price {
    font-weight: 500;
    font-size: 12px;
}

.ticker-divider {
    color: rgba(255,255,255,0.25);
    padding: 0 4px;
}

/* ── UP / DOWN COLORS ──────────────────────────────────────────── */
.change.up {
    color: #4eff91;
    font-size: 11px;
}

.change.down {
    color: #ff6b6b;
    font-size: 11px;
}

/* PSX strip — adjust up color (green on green bg) */
.ticker-strip-psx .change.up {
    color: #c8ffd8;
}

/* ── LOADING STATE ─────────────────────────────────────────────── */
.ticker-loading {
    padding: 0 16px;
    opacity: 0.6;
    font-style: italic;
    font-size: 11px;
    animation: pulse 1.5s infinite;
}

.ticker-error {
    padding: 0 16px;
    opacity: 0.5;
    font-size: 11px;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50%       { opacity: 0.3; }
}


/* ── CRYPTO POPUP ──────────────────────────────────────────────── */
#envoy-crypto-popup {
    position: fixed;
    bottom: 70px; /* above ticker strips */
    right: 20px;
    z-index: 10000;
    background: #1B2A4A;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    width: 220px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.crypto-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #111c33;
    color: #F5A623;
    font-weight: 700;
    font-size: 12px;
    font-family: 'DM Sans', Arial, sans-serif;
}

.crypto-close {
    background: none;
    border: none;
    color: #aaaaaa;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
}

.crypto-close:hover {
    color: #ffffff;
}

.crypto-popup-body {
    padding: 8px 0;
}

.crypto-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-family: 'DM Sans', Arial, sans-serif;
}

.crypto-row:last-child {
    border-bottom: none;
}

.crypto-name {
    font-weight: 700;
    font-size: 11px;
    color: #F5A623;
    width: 40px;
}

.crypto-price {
    font-size: 12px;
    color: #ffffff;
    flex: 1;
    text-align: right;
    padding-right: 8px;
}

.crypto-row .change {
    font-size: 11px;
    width: 55px;
    text-align: right;
}


/* ── RESPONSIVE ────────────────────────────────────────────────── */
@media ( max-width: 768px ) {
    .ticker-strip {
        height: 26px;
    }

    .ticker-strip-label {
        padding: 0 8px;
        font-size: 10px;
    }

    .ticker-strip-label .flag {
        display: none; /* hide flag on mobile to save space */
    }

    .ticker-price {
        font-size: 11px;
    }

    #envoy-crypto-popup {
        right: 10px;
        width: 190px;
        bottom: 62px;
    }

    /* Push page content up so ticker doesn't cover footer */
    body {
        padding-bottom: 60px;
    }
}

@media ( min-width: 769px ) {
    body {
        padding-bottom: 60px;
    }
}


/* ── DARK MODE COMPATIBILITY ───────────────────────────────────── */
body.dark-mode #envoy-stock-ticker {
    box-shadow: 0 -2px 16px rgba(0,0,0,0.6);
}

body.dark-mode #envoy-crypto-popup {
    background: #0d1a2e;
    border-color: rgba(255,255,255,0.08);
}


/* ── COMMERCENEWS.PK FINANCE SKIN ──────────────────────────────── */
/* These override Customizer defaults for finance niche */

.commercenews-skin {
    --envoy-primary:      #00843D;  /* PSX Green */
    --envoy-header-bg:    #1B2A4A;  /* Dark Navy */
    --envoy-header-text:  #ffffff;
    --envoy-footer-bg:    #111c33;
    --envoy-footer-text:  #aaaaaa;
    --envoy-body-bg:      #f0f2f5;
    --envoy-topbar-bg:    #0d1520;
    --envoy-ticker-label: #F5A623;  /* Gold */
}
