/* ====================================================
   PSX LIVE TICKER BAR  –  allpktaxes.com
   ==================================================== */

/* Push page content down so bar doesn't overlap */
body {
    margin-top: 44px !important;
}

/* Main bar */
#psx-ticker-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    height: 44px;
    display: flex;
    align-items: center;
    background: #0a0e1a;
    border-bottom: 1px solid #1e2d4a;
    font-family: 'Courier New', 'Lucida Console', monospace;
    font-size: 12.5px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

/* LABEL — "PSX LIVE" badge */
#psx-ticker-label {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px 0 12px;
    height: 100%;
    background: #111827;
    border-right: 1px solid #1e3a5f;
    color: #e2e8f0;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Blinking live dot */
.psx-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    animation: psx-blink 1.6s ease-in-out infinite;
}

@keyframes psx-blink {
    0%, 100% { opacity: 1;   box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
    50%       { opacity: 0.4; box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}

/* Scrolling track */
#psx-ticker-track-outer {
    flex: 1;
    overflow: hidden;
    height: 100%;
    position: relative;
    /* Fade edges */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
    mask-image:         linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
}

#psx-ticker-track {
    display: flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
}

#psx-ticker-inner {
    display: inline-flex;
    align-items: center;
    gap: 0;
    animation: psx-scroll 60s linear infinite;
    will-change: transform;
}

/* Pause on hover */
#psx-ticker-wrap:hover #psx-ticker-inner {
    animation-play-state: paused;
}

@keyframes psx-scroll {
    0%   { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}

/* Individual stock item */
.psx-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 16px;
    border-right: 1px solid #1e2d4a;
    height: 44px;
    cursor: default;
    transition: background 0.2s;
}

.psx-item:hover {
    background: rgba(255,255,255,0.05);
}

/* Symbol name */
.psx-sym {
    color: #94a3b8;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
}

/* Price */
.psx-price {
    color: #e2e8f0;
    font-weight: 600;
    font-size: 12.5px;
}

/* Change badge */
.psx-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11.5px;
    font-weight: 600;
}

.psx-change.up {
    color: #22c55e;
    background: rgba(34,197,94,0.12);
}

.psx-change.down {
    color: #ef4444;
    background: rgba(239,68,68,0.12);
}

.psx-change.flat {
    color: #94a3b8;
    background: rgba(148,163,184,0.1);
}

/* Arrow icon */
.psx-arrow {
    font-size: 10px;
    line-height: 1;
}

/* Volume chip */
.psx-vol {
    color: #475569;
    font-size: 10.5px;
}

/* Divider dots between items */
.psx-sep {
    color: #1e3a5f;
    padding: 0 4px;
    font-size: 18px;
    line-height: 1;
    user-select: none;
}

/* Timestamp */
#psx-ticker-time {
    flex-shrink: 0;
    padding: 0 12px;
    color: #334155;
    font-size: 10.5px;
    white-space: nowrap;
    border-left: 1px solid #1e2d4a;
}

/* Loading state */
.psx-loading {
    color: #475569;
    padding: 0 20px;
    font-size: 12px;
    font-style: italic;
}

/* Error state */
.psx-error {
    color: #ef4444;
    padding: 0 20px;
    font-size: 11px;
}

/* ── Admin bar compatibility ── */
.admin-bar #psx-ticker-wrap {
    top: 32px;
}
.admin-bar body {
    margin-top: 76px !important; /* 44 + 32 */
}
@media screen and (max-width: 782px) {
    .admin-bar #psx-ticker-wrap {
        top: 46px;
    }
    .admin-bar body {
        margin-top: 90px !important;
    }
}

/* ── Mobile tweaks ── */
@media (max-width: 600px) {
    #psx-ticker-wrap {
        height: 38px;
    }
    body {
        margin-top: 38px !important;
    }
    #psx-ticker-label {
        font-size: 9.5px;
        padding: 0 10px 0 8px;
    }
    .psx-item {
        height: 38px;
        padding: 0 11px;
    }
    .psx-vol {
        display: none; /* hide volume on small screens */
    }
}
