/* =========================================================
   Silver Live Rates – Dark Theme Board
   ========================================================= */

/* Board wrapper */
.slr-board {
    --slr-bg: #0d1117;
    --slr-card-bg: #161b22;
    --slr-border: #30363d;
    --slr-text: #e6edf3;
    --slr-muted: #8b949e;
    --slr-accent: #c9a84c;
    /* gold/silver accent */
    --slr-sell: #3fb950;
    /* green  */
    --slr-buy: #f85149;
    /* red    */
    --slr-up: #3fb950;
    --slr-down: #f85149;
    --slr-radius: 10px;
    color: var(--slr-text);
    max-width: 860px;
    margin: 0 auto;
    box-shadow: 0 4px 32px rgba(0, 0, 0, .5);
}

/* Header */
.slr-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 24px;
    font-size: 20px;
    font-weight: 700;
    color: var(--slr-text);
    letter-spacing: .5px;
}

.slr-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--slr-sell);
    box-shadow: 0 0 8px var(--slr-sell);
    animation: slr-pulse 1.5s ease-in-out infinite;
}

.slr-live-badge {
    font-size: 11px;
    font-weight: 700;
    background: var(--slr-sell);
    color: #000;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 1px;
}

/* ── Table wrapper ───────────────────────────────────── */
.slr-table-wrap {
    overflow-x: auto;
    border-radius: var(--slr-radius);
    border: 1px solid var(--slr-border);
}

.slr-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--slr-card-bg);
    border: none;
    margin: 0;
}

/* ── Header ──────────────────────────────────────────── */
.slr-table thead tr {
    border-bottom: 2px solid var(--slr-accent);
    background: rgba(201, 168, 76, .06);
}

.slr-th {
    padding: 13px 18px;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--slr-accent);
    text-align: left;
    white-space: nowrap;
    border: none;
}

.slr-th-currency,
.slr-table thead tr th:nth-child(3),
.slr-table thead tr th:nth-child(4) {
    text-align: center;
}

/* ── Body rows ───────────────────────────────────────── */
.slr-tr {
    border-bottom: 1px solid var(--slr-border);
    transition: background .25s;
}

.slr-tr:last-child {
    border-bottom: none;
}

.slr-tr:hover {
    background: rgba(201, 168, 76, .04);
}

/* Row flash – replaces old card flash */
.slr-tr.slr-flash {
    animation: slr-row-flash .6s ease-out forwards;
}

.slr-td {
    padding: 14px 18px;
    vertical-align: middle;
    border: none;
}

/* ── Variant cell ────────────────────────────────────── */
.slr-td-variant {
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.slr-icon {
    color: var(--slr-accent);
    flex-shrink: 0;
    display: flex;
}

.slr-label {
    font-size: 20px;
    font-weight: 600;
    color: var(--slr-text);
    line-height: 1.3;
}

/* ── Arrow ───────────────────────────────────────────── */
.slr-arrow {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    transition: color .3s;
    min-width: 16px;
}

.slr-arrow-up {
    color: var(--slr-up);
}

.slr-arrow-down {
    color: var(--slr-down);
}

/* ── PKR badge cell ──────────────────────────────────── */
.slr-td-currency {
    text-align: center;
}

.slr-currency-badge {
    display: inline-block;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .8px;
    color: var(--slr-accent);
    background: rgba(201, 168, 76, .12);
    border: 1px solid rgba(201, 168, 76, .3);
    border-radius: 4px;
    padding: 3px 7px;
}

/* ── Price cells ─────────────────────────────────────── */
.slr-td-price {
    text-align: center;
}

.slr-price-value {
    font-size: 21px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
    /* always white */
    background-color: transparent;
    border-radius: 4px;
    padding: 2px 6px;
    transition: background-color .4s ease, box-shadow .4s ease;
}

/* Dynamic direction classes – toggled by JS on every price update */
.slr-price-value.slr-price-up {
    background-color: var(--slr-up);
    box-shadow: 0 0 5px rgba(63, 185, 80, 0.3);
}

.slr-price-value.slr-price-down {
    background-color: var(--slr-down);
    box-shadow: 0 0 5px rgba(248, 81, 73, 0.3);
}

.slr-price-value.slr-price-neutral {
    background-color: transparent;
    box-shadow: none;
}

/* Row flash on price update */
@keyframes slr-row-flash {
    0% {
        background: rgba(201, 168, 76, .18);
    }

    100% {
        background: transparent;
    }
}

.slr-tr.slr-flash {
    animation: slr-row-flash .6s ease-out forwards;
}

/* Pulse animation for live dot */
@keyframes slr-pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 8px var(--slr-sell);
    }

    50% {
        opacity: .5;
        box-shadow: 0 0 4px var(--slr-sell);
    }
}

/* Footer text */
.slr-updated {
    margin: 20px 0 0;
    font-size: 12px;
    color: var(--slr-muted);
    text-align: right;
}

.slr-note {
    margin: 10px 20px 0;
    font-size: 14px;
    color: var(--slr-muted);
}

/* ── WhatsApp Button ─────────────────────────────────── */
.slr-whatsapp-wrap {
    margin: 20px 0 4px;
    text-align: center;
}

.slr-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #25d366;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    padding: 13px 28px;
    border-radius: 50px;
    letter-spacing: .3px;
    box-shadow: 0 4px 18px rgba(37, 211, 102, .35);
    transition: background .25s, box-shadow .25s, transform .2s;
}

.slr-whatsapp-btn:hover {
    background: #1ebe5d;
    box-shadow: 0 6px 24px rgba(37, 211, 102, .5);
    transform: translateY(-2px);
    color: #ffffff;
    text-decoration: none;
}

.slr-whatsapp-btn:active,
.slr-whatsapp-btn:focus {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(37, 211, 102, .3) !important;
    color: white !important;
}

/* Responsive */
@media (max-width: 560px) {
    .slr-board {
        padding: 16px 10px 12px;
    }

    /* Hide Currency column on mobile */
    .slr-th-currency,
    .slr-td-currency {
        display: none;
    }

    /* Tighten cell padding */
    .slr-th,
    .slr-td {
        padding: 10px 8px;
        font-size: 17px;
    }

    /* Variant cell: stack icon+label naturally */
    .slr-td-variant {
        gap: 5px;
    }

    .slr-label {
        font-size: 17px;
        white-space: normal;
        word-break: break-word;
    }

    /* Price values */
    .slr-price-value {
        font-size: 15px;
        padding: 2px 4px;
    }

    /* Arrow */
    .slr-arrow {
        font-size: 13px;
    }

    /* ── Sticky WhatsApp bar on mobile ─────────────────── */
    .slr-whatsapp-wrap {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        padding: 10px 16px;
        background: rgba(13, 17, 23, .92);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-top: 1px solid rgba(37, 211, 102, .2);
        z-index: 9999;
        text-align: center;
    }

    .slr-whatsapp-btn {
        width: 100%;
        max-width: 420px;
        font-size: 16px;
        padding: 14px 20px;
        border-radius: 14px;
        animation: slr-wa-pulse 2.5s ease-in-out infinite;
    }

    @keyframes slr-wa-pulse {

        0%,
        100% {
            box-shadow: 0 4px 18px rgba(37, 211, 102, .35);
        }

        50% {
            box-shadow: 0 4px 28px rgba(37, 211, 102, .65);
        }
    }
}