/* Iron Price Board — Public Styles */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;600;700&display=swap');

.ipb-board {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    direction: rtl;
    max-width: 100%;
    margin: 0 auto 32px;
    color: #1a1a2e;
}

/* Update bar */
.ipb-update-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    border: 1px solid #e0e7ef;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #555;
}
.ipb-update-icon { font-size: 16px; }
.ipb-update-bar strong { color: #1a1a2e; }

/* Tabs */
.ipb-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0;
    border-bottom: 3px solid #e5e9f0;
    padding-bottom: 0;
}
.ipb-tab {
    padding: 10px 22px;
    background: #f5f7fa;
    border: 1px solid #dde2ea;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    transition: all .2s ease;
    font-family: inherit;
    margin-bottom: -3px;
    position: relative;
}
.ipb-tab:hover { background: #e8edf4; color: #1a1a2e; }
.ipb-tab.active {
    background: #fff;
    color: #c0392b;
    border-bottom: 3px solid #fff;
    border-top: 3px solid #c0392b;
}

/* Panel */
.ipb-panel { padding: 20px 0 0; }
.ipb-panel.ipb-hidden { display: none; }
.ipb-cat-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 16px;
    padding-right: 12px;
    border-right: 4px solid #c0392b;
}

/* Table */
.ipb-table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e0e7ef;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.ipb-price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 900px;
    background: #fff;
}
.ipb-price-table thead tr {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d3561 100%);
    color: #fff;
}
.ipb-price-table thead th {
    padding: 14px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .3px;
    white-space: nowrap;
}
.ipb-price-table tbody tr { transition: background .15s; }
.ipb-price-table tbody tr:nth-child(even) { background: #f8fafc; }
.ipb-price-table tbody tr:hover { background: #eef2ff; }
.ipb-price-table tbody td {
    padding: 12px 12px;
    text-align: center;
    border-bottom: 1px solid #edf0f5;
    vertical-align: middle;
}
.ipb-price-table tbody tr:last-child td { border-bottom: none; }

/* Columns */
.ipb-col-index { color: #999; width: 40px; font-size: 12px; }
.ipb-col-title { text-align: right !important; }
.ipb-col-title strong { font-weight: 600; }
.ipb-item-note { color: #888; font-size: 11px; }

/* Price cell */
.ipb-col-price { font-weight: 700; font-size: 14px; }
.ipb-price-value { color: #1a1a2e; }
.ipb-price-contact { color: #856404; font-weight: 600; font-style: italic; }
.ipb-price-na { color: #bbb; }

/* Change cell */
.ipb-col-change { font-size: 12px; font-weight: 600; white-space: nowrap; }
.ipb-change-up      { color: #c0392b; }
.ipb-change-down    { color: #27ae60; }
.ipb-change-stable  { color: #7f8c8d; font-weight: 400; }
.ipb-change-unknown { color: #aaa; font-weight: 400; font-style: italic; }

/* Contact bar */
.ipb-contact {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 14px;
    font-size: 13px;
    color: #6d4c1a;
    text-align: center;
}

/* Note footer */
.ipb-price-note {
    margin-top: 12px;
    font-size: 12px;
    color: #888;
    text-align: center;
    font-style: italic;
}

.ipb-empty { color: #aaa; font-style: italic; }

/* Mobile */
@media (max-width: 768px) {
    .ipb-tab { padding: 8px 14px; font-size: 13px; }
    .ipb-price-table { font-size: 12px; }
    .ipb-price-table thead th,
    .ipb-price-table tbody td { padding: 10px 8px; }
}

/* ── Live polling indicators ───────────────────── */

/* "زنده" badge next to update time */
.ipb-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    background: rgba(39,174,96,.15);
    color: #27ae60;
    border: 1px solid rgba(39,174,96,.3);
    border-radius: 20px;
    padding: 2px 10px;
    margin-right: 10px;
    font-weight: 600;
    vertical-align: middle;
}

.ipb-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #27ae60;
    display: inline-block;
    animation: ipb-live-blink 1.4s ease-in-out infinite;
}

@keyframes ipb-live-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .4; transform: scale(.75); }
}

/* Price flash animations */
@keyframes ipb-flash-up-anim {
    0%   { background: #fdecea; color: #c0392b; }
    100% { background: transparent; color: inherit; }
}
@keyframes ipb-flash-down-anim {
    0%   { background: #e8f8ee; color: #27ae60; }
    100% { background: transparent; color: inherit; }
}
@keyframes ipb-flash-change-anim {
    0%   { background: #fffbeb; }
    100% { background: transparent; }
}

.ipb-flash-up {
    animation: ipb-flash-up-anim 2.5s ease-out forwards;
}
.ipb-flash-down {
    animation: ipb-flash-down-anim 2.5s ease-out forwards;
}
.ipb-flash-change {
    animation: ipb-flash-change-anim 2.5s ease-out forwards;
}

/* Smooth price number transition */
.ipb-col-price, .ipb-col-change {
    transition: background 0.3s ease;
}
