/* ═══════════════════ MATRIX RADAR — MAIN STYLES ═══════════════════ */

:root {
    --yellow: #FFD700;
    --orange: #FF6600;
    --red: #FF0000;
    --green: #00FF00;
    --pump: #00FF88;
    --bg-dark: #000000;
    --bg-table: rgba(0, 20, 0, 0.85);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    overflow-x: hidden;
    background: var(--bg-dark);
    font-family: 'Courier New', monospace;
    min-height: 100vh;
}

body.has-topbar {
    padding-top: 50px;
}

/* ═══════════════════ TRIAL NOTIFICATION ═══════════════════ */

.trial-notification {
    position: fixed;
    top: 60px;
    right: 20px;
    left: 20px;
    max-width: 600px;
    margin: 0 auto;
    z-index: 1000;
    border: 1px solid var(--green);
    border-radius: 8px;
    background: rgba(0, 20, 0, 0.95);
    backdrop-filter: blur(10px);
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 4px 20px rgba(0, 255, 0, 0.3);
}

.trial-notification.trial-welcome {
    border-color: var(--pump);
    background: rgba(0, 30, 0, 0.95);
}

.trial-notification.trial-urgent {
    border-color: var(--orange);
    background: rgba(30, 20, 0, 0.95);
    animation: pulse 2s ease-in-out infinite;
}

.trial-notification.trial-expired {
    border-color: var(--red);
    background: rgba(20, 0, 0, 0.95);
}

.trial-content {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 15px;
    position: relative;
}

.trial-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.trial-text {
    flex: 1;
    color: var(--green);
    font-size: 14px;
    line-height: 1.4;
}

.trial-notification.trial-welcome .trial-text {
    color: var(--pump);
}

.trial-notification.trial-urgent .trial-text {
    color: var(--orange);
}

.trial-notification.trial-expired .trial-text {
    color: var(--red);
}

.trial-actions {
    flex-shrink: 0;
}

.trial-close {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    color: var(--green);
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.trial-close:hover {
    opacity: 1;
}

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

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(255, 102, 0, 0.3);
    }
    50% {
        box-shadow: 0 4px 30px rgba(255, 102, 0, 0.6);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .trial-notification {
        top: 50px;
        right: 10px;
        left: 10px;
    }
    
    .trial-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .trial-actions {
        width: 100%;
    }
    
    .trial-actions .btn {
        width: 100%;
    }
}

/* ═══════════════════ TOP BAR (MENU) ═══════════════════ */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(0, 20, 0, 0.72);
    border-bottom: 1px solid rgba(0, 255, 0, 0.22);
    backdrop-filter: blur(6px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 2px 4px 2px 2px;
    text-decoration: none;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: var(--green);
    user-select: none;
    font-size: 13px;
}

.topbar-brand .brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 255, 0, 0.10);
    box-shadow: 0 0 12px rgba(0, 255, 0, 0.15);
    border: 1px solid rgba(0, 255, 0, 0.3);
    overflow: hidden;
    flex: 0 0 auto;
}

.topbar-brand .brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.topbar-brand .brand-text {
    font-weight: 900;
    letter-spacing: 1px;
    line-height: 1;
    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.topbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    color: var(--green);
    background: rgba(0, 17, 0, 0.6);
    border: 1px solid rgba(0, 255, 0, 0.4);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.15), inset 0 0 4px rgba(0, 255, 0, 0.05);
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.topbar-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.1), transparent);
    transition: left 0.5s ease;
}

.topbar-btn:hover {
    background: rgba(0, 255, 0, 0.12);
    border-color: rgba(0, 255, 0, 0.8);
    color: var(--green);
    box-shadow: 0 0 12px rgba(0, 255, 0, 0.4), inset 0 0 8px rgba(0, 255, 0, 0.1);
    transform: translateY(-1px);
}

.topbar-btn:hover::before {
    left: 100%;
}

.upgrade-btn.topbar-btn {
    background: rgba(0, 255, 0, 0.15);
    border-color: rgba(0, 255, 0, 0.5);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2), inset 0 0 6px rgba(0, 255, 0, 0.08);
}

.upgrade-btn.topbar-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    border-color: rgba(0, 255, 0, 0.9);
    box-shadow: 0 0 14px rgba(0, 255, 0, 0.5), inset 0 0 10px rgba(0, 255, 0, 0.15);
}

/* ═══════════════════ BILLING / UPGRADE BUTTON ═══════════════════ */
.upgrade-btn {
    /* now used inside .topbar; layout handled there */
}

.upgrade-btn:hover {
    /* hover handled by .topbar-btn */
}

/* ═══════════════════ TRY BUTTON ═══════════════════ */
.try-btn.topbar-btn {
    background: rgba(255, 165, 0, 0.15);
    border-color: rgba(255, 165, 0, 0.5);
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.2), inset 0 0 6px rgba(255, 165, 0, 0.08);
}

.try-btn.topbar-btn:hover {
    background: rgba(255, 165, 0, 0.2);
    border-color: rgba(255, 165, 0, 0.9);
    box-shadow: 0 0 14px rgba(255, 165, 0, 0.5), inset 0 0 10px rgba(255, 165, 0, 0.15);
}

/* ═══════════════════ MATRIX CANVAS ═══════════════════ */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

/* ═══════════════════ CONTAINER ═══════════════════ */
.container {
    position: relative;
    z-index: 2;
    padding: 10px;
    max-width: 100%;
}

h1 {
    text-align: center;
    color: var(--green);
    text-shadow: 0 0 20px var(--green);
    margin: 10px;
    font-size: clamp(1.2em, 4vw, 2em);
}

.brand-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.brand-title--left {
    justify-content: flex-start;
}

.brand-title-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex: 0 0 auto;
}

.slogan {
    text-align: center;
    color: var(--green);
    opacity: 0.7;
    font-size: 12px;
    margin-bottom: 15px;
}

/* ═══════════════════ ADD PANEL ═══════════════════ */
.add-panel {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 10px;
    flex-wrap: wrap;
}

.add-panel input {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    padding: 12px;
    font-size: 13px;
    background: #001100;
    color: var(--green);
    border: 2px solid var(--green);
    border-radius: 8px;
}

.add-panel input:focus {
    outline: none;
    box-shadow: 0 0 10px var(--green);
}

.add-panel button {
    padding: 12px 20px;
    font-size: 14px;
    background: var(--green);
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-panel button .icon-inline {
    filter: none !important;
    color: #000 !important;
    margin: 0;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2em;
    height: 1.2em;
}

.add-panel button:hover {
    background: #0a0;
    transform: scale(1.05);
}

/* ═══════════════════ STATUS ═══════════════════ */
.status {
    text-align: center;
    font-size: 12px;
    color: var(--green);
    opacity: 0.6;
    margin: 5px;
}

.status.offline {
    color: var(--red);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ═══════════════════ ИНФОРМАЦИОННЫЙ БЛОК ═══════════════════ */
.info-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.ticker-item {
    padding: 4px 8px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 4px;
    color: #0f0;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.ticker-item:hover {
    background: rgba(0, 255, 0, 0.2);
    border-color: rgba(0, 255, 0, 0.5);
}

.ticker-item.indicator-pump {
    background: rgba(0, 255, 136, 0.2);
    border-color: rgba(0, 255, 136, 0.5);
    color: #0ff;
    animation: pulse-pump 1.5s ease-in-out infinite;
}

.ticker-item.indicator-dump {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.5);
    color: #f00;
    animation: pulse-dump 1.5s ease-in-out infinite;
}

.ticker-item.indicator-growth {
    background: rgba(0, 255, 0, 0.15);
    border-color: rgba(0, 255, 0, 0.4);
    color: #0f0;
}

.ticker-item.indicator-fall {
    background: rgba(255, 0, 0, 0.15);
    border-color: rgba(255, 0, 0, 0.4);
    color: #f00;
}

.ticker-item.indicator-neutral {
    background: rgba(128, 128, 128, 0.1);
    border-color: rgba(128, 128, 128, 0.3);
    color: #888;
}

.ticker-item.ticker-unavailable {
    background: rgba(128, 128, 128, 0.05);
    border-color: rgba(128, 128, 128, 0.2);
    color: #666;
    opacity: 0.6;
}

.ticker-empty {
    color: #666;
    font-size: 9px;
    font-style: italic;
}

.info-block-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 9px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-label {
    color: #888;
}

.summary-value {
    color: #0f0;
    font-weight: bold;
}

.summary-empty {
    color: #666;
    font-style: italic;
}

/* ═══════════════════ СЕКЦИЯ ИЗБРАННЫХ ПАР ═══════════════════ */
.favorites-section {
    margin: 0 0 7px 0;
    padding: 0;
    background: transparent;
    border: none;
}

/* Favorites table uses same styling as main table */
.favorites-section .table-wrap {
    margin: 10px;
    width: 100%;
}

.favorites-section tbody tr.favorite-pair-unavailable {
    opacity: 0.6;
}

/* Remove button for favorites table */
.favorite-pair-remove-btn {
    background: transparent;
    border: 1px solid #f00;
    color: #f00;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    width: auto;
    height: auto;
}

.favorite-pair-remove-btn:hover {
    background: #f00;
    color: #000;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
}

.favorite-pair-remove-btn .icon-inline {
    filter: drop-shadow(0 0 2px #f00);
}

.favorites-empty {
    color: #666;
    font-size: 12px;
    font-style: italic;
    padding: 10px;
    text-align: center;
}

/* Анимации для индикаторов */
@keyframes pulse-pump {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 15px rgba(0, 255, 136, 0.8);
    }
}

@keyframes pulse-dump {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 15px rgba(255, 0, 0, 0.8);
    }
}

/* ═══════════════════ TABLE ═══════════════════ */
.table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    margin: 10px;
    width: 100%;
    position: relative;
}

/* Increase bottom margin for the last table to prevent Bug Report button overlap */
.table-wrap:last-of-type {
    margin-bottom: 40px;
}

/* CRT Scanlines effect - striped screen of old terminal */
.table-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 100; /* Above table content, but below interactive elements */
    opacity: 0.6;
    animation: scanlines-flicker 0.15s linear infinite;
    /* Дополнительный эффект свечения scanlines */
    box-shadow: inset 0 0 50px rgba(0, 255, 0, 0.02);
}

/* Мерцание scanlines для эффекта старого монитора */
@keyframes scanlines-flicker {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.4; }
}

/* Дополнительный эффект свечения как у CRT монитора */
.table-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at center,
        rgba(0, 255, 0, 0.03) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 99; /* Между scanlines и контентом */
    /* Эффект виньетки как у старых мониторов */
    box-shadow:
        inset 0 0 100px rgba(0, 0, 0, 0.3),
        inset 0 0 200px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    color: var(--green);
    font-size: clamp(10px, 2vw, 13px);
    background: var(--bg-table);
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    table-layout: fixed;
    position: relative;
    z-index: 1; /* Ниже scanlines, но выше фона */
    /* Эффект свечения текста как у старых терминалов */
    text-shadow:
        0 0 2px rgba(0, 255, 0, 0.8),
        0 0 4px rgba(0, 255, 0, 0.4),
        0 0 6px rgba(0, 255, 0, 0.2);
    /* Легкое мерцание для эффекта старого монитора */
    animation: terminal-flicker 3s ease-in-out infinite;
    /* Эффект свечения фона таблицы */
    box-shadow:
        inset 0 0 30px rgba(0, 255, 0, 0.05),
        0 0 10px rgba(0, 255, 0, 0.03);
}

/* Мерцание текста как у старых CRT */
@keyframes terminal-flicker {
    0%, 100% { opacity: 1; }
    98% { opacity: 1; }
    99% { opacity: 0.98; }
    99.5% { opacity: 1; }
}

thead {
    position: relative;
    /* Ретро-эффект для заголовка таблицы */
    background: rgba(0, 20, 0, 0.5) !important;
    /* Scanlines на заголовке */
    background-image: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 0, 0.02) 0px,
        rgba(0, 255, 0, 0.02) 1px,
        transparent 1px,
        transparent 2px
    ) !important;
}

th, td {
    padding: 8px 6px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Эффект свечения текста в ячейках - уменьшен для лучшей читаемости */
    text-shadow:
        0 0 1px rgba(0, 255, 0, 0.4),
        0 0 2px rgba(0, 255, 0, 0.2);
    position: relative;
    z-index: 2; /* Выше scanlines для читаемости текста */
    cursor: default; /* Standard cursor instead of help/question cursor */
}

/* Apply Matrix font to numeric columns (price, delta, change, correlation, OI, volume, funding) */
td:nth-child(3),
td:nth-child(4),
td:nth-child(5),
td:nth-child(6),
td:nth-child(7),
td:nth-child(8),
td:nth-child(9) {
    font-family: 'Share Tech Mono', monospace;
    font-size: 16px;
    letter-spacing: 0.5px;
    /* Reduced glow effect for better readability of numbers */
    text-shadow:
        0 0 1px rgba(0, 255, 0, 0.3),
        0 0 2px rgba(0, 255, 0, 0.15);
}

/* Apply Matrix font to market context numeric values */
#ctx-pulse,
#ctx-corr,
#ctx-anomalies,
#ctx-avg-change,
#ctx-dump-count {
    font-family: 'VT323', monospace;
    font-size: 24px;
    letter-spacing: 2px;
    font-weight: 400;
}

/* Apply Matrix font to badge elements with numbers */
.badge {
    font-family: 'VT323', monospace;
    font-size: 16px;
    letter-spacing: 1px;
    font-weight: 400;
}

/* Дополнительные scanlines внутри ячеек для более глубокого эффекта */
td::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 1px,
        rgba(0, 255, 0, 0.02) 1px,
        rgba(0, 255, 0, 0.02) 2px
    );
    pointer-events: none;
    opacity: 0.5;
    z-index: 1;
}

/* Убираем дублирующий ::before для skeleton ячеек, так как там свой */
.skeleton-row td::before {
    background: none;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 0, 0.03) 0px,
        rgba(0, 255, 0, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
    opacity: 0.4;
}

th:nth-child(1), td:nth-child(1) { width: 30px; min-width: 30px; max-width: 30px; }
th:nth-child(2), td:nth-child(2) { width: 12%; min-width: 120px; }
th:nth-child(3), td:nth-child(3) { width: 12%; min-width: 100px; }
th:nth-child(4), td:nth-child(4) { width: 9%; min-width: 80px; }
th:nth-child(5), td:nth-child(5) { width: 9%; min-width: 80px; }
th:nth-child(6), td:nth-child(6) { width: 9%; min-width: 70px; }
th:nth-child(7), td:nth-child(7) { width: 12%; min-width: 100px; }
th:nth-child(8), td:nth-child(8) { width: 12%; min-width: 100px; }
th:nth-child(9), td:nth-child(9) { width: 12%; min-width: 100px; }
th:nth-child(10), td:nth-child(10) { width: 45px; min-width: 45px; max-width: 45px; }

/* Стили для колонки SYMBOL (вторая колонка) - flex layout */
td:nth-child(2) b {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

td:nth-child(2) .symbol-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

td:nth-child(2) .symbol-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Стили для ссылок с иконками в колонке SYMBOL */
td:nth-child(2) .symbol-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    transition: opacity 0.2s;
}

td:nth-child(2) .symbol-icons a:hover {
    opacity: 0.7;
}

/* Стили для иконки PERPETUAL */
td:nth-child(2) .perpetual-icon {
    color: #0f0;
}

/* Стили для кнопки OB (Orderbook) */
.ob-btn {
    background: transparent;
    border: 1px solid #0f0;
    color: #0f0;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ob-btn:hover {
    background: #0f0;
    color: #000;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.5);
}

.ob-btn .icon-inline {
    filter: drop-shadow(0 0 2px #0f0);
}

/* FAV icon (star) styling - just icon, no button */
.fav-icon {
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s;
    color: #0f0;
    opacity: 0.6;
}

.fav-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.fav-icon-filled {
    color: #ff0;
    opacity: 1;
}

.fav-icon-filled:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.fav-icon .icon-inline {
    display: block;
    filter: drop-shadow(0 0 2px currentColor);
}

.fav-icon-filled .icon-inline {
    filter: drop-shadow(0 0 3px #ff0);
}

/* Narrow FAV column - applies to main table and favorites table */
.matrix-frame table thead th:first-child,
.matrix-frame table tbody td:first-child {
    width: 30px;
    min-width: 30px;
    max-width: 30px;
    padding: 4px 2px;
    text-align: center;
}

/* Стили для стакана заявок */
/* Dual orderbook container - two columns side by side */
.orderbook-dual-container {
    display: flex;
    gap: 15px;
    width: 100%;
    height: 100%;
}

.orderbook-column {
    flex: 1;
    min-width: 0; /* Allow flexbox to shrink */
    display: flex;
    flex-direction: column;
}

.orderbook-column-title {
    flex-shrink: 0;
    margin-bottom: 4px !important;
    padding: 4px 8px !important;
}

.orderbook-container {
    display: flex;
    flex-direction: column; /* Vertical layout: BIDS top, ASKS bottom */
    gap: 0;
    height: auto; /* Fixed height based on content */
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.1);
}

.orderbook-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.orderbook-section h6 {
    text-shadow: 0 0 8px currentColor;
    letter-spacing: 1px;
    font-weight: 700;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
    margin-bottom: 2px;
    padding: 4px 0;
    font-size: 12px;
}

.orderbook-section:last-child h6 {
    border-top: 1px solid rgba(255, 0, 0, 0.2);
    border-bottom: none;
    margin-top: 2px;
    margin-bottom: 0;
    padding-top: 4px;
    padding-bottom: 0;
}

.orderbook-section:first-child {
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
}

.orderbook-section:last-child {
    border-top: 1px solid rgba(255, 0, 0, 0.2);
}

#orderbookAsks, #orderbookBids,
#orderbookAsksSpot, #orderbookBidsSpot,
#orderbookAsksPerpetual, #orderbookBidsPerpetual {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    overflow: hidden; /* No scrolling - fixed number of rows */
    padding: 2px;
    min-height: 0;
    height: auto; /* Let content determine height */
    position: relative;
}

/* Asks sections - all variants */
#orderbookAsks, #orderbookAsksSpot, #orderbookAsksPerpetual {
    /* Asks: большие цены сверху, меньшие снизу */
    flex-direction: column;
    padding-bottom: 0; /* Remove bottom padding to stick to MP */
    justify-content: flex-end; /* Push content to bottom */
    /* Gradient from dark at top to lighter near center */
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(20, 0, 0, 0.4) 50%,
        rgba(40, 0, 0, 0.3) 100%);
}

/* Bids sections - all variants */
#orderbookBids, #orderbookBidsSpot, #orderbookBidsPerpetual {
    /* Bids: большие цены сверху, меньшие снизу */
    flex-direction: column;
    /* Gradient from lighter near center to dark at bottom */
    background: linear-gradient(to bottom,
        rgba(0, 40, 0, 0.3) 0%,
        rgba(0, 20, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.6) 100%);
}

/* Scrollbar removed - fixed number of rows, no scrolling needed */

.orderbook-row {
    display: grid;
    grid-template-columns: 1fr auto auto; /* Three columns: price, amount, percent */
    padding: 2px 8px;
    font-size: 9px;
    border-radius: 2px;
    transition: none; /* Remove transition to prevent animation on updates */
    border-bottom: 1px solid rgba(0, 255, 0, 0.08);
    min-height: 20px;
    align-items: center;
    position: relative;
    gap: 8px; /* Space between columns */
}

.orderbook-row::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(to right,
        transparent 0%,
        rgba(0, 255, 0, 0.15) 50%,
        transparent 100%);
}

.orderbook-row.orderbook-empty {
    opacity: 0.2;
    pointer-events: none;
    min-height: 20px; /* Same height as regular rows */
}

.orderbook-row.orderbook-empty .orderbook-price,
.orderbook-row.orderbook-empty .orderbook-amount,
.orderbook-row.orderbook-empty .orderbook-percent {
    visibility: hidden;
}

.orderbook-row:hover,
.orderbook-row.orderbook-hovered {
    background: rgba(0, 255, 0, 0.15);
    /* Removed transform: scale to prevent jumping */
}

.orderbook-row.ask {
    background: rgba(255, 0, 0, 0.03);
}

.orderbook-row.ask:hover,
.orderbook-row.ask.orderbook-hovered {
    background: rgba(255, 0, 0, 0.18);
    box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.1);
}

.orderbook-row.bid {
    background: rgba(0, 255, 0, 0.03);
}

.orderbook-row.bid:hover,
.orderbook-row.bid.orderbook-hovered {
    background: rgba(0, 255, 0, 0.18);
    box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.1);
}

.orderbook-price {
    text-align: right;
    font-weight: bold;
    font-family: 'Share Tech Mono', monospace;
    font-size: 16px;
    padding-right: 12px;
    letter-spacing: 0.5px;
    text-shadow: 0 0 3px currentColor;
}

.orderbook-amount {
    text-align: right;
    color: #0f0;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    font-weight: 400;
    min-width: 110px;
    text-shadow: 0 0 6px rgba(0, 255, 0, 0.4);
    letter-spacing: 0.5px;
    opacity: 0.95;
}

.orderbook-row.ask .orderbook-amount {
    color: #ff3333;
    text-shadow: 0 0 6px rgba(255, 0, 0, 0.4);
}

/* Выделение крупных ордеров */
.orderbook-row.orderbook-large {
    font-weight: bold;
}

.orderbook-row.orderbook-large .orderbook-price {
    font-size: 12px;
    font-weight: 900;
    text-shadow: 0 0 8px currentColor;
}

.orderbook-row.orderbook-large.bid .orderbook-price {
    color: #0ff !important;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
}

.orderbook-row.orderbook-large.ask .orderbook-price {
    color: #ff0 !important;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.6);
}

.orderbook-row.orderbook-large .orderbook-amount {
    font-size: 12px;
    font-weight: 800;
}

.orderbook-row.orderbook-large.bid .orderbook-amount {
    color: #0ff !important;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.orderbook-row.orderbook-large.ask .orderbook-amount {
    color: #ff0 !important;
    text-shadow: 0 0 8px rgba(255, 255, 0, 0.5);
}

/* Анимации появления строк - отключены для стабильности */
@keyframes fadeInRow {
    /* Disabled - no animation for smoother updates */
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Процент объема - отдельная колонка */
.orderbook-percent {
    text-align: right;
    font-size: 14px;
    opacity: 0.75;
    font-weight: 400;
    font-family: 'Share Tech Mono', monospace;
    min-width: 50px;
    color: #aaa;
    letter-spacing: 0.5px;
}

.orderbook-row.bid .orderbook-percent {
    color: #0a0;
    opacity: 0.8;
}

.orderbook-row.ask .orderbook-percent {
    color: #a00;
    opacity: 0.8;
}

/* Старый класс для совместимости */
.volume-percent {
    font-size: 9px;
    opacity: 0.75;
    margin-left: 0;
    font-weight: 500;
}

.orderbook-row:hover .volume-percent {
    opacity: 0.9;
}

/* Tooltip стили */
.orderbook-row {
    cursor: help;
    position: relative;
}

.orderbook-row[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: #0f0;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: pre-line;
    z-index: 1000;
    margin-bottom: 5px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    pointer-events: none;
    font-family: 'Courier New', monospace;
    min-width: 120px;
    text-align: left;
}

/* Центральная секция с рыночной ценой */
.orderbook-center {
    border-top: 2px solid rgba(0, 255, 0, 0.6);
    border-bottom: 2px solid rgba(0, 255, 0, 0.6);
    background: linear-gradient(to bottom,
        rgba(0, 255, 0, 0.15) 0%,
        rgba(0, 255, 0, 0.12) 50%,
        rgba(0, 255, 0, 0.15) 100%);
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.2) inset,
                0 -2px 10px rgba(0, 255, 0, 0.1),
                0 2px 10px rgba(0, 255, 0, 0.1);
}

.orderbook-center::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(0, 255, 0, 0.05) 50%,
        transparent 100%);
    pointer-events: none;
}

.orderbook-market-price {
    text-align: center;
    width: 100%;
}

.market-price-label {
    color: #0a0;
    font-size: 12px;
    font-weight: 600;
    opacity: 0.8;
    text-transform: uppercase;
}

.market-price-value {
    color: #0f0;
    font-size: 18px;
    font-weight: 400;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8),
                 0 0 20px rgba(0, 255, 0, 0.5),
                 0 0 30px rgba(0, 255, 0, 0.3);
    animation: marketPriceGlow 2s ease-in-out infinite alternate;
    position: relative;
}

@keyframes marketPriceGlow {
    from {
        text-shadow: 0 0 10px rgba(0, 255, 0, 0.8),
                     0 0 20px rgba(0, 255, 0, 0.5),
                     0 0 30px rgba(0, 255, 0, 0.3);
    }
    to {
        text-shadow: 0 0 15px rgba(0, 255, 0, 1),
                     0 0 25px rgba(0, 255, 0, 0.7),
                     0 0 35px rgba(0, 255, 0, 0.5);
    }
}

.market-price-additional {
    color: #0a0;
    font-size: 14px;
    font-weight: 400;
    opacity: 0.6;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 0.5px;
}

.last-trade-price {
    color: #aaa;
    font-size: 9px;
    font-weight: normal;
    opacity: 0.7;
}

.orderbook-stats {
    color: #0a0;
    font-size: 12px;
    font-weight: 400;
    opacity: 0.8;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 0.5px;
    text-shadow: 0 0 4px rgba(0, 255, 0, 0.3);
    margin-top: 4px !important;
}

/* Bulls vs Bears Scale */
.bulls-bears-scale {
    width: 100%;
    margin-top: 2px;
}

.scale-bar {
    width: 100%;
    height: 20px;
    display: flex;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 0, 0.4);
    box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.6);
    position: relative;
    cursor: pointer;
}

.scale-bids {
    background: linear-gradient(to right,
        rgba(0, 255, 0, 0.5) 0%,
        rgba(0, 220, 0, 0.6) 50%,
        rgba(0, 255, 0, 0.5) 100%);
    height: 100%;
    transition: width 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0 2px;
}

.scale-bids .scale-percent {
    color: #0f0;
    font-size: 11px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 4px rgba(0, 255, 0, 0.9),
                 0 0 6px rgba(0, 255, 0, 0.7);
    z-index: 1;
    white-space: nowrap;
}

.scale-bids:hover {
    background: linear-gradient(to right,
        rgba(0, 255, 0, 0.7) 0%,
        rgba(0, 240, 0, 0.8) 50%,
        rgba(0, 255, 0, 0.7) 100%);
    box-shadow: inset 0 0 6px rgba(0, 255, 0, 0.4);
}

.scale-bids:hover .scale-percent {
    text-shadow: 0 0 6px rgba(0, 255, 0, 1),
                 0 0 8px rgba(0, 255, 0, 0.9);
}

.scale-asks {
    background: linear-gradient(to left,
        rgba(255, 0, 0, 0.5) 0%,
        rgba(220, 0, 0, 0.6) 50%,
        rgba(255, 0, 0, 0.5) 100%);
    height: 100%;
    transition: width 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0 2px;
}

.scale-asks .scale-percent {
    color: #f00;
    font-size: 13px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 4px rgba(255, 0, 0, 0.9),
                 0 0 6px rgba(255, 0, 0, 0.7);
    z-index: 1;
    white-space: nowrap;
}

.scale-asks:hover {
    background: linear-gradient(to left,
        rgba(255, 0, 0, 0.7) 0%,
        rgba(240, 0, 0, 0.8) 50%,
        rgba(255, 0, 0, 0.7) 100%);
    box-shadow: inset 0 0 6px rgba(255, 0, 0, 0.4);
}

.scale-asks:hover .scale-percent {
    text-shadow: 0 0 6px rgba(255, 0, 0, 1),
                 0 0 8px rgba(255, 0, 0, 0.9);
}

.scale-spread {
    text-align: center;
    font-size: 9px;
    color: #fff;
    margin-top: 4px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    text-shadow: none;
    opacity: 1;
}

/* Индикатор активности */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0a0;
    display: inline-block;
    animation: statusPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(0, 255, 0, 0.6);
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.status-indicator.active {
    background: #0f0;
    animation: statusPulse 0.8s ease-in-out infinite;
}

.status-indicator.error {
    background: #f00;
    animation: none;
    box-shadow: 0 0 6px rgba(255, 0, 0, 0.6);
}

/* Плавные переходы для обновления данных */
.orderbook-row {
    transition: background-color 0.3s ease,
                color 0.3s ease,
                opacity 0.3s ease,
                transform 0.2s ease;
}

.orderbook-row.updated {
    animation: dataUpdateFlash 0.5s ease;
}

@keyframes dataUpdateFlash {
    0% {
        background-color: rgba(0, 255, 0, 0.3);
    }
    100% {
        background-color: transparent;
    }
}

.orderbook-row.ask.updated {
    animation: dataUpdateFlashAsk 0.5s ease;
}

@keyframes dataUpdateFlashAsk {
    0% {
        background-color: rgba(255, 0, 0, 0.3);
    }
    100% {
        background-color: transparent;
    }
}

/* Стили для табов выбора типа пары */
.orderbook-tabs {
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 0;
}

.orderbook-tabs .nav-item {
    margin-bottom: -1px;
    list-style: none;
}

.orderbook-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #0a0;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.orderbook-tab:hover {
    color: #0f0;
    background: rgba(0, 255, 0, 0.1);
    border-bottom-color: rgba(0, 255, 0, 0.3);
}

.orderbook-tab.active {
    color: #0f0;
    border-bottom-color: #0f0;
    background: rgba(0, 255, 0, 0.05);
    font-weight: 600;
}

.orderbook-tab:focus {
    outline: 1px solid rgba(0, 255, 0, 0.5);
    outline-offset: -1px;
}

th {
    background: #001a00;
    position: sticky;
    top: 0;
    /* Ретро-эффект свечения для заголовков */
    text-shadow:
        0 0 3px rgba(0, 255, 0, 0.8),
        0 0 6px rgba(0, 255, 0, 0.4),
        0 0 9px rgba(0, 255, 0, 0.2);
    /* Легкое мерцание заголовков */
    animation: header-flicker 5s ease-in-out infinite;
}

/* Мерцание заголовков для эффекта старого терминала */
@keyframes header-flicker {
    0%, 100% {
        text-shadow:
            0 0 3px rgba(0, 255, 0, 0.8),
            0 0 6px rgba(0, 255, 0, 0.4),
            0 0 9px rgba(0, 255, 0, 0.2);
    }
    50% {
        text-shadow:
            0 0 4px rgba(0, 255, 0, 0.9),
            0 0 8px rgba(0, 255, 0, 0.5),
            0 0 12px rgba(0, 255, 0, 0.3);
    }
}

/* ═══════════════════ SORTABLE HEADERS ═══════════════════ */
.sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s;
}

.sortable-header:hover {
    background: #002a00;
}

.limited-mode .sortable-header {
    opacity: 0.85;
}

.limited-mode .settings-panel input[disabled],
.limited-mode .settings-panel select[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
}

.limited-mode .settings-panel label {
    opacity: 0.85;
}

.limited-mode .paid-only {
    display: none !important;
}

.limited-mode .sort-indicator,
.limited-mode #priceFilterDropdown {
    display: none !important;
}

.sort-indicator {
    margin-left: 5px;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

/* Up arrow for ascending sort */
.sort-asc .sort-indicator::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 6px solid var(--green);
    filter: drop-shadow(0 0 3px var(--green));
    margin-left: 2px;
}

/* Down arrow for descending sort */
.sort-desc .sort-indicator::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--green);
    filter: drop-shadow(0 0 3px var(--green));
    margin-left: 2px;
}

/* ═══════════════════ PRICE FILTER DROPDOWN ═══════════════════ */
.price-filter-dropdown {
    position: fixed !important; /* Принудительно fixed для выхода из контекста наложения родителя */
    z-index: 99999 !important; /* Максимальный z-index для отображения над всеми элементами, включая таблицу */
    background: rgba(0, 17, 0, 0.98) !important; /* Более непрозрачный фон */
    backdrop-filter: blur(4px); /* Размытие фона для лучшей читаемости */
    border: 2px solid var(--green);
    border-radius: 8px;
    padding: 10px;
    margin-top: 5px;
    min-width: 200px;
    max-width: 300px;
    box-shadow: 0 4px 20px rgba(0, 255, 0, 0.5), 0 0 30px rgba(0, 255, 0, 0.2);
    /* Гарантируем, что dropdown не будет обрезан родительскими элементами */
    transform: translateZ(0); /* Создаем новый контекст наложения */
    isolation: isolate; /* Изолируем от родительского контекста наложения */
}

th.sortable-header {
    position: relative;
}

.price-filter-indicator {
    display: inline-block;
    margin-left: 5px;
    color: var(--green);
    font-size: 13px;
    font-weight: bold;
    cursor: help;
    vertical-align: middle;
    text-shadow: 0 0 5px var(--green);
    animation: pulse-filter 2s ease-in-out infinite;
}

@keyframes pulse-filter {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 5px var(--green);
    }
    50% {
        opacity: 0.7;
        text-shadow: 0 0 10px var(--green);
    }
}

.price-filter-content {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: inherit; /* Наследует z-index от родителя (.price-filter-dropdown) */
}

.price-filter-content input[type="number"] {
    font-size: 12px;
}

.price-filter-content input[type="number"]:focus {
    outline: none;
    box-shadow: 0 0 5px var(--green);
}

.price-filter-content button {
    font-size: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.price-filter-content button:hover {
    transform: scale(1.05);
}

/* ═══════════════════ PRICE TEXT WITH FILTER ICON ═══════════════════ */
.price-text {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.price-text:hover {
    color: var(--green);
    text-decoration: underline;
    text-decoration-color: rgba(0, 255, 0, 0.5);
}

.price-text .filter-icon {
    font-size: 11px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.price-text:hover .filter-icon {
    opacity: 1;
}


/* ═══════════════════ ALERT LEVELS ═══════════════════ */
.alert-1 {
    background: rgba(255, 215, 0, 0.3) !important;
    color: var(--yellow) !important;
}

.alert-2 {
    background: rgba(255, 102, 0, 0.4) !important;
    color: var(--orange) !important;
    animation: pulse 0.5s infinite;
}

.alert-3 {
    background: rgba(255, 0, 0, 0.5) !important;
    color: #fff !important;
    animation: flash 0.2s infinite;
}

.alert-4 {
    background: rgba(0, 255, 100, 0.4) !important;
    color: var(--pump) !important;
}

.invalid {
    opacity: 0.4;
    color: #444 !important;
}

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

@keyframes flash {
    0%, 100% {
        opacity: 1;
        background: rgba(255, 0, 0, 0.7);
    }
    50% {
        opacity: 0.5;
        background: rgba(139, 0, 0, 0.9);
    }
}

@keyframes glow {
    0%, 100% { box-shadow: inset 0 0 20px var(--green); }
    50% { box-shadow: inset 0 0 40px var(--green); }
}

/* ═══════════════════ DELETE BUTTON ═══════════════════ */
.delete-btn {
    background: #500;
    color: var(--red);
    border: 1px solid var(--red);
    border-radius: 4px;
    cursor: pointer;
    padding: 2px 8px;
    font-size: 12px;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: var(--red);
    color: #000;
}

/* ═══════════════════ FULLSCREEN ALERT ═══════════════════ */
#alert {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-weight: bold;
    text-align: center;
    z-index: 999;
    pointer-events: none;
    transition: opacity 0.3s;
}

#alert.yellow {
    background: rgba(255, 215, 0, 0.9);
    color: #000;
}

#alert.orange {
    background: rgba(255, 102, 0, 0.95);
    color: #000;
}

#alert.red {
    background: rgba(180, 0, 0, 0.98);
    color: #fff;
}

#alert.pump {
    background: rgba(0, 100, 0, 0.95);
    color: var(--green);
}

#alert h2 {
    font-size: clamp(30px, 10vw, 80px);
    margin: 0;
    text-shadow: 0 0 30px currentColor;
}

#alert p {
    font-size: clamp(16px, 5vw, 40px);
    margin: 10px 0;
}

.about-btn {
    /* styled by .topbar-btn; keep class for selectors */
}

/* ═══════════════════ SETTINGS BUTTON ═══════════════════ */
.settings-btn {
    /* styled by .topbar-btn; keep class for JS */
}

.settings-btn:hover {
    /* hover handled by .topbar-btn */
}

/* ═══════════════════ PAIRS SELECTION BUTTON ═══════════════════ */
.pairs-btn {
    /* styled by .topbar-btn; keep class for JS */
}

.pairs-btn:hover {
    /* hover handled by .topbar-btn */
}

/* ═══════════════════ SETTINGS PANEL ═══════════════════ */
.overlay-bg {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999;
}

.overlay-bg.open {
    display: block;
}

.settings-panel {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #001100;
    border: 2px solid var(--green);
    padding: 20px;
    border-radius: 15px;
    z-index: 1000;
    min-width: 300px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.settings-panel.open {
    display: block;
}

.settings-panel h3 {
    color: var(--green);
    margin-top: 0;
    text-align: center;
}

.settings-panel label {
    display: block;
    color: var(--green);
    margin: 10px 0 5px;
}

.settings-panel input[type="range"] {
    width: 100%;
    accent-color: var(--green);
}

.settings-panel input[type="checkbox"] {
    margin-right: 10px;
    accent-color: var(--green);
}

.settings-panel select {
    width: 100%;
    padding: 8px;
    background: #000;
    color: var(--green);
    border: 1px solid var(--green);
    border-radius: 5px;
}

.settings-panel .close-btn {
    background: var(--green);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    width: 100%;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.2s;
}

.settings-panel .close-btn:hover {
    background: #0a0;
}

.threshold-value {
    color: var(--green);
    float: right;
    font-weight: 400;
    font-family: 'Share Tech Mono', monospace;
    font-size: 16px;
    letter-spacing: 0.5px;
}

/* ═══════════════════ RESPONSIVE ═══════════════════ */
@media (max-width: 600px) {
    .add-panel {
        flex-direction: column;
        align-items: center;
    }

    .add-panel input {
        width: 100%;
        max-width: none;
    }

    .add-panel button {
        width: 100%;
    }

    th, td {
        padding: 5px 3px;
        font-size: 11px;
    }

    .topbar-btn {
        height: 30px;
        padding: 0 8px;
        font-size: 11px;
        gap: 4px;
    }

    .topbar {
        padding: 6px 8px;
        gap: 6px;
    }

    .topbar-actions {
        gap: 4px;
    }
}

/* Custom Modal Styles */
.custom-modal-content {
    background-color: rgba(0, 0, 0, 0.9); /* Darker background */
    color: #0f0; /* Matrix green text */
    border: 1px solid #0f0; /* Green border */
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.7); /* Green glow effect */
}

.custom-modal-header {
    border-bottom: 1px solid #0f0; /* Green separator */
}

.custom-modal-header .modal-title {
    color: #0f0; /* Green title text */
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-modal-header {
    flex-wrap: wrap;
}

.custom-btn-close {
    filter: invert(1) grayscale(1) brightness(2); /* Make close button green */
}

.btn-close:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 255, 0, 0.25); /* Green focus outline */
}

.custom-modal-body {
    /* Optional: padding adjustments */
    display: flex;
    flex-direction: column;
}

.custom-modal-body label {
    display: block;
    width: 100%;
    margin: 10px 0 5px;
    color: var(--green);
}

.custom-modal-body input[type="range"] {
    width: 100%;
    display: block;
    margin-bottom: 10px;
    accent-color: var(--green);
}

.custom-modal-body input[type="checkbox"] {
    margin-right: 10px;
    accent-color: var(--green);
}

.custom-modal-body select {
    width: 100%;
    display: block;
    padding: 8px;
    background: #000;
    color: var(--green);
    border: 1px solid var(--green);
    border-radius: 4px;
    margin-bottom: 10px;
}

.custom-modal-body hr {
    width: 100%;
    margin: 15px 0;
}

.custom-modal-body h4 {
    width: 100%;
    margin: 10px 0;
}

.custom-modal-body .paid-only {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.custom-modal-body .paid-only label {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

.custom-modal-body p {
    width: 100%;
    display: block;
    margin: 10px 0;
}

.custom-modal-body h3 {
    color: #0f0; /* Green for h3 inside modal */
}

.custom-modal-body ul {
    list-style-type: square; /* Square bullet points */
    padding-left: 20px;
}

.custom-modal-body ul li {
    margin-bottom: 5px;
}

.custom-modal-footer {
    border-top: 1px solid #0f0; /* Green separator */
    justify-content: center; /* Center buttons */
}

.custom-btn {
    background-color: #0f0; /* Green background for buttons */
    color: #000; /* Black text for buttons */
    border: 1px solid #0f0; /* Green border for buttons */
    margin: 0 5px;
}

.custom-btn:hover {
    background-color: #0a0; /* Darker green on hover */
    border-color: #0a0;
    color: #fff; /* White text on hover */
}

/* Specific button styles if needed */
.btn-secondary.custom-btn {
    background-color: #0f0; /* Ensure all custom buttons are green */
    border-color: #0f0;
    color: #000;
}

.btn-primary.custom-btn {
    background-color: #0f0; /* Ensure all custom buttons are green */
    border-color: #0f0;
    color: #000;
}

/* ═══════════════════ ICONS STYLING ═══════════════════ */
.icon-inline {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: middle;
    margin-right: 0.3em;
    color: var(--green);
    filter: drop-shadow(0 0 4px var(--green));
    stroke-width: 2;
}

.icon-inline:last-child {
    margin-right: 0;
}

button .icon-inline,
.btn .icon-inline {
    margin-right: 5px !important;
}

button .icon-inline:last-child,
.btn .icon-inline:last-child {
    margin-right: 0;
    margin-left: 0.4em;
}

.icon-alert {
    width: 1.2em;
    height: 1.2em;
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        filter: drop-shadow(0 0 4px var(--green));
        opacity: 1;
    }
    50% {
        filter: drop-shadow(0 0 12px var(--green));
        opacity: 0.8;
    }
}

/* Icon glow on hover for interactive elements */
button:hover .icon-inline,
.btn:hover .icon-inline,
.topbar-btn:hover .icon-inline {
    filter: drop-shadow(0 0 6px var(--green));
    transition: filter 0.2s ease;
}

/* Исключения для кнопок с черным текстом - иконки остаются черными при hover */
.close-btn:hover .icon-inline,
.settings-panel .close-btn:hover .icon-inline,
.add-panel button:hover .icon-inline,
.btn-secondary.custom-btn:hover .icon-inline,
.btn-primary.custom-btn:hover .icon-inline,
#pairsModal .btn-sm:first-of-type:hover .icon-inline,
button[style*="background:#0f0"]:hover .icon-inline,
button[style*="background:#f60"]:hover .icon-inline,
button[style*="background:var(--green)"]:hover .icon-inline,
.price-filter-content button:hover .icon-inline {
    filter: none !important;
    color: #000 !important;
    stroke: #000 !important;
}

/* Иконки в кнопках с цветным фоном (Apply, Reset) - без свечения */
button[style*="background:#0f0"] .icon-inline,
button[style*="background:#f60"] .icon-inline,
button[style*="background:var(--green)"] .icon-inline {
    filter: none !important;
    color: #000 !important;
    stroke: #000 !important;
}

/* Иконки в кнопках с черным текстом - без свечения */
.price-filter-content button .icon-inline {
    filter: none !important;
    color: #000 !important;
    stroke: #000 !important;
    margin: 0;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Иконки в зеленых кнопках с черным текстом - черные иконки */
.close-btn .icon-inline,
.settings-panel .close-btn .icon-inline,
.add-panel button .icon-inline,
.btn-secondary.custom-btn .icon-inline,
.btn-primary.custom-btn .icon-inline,
#pairsModal .btn-sm:first-of-type .icon-inline {
    filter: none !important;
    color: #000 !important;
    stroke: #000 !important;
}

/* Иконки в кнопках с зеленым текстом на темном фоне - зеленые иконки */
#pairsModal .btn-sm:nth-of-type(2) .icon-inline {
    filter: drop-shadow(0 0 4px var(--green)) !important;
    color: #00FF00 !important;
    stroke: #00FF00 !important;
}

#pairsModal .btn-sm:nth-of-type(3) .icon-inline {
    filter: drop-shadow(0 0 4px #00FF88) !important;
    color: #00FF88 !important;
    stroke: #00FF88 !important;
}

/* Иконки в topbar кнопках - зеленые иконки (уже правильно, но убеждаемся) */
.topbar-btn .icon-inline {
    color: var(--green) !important;
    stroke: var(--green) !important;
    filter: drop-shadow(0 0 3px var(--green));
    width: 14px;
    height: 14px;
    margin-right: 4px;
    flex-shrink: 0;
}

/* ═══════════════════ PAIRS MODAL MULTI-COLUMN LAYOUT ═══════════════════ */
#pairsListContainer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

/* 2 columns on tablets */
@media (min-width: 576px) {
    #pairsListContainer {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 3 columns on medium screens */
@media (min-width: 768px) {
    #pairsListContainer {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 4 columns on large screens */
@media (min-width: 992px) {
    #pairsListContainer {
        grid-template-columns: repeat(4, 1fr);
    }
}

.pair-item {
    display: block;
    padding: 5px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

/* ═══════════════════ PAIRS MODAL BUTTONS - MATRIX GREEN VARIATIONS ═══════════════════ */
/* Select All button - bright green */
#pairsModal .btn-sm:first-of-type {
    background: #00FF00 !important; /* var(--green) */
    color: #000 !important;
    border: 1px solid #00FF00 !important;
}

#pairsModal .btn-sm:first-of-type:hover {
    background: #00CC00 !important; /* darker green */
    border-color: #00CC00 !important;
    color: #000 !important;
}

/* Deselect All button - medium green */
#pairsModal .btn-sm:nth-of-type(2) {
    background: rgba(0, 255, 0, 0.25) !important; /* semi-transparent green */
    color: #00FF00 !important;
    border: 1px solid rgba(0, 255, 0, 0.6) !important;
}

#pairsModal .btn-sm:nth-of-type(2):hover {
    background: rgba(0, 255, 0, 0.4) !important;
    border-color: rgba(0, 255, 0, 0.8) !important;
    color: #00FF00 !important;
}

/* Reset to Full List button - dark green with border */
#pairsModal .btn-sm:nth-of-type(3) {
    background: #001100 !important; /* dark green background */
    color: #00FF88 !important; /* var(--pump) - lighter green text */
    border: 1px solid rgba(0, 255, 0, 0.55) !important;
}

#pairsModal .btn-sm:nth-of-type(3):hover {
    background: rgba(0, 255, 0, 0.16) !important;
    border-color: rgba(0, 255, 0, 0.9) !important;
    color: #00FF00 !important;
}

.corner {
    filter:
        drop-shadow(0 0 6px rgba(0,255,100,0.8))
        drop-shadow(0 0 12px rgba(0,255,100,0.4));
}

.matrix-frame {
    position: relative;
    padding: 2px;
    background: rgba(0, 15, 0, 0.4);
    /* Ретро-эффект свечения рамки */
    box-shadow:
        inset 0 0 20px rgba(0, 255, 100, 0.1),
        0 0 10px rgba(0, 255, 100, 0.05);
}

.matrix-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(0,255,100,0.2);
    box-shadow: inset 0 0 15px rgba(0,255,100,0.1);
    pointer-events: none;
    /* Дополнительные scanlines на рамке */
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 1px,
        rgba(0, 255, 100, 0.01) 1px,
        rgba(0, 255, 100, 0.01) 2px
    );
    opacity: 0.3;
}

.tl { top:-3px; left:-3px; border-width:2px 0 0 2px; }
.tr { top:-3px; right:-3px; border-width:2px 2px 0 0; }
.bl { bottom:-3px; left:-3px; border-width:0 0 2px 2px; }
.br { bottom:-3px; right:-3px; border-width:0 2px 2px 0; }

.corner {
    position: absolute;
    width: 12px;
    height: 12px;
    border-style: solid;
    border-color: rgba(0,255,100,0.8);
}

/* Эффекты для ячеек */
#tableBody td {
    position: relative;
    transition: color 0.3s ease;
}

#tableBody td:hover {
    cursor: help;
    overflow: visible;
    z-index: 10;
}

#tableBody td.energy-up {
    color: #00ff66 !important;
    text-shadow: 0 0 5px rgba(0, 255, 100, 0.5);  /* уменьшить с 8px до 5px */
}

#tableBody td.energy-down {
    color: #ff5555 !important;
    text-shadow: 0 0 5px rgba(255, 85, 85, 0.5);  /* уменьшить с 8px до 5px */
}

#tableBody td::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.matrix-frame.active .corner {
    filter:
        drop-shadow(0 0 10px rgba(0,255,100,1))
        drop-shadow(0 0 22px rgba(0,255,100,0.8));
}

#tableBody td {
    position: relative;
}

@keyframes cell-flash {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.02); }
}

.table-wrap {
    padding: 10px;
}

.matrix-frame {
    position: relative;
    border: 1px solid rgba(0, 255, 100, 0.2);
    background: rgba(0, 10, 0, 0.4);
    box-shadow:
        inset 0 0 20px rgba(0, 255, 100, 0.05),
        0 0 5px rgba(0, 255, 100, 0.1);
    /* Ретро-эффект мерцания рамки */
    animation: frame-flicker 4s ease-in-out infinite;
}

/* Легкое мерцание рамки для эффекта старого терминала */
@keyframes frame-flicker {
    0%, 100% {
        box-shadow:
            inset 0 0 20px rgba(0, 255, 100, 0.05),
            0 0 5px rgba(0, 255, 100, 0.1);
    }
    50% {
        box-shadow:
            inset 0 0 25px rgba(0, 255, 100, 0.08),
            0 0 8px rgba(0, 255, 100, 0.15);
    }
}

/* ═══════════════════ COOLDOWN INDICATORS ═══════════════════ */
/* Elegant gray circular pie chart indicator that decreases clockwise */
/* Shows time remaining until next data update */
.cooldown-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    z-index: 10;
    cursor: default;
}

/* Background circle - subtle gray background */
.cooldown-bg {
    fill: rgba(128, 128, 128, 0.15);
    stroke: rgba(128, 128, 128, 0.25);
    stroke-width: 0.5;
}

/* Progress circle - elegant gray stroke that decreases clockwise */
.cooldown-progress {
    fill: none;
    stroke: rgba(128, 128, 128, 0.6);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 44;
    stroke-dashoffset: 0;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: none; /* Remove transition to allow smooth animation */
}

/* Active state - animates the progress circle decreasing clockwise */
.cooldown-indicator.active .cooldown-progress {
    animation: cooldown-decrease 60s linear forwards;
}

/* Decrease animation - pie chart decreases clockwise from full to empty */
/* stroke-dashoffset goes from 0 (full circle) to -44 (empty circle) */
/* Negative values make it decrease clockwise (positive = counter-clockwise) */
/* Creates elegant countdown effect */
@keyframes cooldown-decrease {
    0% {
        stroke-dashoffset: 0;
        opacity: 0.8;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        stroke-dashoffset: -44;
        opacity: 0.4;
    }
}

/* ═══════════════════ SKELETON LOADING STATES ═══════════════════ */
/* Retro terminal skeleton loading animation for table rows and components */
.skeleton {
    display: inline-block;
    background: rgba(0, 255, 0, 0.08);
    border-radius: 0; /* Убираем скругление для ретро-вида */
    position: relative;
    overflow: hidden;
    /* Эффект свечения как у старых терминалов */
    box-shadow:
        inset 0 0 3px rgba(0, 255, 0, 0.2),
        0 0 2px rgba(0, 255, 0, 0.1);
}

.skeleton::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 255, 0, 0.15) 50%,
        transparent 100%
    );
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.skeleton-row {
    opacity: 0.7;
    animation: skeleton-row-fade 0.3s ease-in;
    /* Ретро-эффект мерцания для skeleton */
    animation: skeleton-row-fade 0.3s ease-in, terminal-flicker 2s ease-in-out infinite;
}

@keyframes skeleton-row-fade {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.7;
    }
}

.skeleton-row td {
    position: relative;
    overflow: hidden;
    padding: 12px 8px !important;
    vertical-align: middle;
    /* Ретро-фон для skeleton ячеек */
    background: rgba(0, 20, 0, 0.3) !important;
    /* Scanlines эффект для skeleton */
    background-image: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 0, 0.03) 0px,
        rgba(0, 255, 0, 0.03) 1px,
        transparent 1px,
        transparent 2px
    ) !important;
}

/* Skeleton cell content - empty cells with retro terminal shimmer effect */
.skeleton-row td::before {
    content: '';
    display: block;
    width: 80px;
    height: 16px;
    background: rgba(0, 255, 0, 0.08);
    border-radius: 0; /* Убираем скругление для ретро-вида */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    overflow: hidden;
    /* Эффект свечения как у старых терминалов */
    box-shadow:
        inset 0 0 2px rgba(0, 255, 0, 0.2),
        0 0 1px rgba(0, 255, 0, 0.1);
    /* Scanlines на skeleton элементах */
    background-image: repeating-linear-gradient(
        90deg,
        rgba(0, 255, 0, 0.05) 0px,
        rgba(0, 255, 0, 0.05) 1px,
        transparent 1px,
        transparent 2px
    );
}

.skeleton-row td::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 8px;
    width: 80px;
    height: 16px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 255, 0, 0.25) 50%,
        transparent 100%
    );
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 0; /* Убираем скругление для ретро-вида */
    /* Эффект свечения для анимации shimmer */
    box-shadow: 0 0 3px rgba(0, 255, 0, 0.2);
}

/* Varied widths for different columns to look more realistic */
.skeleton-row td:nth-child(1)::before,
.skeleton-row td:nth-child(1)::after {
    width: 80px;
}

.skeleton-row td:nth-child(2)::before,
.skeleton-row td:nth-child(2)::after {
    width: 100px;
}

.skeleton-row td:nth-child(3)::before,
.skeleton-row td:nth-child(3)::after {
    width: 60px;
}

.skeleton-row td:nth-child(4)::before,
.skeleton-row td:nth-child(4)::after {
    width: 70px;
}

.skeleton-row td:nth-child(5)::before,
.skeleton-row td:nth-child(5)::after {
    width: 70px;
}

.skeleton-row td:nth-child(6)::before,
.skeleton-row td:nth-child(6)::after {
    width: 80px;
}

.skeleton-row td:nth-child(7)::before,
.skeleton-row td:nth-child(7)::after {
    width: 90px;
}

.skeleton-row td:nth-child(8)::before,
.skeleton-row td:nth-child(8)::after {
    width: 70px;
}

/* Skeleton for market context cards */
.skeleton-card {
    min-height: 60px;
    background: linear-gradient(
        90deg,
        rgba(0, 255, 0, 0.05) 0%,
        rgba(0, 255, 0, 0.1) 50%,
        rgba(0, 255, 0, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* Loading state for status indicators */
.loading-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(0, 255, 0, 0.3);
    border-top-color: rgba(0, 255, 0, 0.8);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

/* Fade-in animation for content appearing */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ═══════════════════ BUG REPORT FEEDBACK BUTTON ═══════════════════ */
.bug-report-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 255, 0, 0.15);
    border: 2px solid rgba(0, 255, 0, 0.5);
    color: #0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.3);
    transition: all 0.3s ease;
    backdrop-filter: blur(6px);
    opacity: 1;
    transform: translateY(0);
}

/* Hide button when near bottom of page */
.bug-report-btn.hidden {
    opacity: 0;
    transform: translateY(100px);
    pointer-events: none;
}

.bug-report-btn:hover {
    background: rgba(0, 255, 0, 0.25);
    border-color: rgba(0, 255, 0, 0.8);
    box-shadow: 0 6px 16px rgba(0, 255, 0, 0.5);
    transform: scale(1.05);
}

.bug-report-btn:active {
    transform: scale(0.95);
}

.bug-report-btn svg {
    filter: drop-shadow(0 0 4px rgba(0, 255, 0, 0.8));
}

/* Form input styles for bug report */
.custom-input,
.custom-textarea {
    width: 100%;
    padding: 10px;
    background: rgba(0, 20, 0, 0.5);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 4px;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.custom-input:focus,
.custom-textarea:focus {
    outline: none;
    border-color: rgba(0, 255, 0, 0.8);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.3);
}

.custom-input::placeholder,
.custom-textarea::placeholder {
    color: rgba(0, 255, 0, 0.4);
}

.custom-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Success/Error message styles */
#bugReportMessage {
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

#bugReportMessage.success {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid rgba(0, 255, 0, 0.5);
    color: #0f0;
}

#bugReportMessage.error {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.5);
    color: #f00;
}

/* Form group spacing */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #0f0;
    font-size: 12px;
    font-weight: bold;
}

/* Required field indicator */
.form-group label span {
    color: #f00;
    margin-left: 2px;
}
