/* ===== ОСНОВНЫЕ СТИЛИ ===== */
:root {
    --bg-primary: #161a21;
    --bg-secondary: #1d2028;
    --border-color: #333842;
    --text-primary: #fff;
    --text-secondary: #888;
    --accent-gold: #ffb500;
    --accent-green: #4caf50;
    --accent-red: #f44336;
}

body {
    background-color: var(--bg-primary);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    width: 100%;
}

main {
    flex: 1 0 auto;
}

/* ===== БАЗОВЫЙ ЦВЕТ ТЕКСТА ===== */
body, main, div, p, span, h1, h2, h3, h4, h5, h6, li, td, th {
    color: var(--text-primary);
}

a {
    color: var(--accent-gold);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== ШАПКА И НАВИГАЦИЯ ===== */
.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background-color: var(--bg-secondary);
    flex-wrap: wrap;
    gap: 15px;
}

.header-top {
    flex-shrink: 0;
}

.header-top .logo {
    height: 40px;
    width: auto;
    display: block;
}

nav {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1 1 auto;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 5px 12px;
    transition: all 0.3s ease;
    font-weight: bold;
    white-space: nowrap;
}

nav a:hover {
    color: var(--accent-gold);
    text-decoration: none;
}

nav .search {
    color: var(--bg-primary);
}

/* ===== ЦЕНЫ ===== */
.price-now {
    border-top: 1px solid var(--bg-primary);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6%;
    padding: 10px;
}

.crypto-item {
    color: var(--text-primary);  /* Белый цвет для всего блока */
    font-size: 14px;
    letter-spacing: 2px;
    padding: 5px 10px;
    border-radius: 4px;
}

/* Цена всегда белая */
.crypto-item .price-value {
    color: var(--text-primary);
    font-weight: normal;
}

/* Стрелка и процент */
.price-up {
    color: var(--accent-green);
}

.price-down {
    color: var(--accent-red);
}

.price-up::before {
    content: "▲";
    margin-right: 4px;
    font-size: 10px;
}

.price-down::before {
    content: "▼";
    margin-right: 4px;
    font-size: 10px;
}

.price-up small,
.price-down small {
    font-size: 0.8em;
    opacity: 0.8;
}

/* ===== ОСНОВНОЙ КОНТЕЙНЕР ===== */
.main-content {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    flex: 1 0 auto;
    width: 100%;
}

/* ===== БЛОКИ ПРОГНОЗОВ И КАРТОЧКИ ===== */
.forecast-block,
.info-card,
.fear-greed-widget {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.forecast-block {
    padding: 30px;
    margin-bottom: 40px;
    width: 100%;
}

.forecast-title {
    color: var(--accent-gold);
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.forecast-content {
    color: var(--text-primary);
    font-size: 1.1em;
    line-height: 1.6;
}

.forecast-content p {
    margin: 0 0 10px;
}

.forecast-content ul {
    color: var(--text-primary);
    padding-left: 20px;
    line-height: 1.8;
}

.forecast-content li {
    margin-bottom: 8px;
}

.forecast-content li::marker {
    color: var(--accent-gold);
}

.forecast-date {
    color: var(--text-secondary);
    font-size: 0.9em;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: 15px;
    text-align: right;
}

/* ===== СЕТКА КАРТОЧЕК НА ГЛАВНОЙ ===== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.info-card {
    padding: 20px;
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
}

.info-card h3 {
    margin-top: 0;
    color: var(--accent-gold);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.info-card p {
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 0.95em;
    margin-bottom: 15px;
}

.coming-soon {
    display: inline-block;
    background: #ffd500;
    color: #333;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    margin-top: 10px;
}

/* ===== ФУТЕР ===== */
.site-footer {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    font-size: 14px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    width: 100%;
}

.footer-content p {
    margin: 5px 0;
    opacity: 0.8;
}

.disclaimer {
    font-size: 12px;
    opacity: 0.6;
}

/* ===== ТЕХНОЛОГИИ ===== */
.tech-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-list li {
    background: var(--bg-secondary);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 8px 15px;
    font-size: 0.9em;
}

/* ===== ПАГИНАЦИЯ ===== */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.pagination-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-info {
    color: var(--text-primary);
    padding: 5px 10px;
}

.pagination-link {
    color: var(--text-primary);
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid var(--accent-gold);
    transition: all 0.3s ease;
}

.pagination-link:hover {
    background: var(--accent-gold);
    color: #000;
    text-decoration: none;
}

/* ===== СТРАНИЦА "ТОП БИРЖ" ===== */
.exchange-list h3 {
    color: var(--accent-gold);
    margin-top: 30px;
}

.exchange-list h3:first-of-type {
    margin-top: 20px;
}

.pros {
    color: var(--accent-green);
}

.cons {
    color: var(--accent-red);
}

.binance-block,
.disclaimer-block {
    border-color: var(--accent-gold);
}

.binance-link {
    color: var(--accent-gold);
    text-decoration: none;
}

/* ===== СРАВНИТЕЛЬНАЯ ТАБЛИЦА ===== */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    text-align: left;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

/* ===== ОБЩИЕ СТИЛИ ДЛЯ ЗОЛОТЫХ ССЫЛОК ===== */
.gold-link {
    color: var(--accent-gold);
    text-decoration: none;
}

/* ===== ТАБЛИЦА ВСЕХ КРИПТОВАЛЮТ ===== */
.coins-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-primary);
    table-layout: fixed;
}

.coins-table th {
    text-align: left;
    padding: 12px 8px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: normal;
    position: relative;
}

.coins-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Фиксированная ширина колонок */
.coins-table th:nth-child(1) { width: 5%; }
.coins-table th:nth-child(2) { width: 44%; }
.coins-table th:nth-child(3) { width: 12%; }
.coins-table th:nth-child(4) { width: 12%; }
.coins-table th:nth-child(5) { width: 15%; }
.coins-table th:nth-child(6) { width: 12%; }

/* Подсветка строк при наведении */
.coins-table tbody tr {
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.coins-table tbody tr:hover {
    background-color: #161a21; 
}


/* Отключаем на мобилках */
@media (max-width: 768px) {
    .coins-table tbody tr:hover {
        background-color: transparent;
    }
}

.sort-indicator {
    position: absolute;
    margin-left: 4px;
    color: var(--accent-gold);
}

.coins-table th:hover {
    background-color: transparent;
}

/* ===== ИНДЕКС СТРАХА И ЖАДНОСТИ ===== */
.fear-greed-widget {
    padding: 20px;
    margin-bottom: 30px;
}

.fear-greed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.fear-greed-header h3 {
    margin: 0;
    color: var(--accent-gold);
    font-size: 1.2em;
}

.fear-greed-value {
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
}

.fear-greed-value.fear {
    color: var(--accent-red);
}

.fear-greed-value.greed {
    color: var(--accent-green);
}

.fear-greed-value.neutral {
    color: var(--accent-gold);
}

.fear-greed-meter {
    height: 10px;
    background-color: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.meter-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-gold), var(--accent-green));
    border-radius: 5px;
    transition: width 0.3s ease;
}

.fear-greed-value-main {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--text-primary);
}

#fear-greed-link {
    text-decoration: none;
}

#fear-greed-link h3 {
    color: var(--text-primary);
    transition: color 0.2s ease;
    margin: 0;
}

#fear-greed-link:hover h3 {
    color: var(--accent-gold);
    text-decoration: none;
}

.fng-classification.fear { color: var(--accent-red); }
.fng-classification.greed { color: var(--accent-green); }
.fng-classification.neutral { color: var(--accent-gold); }

/* ===== СТРАНИЦА МОНЕТЫ ===== */
.coin-title-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.coin-title-icon {
    width: 48px;
    height: 48px;
}

.coin-title {
    font-size: 2.2em;
    font-weight: bold;
    color: var(--text-primary);
    line-height: 1.2;
}

.coin-title-price {
    font-size: 1.8em;
    color: var(--text-primary);
    margin-top: 5px;
}

.coin-title-change {
    font-size: 0.9em;
    margin-left: 15px;
}

/* Рыночные данные в одну строку */
.market-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.market-item {
    text-align: center;
    min-width: 100px;
    flex: 1;
}

.market-label {
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.market-value {
    color: var(--text-primary);
    font-weight: bold;
    font-size: 1.1em;
}

/* Контейнер для графика */
.chart-container {
    width: 100%;
    margin-top: 20px;
}

.tradingview-chart {
    height: 600px;
    width: 100%;
}

/* Источники */
.sources {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-top: 15px;
    text-align: right;
}

/* ===== АДАПТАЦИЯ ===== */
@media (max-width: 1024px) {
    .header-main {
        flex-direction: column;
        align-items: center;
    }
    
    .header-top {
        margin-bottom: 10px;
    }

    nav a {
        font-size: 14px;
        padding: 5px 8px;
    }
    
    .price-now {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .header-main {
        padding: 10px;
    }
    
    .header-top .logo {
        height: 35px;
    }

    nav {
        gap: 5px;
    }

    nav a {
        font-size: 13px;
        padding: 4px 6px;
    }

    .price-now {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .forecast-title {
        font-size: 1.3em;
    }
    
    .forecast-content {
        font-size: 1em;
    }
    
    .market-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .market-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    
    .market-label {
        margin-bottom: 0;
    }
    
    .coin-title {
        font-size: 1.8em;
    }
    
    .coin-title-price {
        font-size: 1.4em;
    }
}

@media (max-width: 480px) {
    .header-top .logo {
        height: 30px;
    }

    nav a {
        font-size: 11px;
        padding: 3px 5px;
    }

    .crypto-item {
        font-size: 11px;
    }

    .main-content {
        padding: 0 10px;
    }

    .forecast-block {
        padding: 20px;
    }

    .forecast-title {
        font-size: 1.1em;
    }

    .forecast-content {
        font-size: 0.95em;
    }

    .info-card {
        padding: 15px;
    }

    .info-card p {
        font-size: 13px;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 12px;
    }

    .pagination-link,
    .coming-soon,
    .info-card a {
        padding: 8px 12px;
    }

    .price-now {
        gap: 5px;
    }
    
    .coin-title-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tradingview-chart {
        height: 400px;
    }
}