:root {
    /* Основной фон (глубокий темно-синий) */
    --bg-color: #0f172a; 
    
    /* ГЛАВНЫЙ ЦВЕТ ТЕКСТА (не чисто белый, а "молочный") */
    --text-main: #7fc2cb; 
    
    /* ВТОРОСТЕПЕННЫЙ ТЕКСТ (для подписей, дат и футера) */
    --text-muted: #94a3b8; 
    
    /* АКЦЕНТНЫЙ ЦВЕТ (для ссылок и выделений) */
    --accent: #10b981; 

    --bg-dark:  #0f172a; 
}

body {
    background-color: var(--bg-color);
    color: var(--text-main); /* Применяем наш мягкий белый */
    font-family: 'Inter', sans-serif; /* Если есть возможность, подключи этот шрифт */
    -webkit-font-smoothing: antialiased; /* Делает текст четче на Mac/iOS */
}

body.dark-theme {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 10;
}

tr {
text-align: center;
}

.main-nav {
    background: var(--card-bg);
    padding: 1rem 0;
    border-bottom: 1px solid #334155;
    margin-bottom: 2rem;
}

.nav-wrapper { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.5rem; font-weight: 700; color: #7fc2cb; text-decoration: none; }
.logo span { color: var(--accent); }
.nav-links { list-style: none; display: flex; gap: 20px; }
.nav-links a { color: #94a3b8; text-decoration: none; transition: 0.3s; }
.nav-links a:hover { color: #7fc2cb; }
.main-footer {
    background: var(--card-bg);
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid #334155;
    color: #64748b;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    margin-left: 20px;
}

.footer-links a:hover {
    color: #7fc2cb;
}
/* Таблица и ячейки */
.market-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 1rem; }
.market-table th { color: #64748b; font-size: 0.85rem; text-transform: uppercase; padding: 15px; border-bottom: 2px solid #334155; }
.market-table td { padding: 15px; border-bottom: 1px solid #1e293b; transition: background 0.2s; }
.market-table tr:hover td { background: #1e293b; }

/* Кастомные элементы */
.ticker-cell .company-name { display: block; font-size: 0.75rem; color: #94a3b8; }
.status-buy { color: #22c55e; font-weight: bold; background: rgba(34, 197, 94, 0.1); }
.status-sell { color: #ef4444; font-weight: bold; background: rgba(239, 68, 68, 0.1); }
.deep-drop { color: #f97316; font-weight: bold; }

/* Визуализация диапазона */
.mini-chart-container { display: flex; align-items: center; gap: 10px; }
.progress-track { flex-grow: 1; height: 4px; background: #334155; border-radius: 2px; position: relative; }
.progress-bar { height: 100%; background: var(--accent); border-radius: 2px; box-shadow: 0 0 8px var(--accent); }
.limit-label { font-size: 0.7rem; color: #64748b; min-width: 40px; }

/* Кнопка */
.btn-action { background: #334155; color: #7fc2cb; text-decoration: none; padding: 6px 12px; border-radius: 4px; font-size: 0.85rem; }
.btn-action:hover { background: var(--accent); }

/* Анимация появления */
#ticker-body tr {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Фиксированная шапка, чтобы не пропадала при скролле */
.market-table thead th {
    position: sticky;
    top: 0;
    background: #1e293b;
    z-index: 10;
}

/* Спиннер */
.loader {
    text-align: center;
    padding: 20px;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }


/* Красивый индикатор диапазона */
.price-range-bg {
    width: 100%;
    height: 4px;
    background: #334155;
    border-radius: 2px;
    position: relative;
    margin-bottom: 4px;
}
.price-range-bar {
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    position: absolute;
    top: -2px;
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
}

/* Стили для пустого состояния */
.empty-state {
    padding: 60px !important;
    color: #94a3b8;
}
.no-data {
    text-align: center;
}
.no-data span { font-size: 3rem; display: block; margin-bottom: 10px; }

/* RSI подсветка */
.rsi-low { color: #22c55e; font-weight: bold; }
.drop-cell { color: #ef4444; }

/* Подсвечиваем активную колонку при разных фильтрах */
.active-sort {
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
}

#ticker-search {
    width: 100%;
    padding: 12px 20px;
    margin: 20px 0;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    transition: border-color 0.2s;
}
#ticker-search:focus {
    border-color: #3b82f6;
    outline: none;
}

.range-wrapper { width: 120px; }
.range-track { 
    height: 4px; background: #334155; position: relative; border-radius: 2px; margin-bottom: 4px; 
}
.range-dot { 
    width: 8px; height: 8px; background: #3b82f6; border-radius: 50%; 
    position: absolute; top: -2px; transform: translateX(-50%); 
}
.range-labels { display: flex; justify-content: space-between; font-size: 10px; color: #64748b; }
.rsi-val.good { color: #22c55e; font-weight: bold; }
.drop-val.bad { color: #ef4444; font-weight: bold; }
.btn-filter.active { background: #3b82f6; color: white; }


.mini-chart-container {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

.limit-label {
    font-size: 11px;
    color: #64748b; /* Приглушенный стальной цвет */
    font-family: 'Monaco', monospace;
}

.progress-track {
    flex-grow: 1;
    height: 6px;
    background: #1e293b; /* Глубокий темный фон */
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid #334155;
}

.progress-bar {
    height: 100%;
    /* Градиент от синего к голубому создает эффект объема */
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
    border-radius: 10px;
    position: relative;
    transition: width 0.5s ease-out; /* Плавная анимация при загрузке */
}

/* Эффект свечения на конце полоски */
.progress-glow {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 4px;
    box-shadow: 0 0 10px #3b82f6, 0 0 5px #3b82f6;
    background: #7fc2cb;
}

.market-table {
    width: 100%;
    border-collapse: collapse;
    /* ГЛАВНОЕ: колонки теперь не будут менять ширину от контента */
    table-layout: fixed; 
}

/* Задаем ширину для каждой колонки в процентах или пикселях */
.market-table th:nth-child(1) { width: 80px; }  /* Тикер */
.market-table th:nth-child(2) { width: 25%; }   /* Название */
.market-table th:nth-child(3) { width: 120px; } /* Цена */
.market-table th:nth-child(4) { width: auto; }  /* Диапазон (тянется) */
.market-table th:nth-child(5) { width: 100px; } /* RSI */
.market-table th:nth-child(6) { width: 100px; } /* Просадка */
.market-table th:nth-child(7) { width: 110px; } /* Кнопка */

/* Чтобы длинные названия не ломали таблицу, а превращались в многоточие */
.market-table td:nth-child(2) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.market-table td, .market-table th {
    padding: 12px 15px;
    box-sizing: border-box;
}

[data-macd="MACD_BUY"] .macd-cell { 
    background: #059669; color: white; border-radius: 4px; animation: pulse 2s infinite; 
}
@keyframes pulse {
    0% { opacity: 1; } 50% { opacity: 0.7; } 100% { opacity: 1; }
}

.signals-wrapper {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-success { background: #059669; color: white; }
.badge-danger { background: #dc2626; color: white; }
.badge-info { background: #2563eb; color: white; }
.badge-gold { background: #ca8a04; color: white; border: 1px solid #facc15; }

/* Анимация для самого сильного сигнала */
.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% { box-shadow: 0 0 0 0px rgba(5, 150, 105, 0.7); }
    100% { box-shadow: 0 0 0 10px rgba(5, 150, 105, 0); }
}


/* В style.css */
tr[data-weight="100"], tr[data-weight="110"], tr[data-weight="120"] {
    background: rgba(34, 197, 94, 0.05); /* Легкий зеленый фон для супер-сигналов */
}


/* Бейдж для покупки с акцентом на зеленую линию */
.badge-macd-buy {
    background: #064e3b; /* Очень темный зеленый фон */
    color: #10b981;    /* Ярко-зеленый текст */
    border: 1px solid #10b981; /* ТА САМАЯ зеленая линия-рамка */
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.2); /* Легкое свечение */
}

/* Анимация пульсации именно для зеленой линии */
.pulse-green {
    animation: border-glow 2s infinite;
}

@keyframes border-glow {
    0% { border-color: #10b981; box-shadow: 0 0 2px #10b981; }
    50% { border-color: #34d399; box-shadow: 0 0 10px #34d399; }
    100% { border-color: #10b981; box-shadow: 0 0 2px #10b981; }
}

.line-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    /* Добавим легкое свечение самой линии */
    filter: drop-shadow(0 0 2px #10b981);
}

.emoji-green {
    display: inline-block;
    /* Магия фильтров: превращаем любой цвет линии в ярко-зеленый */
    filter: sepia(1) hue-rotate(90deg) brightness(1.2) saturate(5);
    margin-right: 5px;
    font-size: 1.2em;
    vertical-align: middle;
}

.badge-macd-buy {
    display: inline-flex;
    align-items: center;
    background: #064e3b; 
    color: #10b981;
    border: 1px solid #10b981;
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: bold;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

/* Фильтр для превращения линии в 📈 в ярко-зеленую */
.emoji-trend-green {
    display: inline-block;
    filter: sepia(1) hue-rotate(90deg) brightness(1.1) saturate(4);
    margin-right: 4px;
    vertical-align: middle;
}

/* Стили для бейджа тренда (SMA) */
.badge-trend {
    background: #1e3a8a; /* Темно-синий фон (фон "Инфо") */
    color: #60a5fa;      /* Голубой текст */
    border: 1px solid #3b82f6;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
}

.loader {
    border: 3px solid #1e293b;
    border-top: 3px solid #10b981;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Стиль для ячейки с тикером */
.ticker-id {
    color: var(--text-main); /* Наш мягкий белый #e2e8f0 */
    font-weight: 700;        /* Делаем жирным, чтобы выделялся */
    font-family: 'Monaco', 'Consolas', monospace; /* Моноширинный шрифт — это стандарт для тикеров */
    letter-spacing: 0.5px;   /* Чуть-чуть раздвинем буквы */
    text-transform: uppercase;
}

/* Если тикер — это ссылка */
a.ticker-link {
    text-decoration: none;
    color: #94a3b8; /* Сначала делаем его чуть серым */
    transition: all 0.2s ease;
}

a.ticker-link:hover {
    color: var(--accent); /* При наведении подсвечиваем зеленым */
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* В style.css */
tbody tr {
    transition: background-color 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02); /* Почти прозрачный слой для четных строк */
}

tbody tr:hover {
    background-color: rgba(16, 185, 129, 0.08); /* Очень мягкая зеленая подсветка всей строки */
}