:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    --accent-primary: #00ffff;
    --accent-secondary: #0080ff;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 30px 60px rgba(0, 0, 0, 0.4);
    --trust-high: #27ae60;
    --trust-medium: #f39c12;
    --trust-low: #e74c3c;
}

[data-theme="light"] {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #404040;
    --text-muted: #666666;
    --accent-primary: #0056b3;
    --accent-secondary: #003d82;
    --border-color: #d0d7de;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 16px 32px rgba(0, 0, 0, 0.15);
    --trust-high: #28a745;
    --trust-medium: #ffc107;
    --trust-low: #dc3545;
}

/* === ОБЩИЕ СТИЛИ ДЛЯ СТРАНИЦ БИРЖ === */
.exchanges-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--accent-primary);
    margin-bottom: 15px;
    font-weight: 700;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Сортировка */
.sort-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.sort-options a {
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.sort-options a:hover,
.sort-options a.active {
    background: var(--accent-primary);
    color: #000;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 255, 0.3);
}

[data-theme="light"] .sort-options a:hover,
[data-theme="light"] .sort-options a.active {
    background: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3);
}

/* Сетка бирж */
.exchanges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.exchange-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.exchange-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.exchange-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-primary);
}

.exchange-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.exchange-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 20px;
    object-fit: cover;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.exchange-card:hover .exchange-logo {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.exchange-card h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: 600;
}

.exchange-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.exchange-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.trust-score {
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.coins {
    color: var(--text-secondary);
    font-weight: 500;
    background: var(--bg-secondary);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.volume-badge {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 15px;
    text-align: center;
    display: inline-block;
    width: 100%;
}

[data-theme="light"] .volume-badge {
    color: #ffffff;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination a {
    padding: 12px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.pagination a:hover,
.pagination a.active {
    background: var(--accent-primary);
    color: #000;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

[data-theme="light"] .pagination a:hover,
[data-theme="light"] .pagination a.active {
    color: #ffffff;
}

/* Детальная страница биржи */
.exchange-detail {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.exchange-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.exchange-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.exchange-header .exchange-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    flex-shrink: 0;
}

.exchange-title {
    flex: 1;
}

.exchange-title h1 {
    font-size: 2.2rem;
    color: var(--accent-primary);
    margin-bottom: 15px;
    font-weight: 700;
}

.badge-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.header-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    backdrop-filter: blur(10px);
}

/* Общие секции (для страницы биржи) */
.section {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.section h3 {
    color: var(--accent-primary);
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

/* Основная информация */
.exchange-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.meta-item {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--accent-primary);
    transition: all 0.3s ease;
}

.meta-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.meta-item strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.meta-item span {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 25px 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    transition: transform 0.3s ease;
    border: 1px solid var(--border-color);
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--accent-primary);
}

.stat-item strong {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.stat-item span {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

/* Ссылки */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.link-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    background: var(--accent-primary);
    color: #000;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    gap: 8px;
    border: 2px solid transparent;
}

[data-theme="light"] .link-item {
    color: #ffffff;
}

.link-item:hover {
    background: transparent;
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 255, 0.2);
}

/* Описание */
.exchange-description p {
    line-height: 1.7;
    color: var(--text-secondary);
    font-size: 1.05rem;
    text-align: justify;
}

/* Сообщение об ошибке */
.error-message {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    max-width: 500px;
    margin: 50px auto;
    backdrop-filter: blur(10px);
}

.error-message::before {
    content: "⚠️";
    font-size: 3rem;
    display: block;
    margin-bottom: 20px;
}

.error-message h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
}

.error-message p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.error-message a {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent-primary);
    color: #000;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

[data-theme="light"] .error-message a {
    color: #ffffff;
}

.error-message a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 255, 0.3);
}

/* Уведомления */
.notice {
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border-left: 4px solid;
    backdrop-filter: blur(10px);
}

.notice-warning {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.1) 0%, rgba(243, 156, 18, 0.05) 100%);
    border-left-color: #f39c12;
    color: var(--text-primary);
}

.notice-alert {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(231, 76, 60, 0.05) 100%);
    border-left-color: #e74c3c;
    color: var(--text-primary);
}

.notice strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

/* Кнопка возврата */
.back-button {
    text-align: center;
    margin-top: 40px;
}

.back-button a {
    display: inline-block;
    padding: 15px 30px;
    background: var(--accent-primary);
    color: #000;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

[data-theme="light"] .back-button a {
    color: #ffffff;
}

.back-button a:hover {
    background: transparent;
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 255, 0.2);
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.exchange-card,
.section,
.exchange-header {
    animation: fadeIn 0.6s ease-out;
}

/* === СТИЛИ ДЛЯ СТРАНИЦЫ ОБЗОРА (EXCHANGE REVIEW) === */
.exchange-review {
    max-width: 900px;
    margin: 0 auto;
    font-family: 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Стили секций для exchange-review */
.exchange-review .section {
    margin: 40px 0;
    padding: 25px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border-left: 5px solid var(--accent-primary);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.exchange-review .section::before {
    display: none; /* Убираем градиентную линию для секций отзыва */
}

.exchange-review .section h2 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 25px;
    font-size: 1.5em;
    font-weight: 600;
}

/* Сетки и карточки для exchange-review */
.exchange-review .feature-grid,
.exchange-review .payment-features,
.exchange-review .tips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.exchange-review .feature-item,
.exchange-review .payment-item,
.exchange-review .tip-item {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.exchange-review .feature-item:hover,
.exchange-review .payment-item:hover,
.exchange-review .tip-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--accent-primary);
}

.exchange-review .feature-item h4,
.exchange-review .payment-item h4,
.exchange-review .tip-item h4 {
    color: var(--accent-primary);
    margin-bottom: 10px;
    font-weight: 600;
}

/* Плюсы и минусы для exchange-review */
.exchange-review .pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 25px 0;
}

.exchange-review .pros,
.exchange-review .cons {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
}

.exchange-review .pros h4 {
    color: var(--trust-high);
    margin-bottom: 15px;
    font-weight: 600;
}

.exchange-review .cons h4 {
    color: var(--trust-low);
    margin-bottom: 15px;
    font-weight: 600;
}

/* Элементы безопасности для exchange-review */
.exchange-review .security-features {
    margin: 25px 0;
}

.exchange-review .security-item {
    background: var(--bg-primary);
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
}

/* Список стран для exchange-review */
.exchange-review .restricted-countries {
    background: var(--bg-primary);
    padding: 25px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
}

.exchange-review .country-lists {
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
}

/* Секция арбитража для exchange-review */
.exchange-review .arbitrage-section {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    margin: 40px 0;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
}

.exchange-review .arbitrage-pros,
.exchange-review .arbitrage-warning,
.exchange-review .arbitrage-conclusion {
    background: var(--bg-primary);
    padding: 25px;
    margin: 20px 0;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
}

.exchange-review .pros-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.exchange-review .arbitrage-warning {
    border-left: 4px solid var(--trust-medium);
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.1) 0%, rgba(243, 156, 18, 0.05) 100%);
}

.exchange-review .warning-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.exchange-review .warning-icon {
    font-size: 24px;
    margin-right: 10px;
}

.exchange-review .arbitrage-conclusion {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1) 0%, rgba(39, 174, 96, 0.05) 100%);
    border-left: 4px solid var(--trust-high);
}

/* Дополнительные элементы для exchange-review */
.exchange-review .icon-large {
    font-size: 20px;
}

.exchange-review .note {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.1) 0%, rgba(243, 156, 18, 0.05) 100%);
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    border-left: 4px solid var(--trust-medium);
}

.exchange-review .sub-features {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
}

/* Стилизация скроллбара для exchange-review */
.exchange-review .country-lists::-webkit-scrollbar {
    width: 8px;
}

.exchange-review .country-lists::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

.exchange-review .country-lists::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

.exchange-review .country-lists::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Стили списков для exchange-review */
.exchange-review ul {
    color: var(--text-primary);
}

.exchange-review li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.exchange-review strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Плавные переходы для exchange-review */
.exchange-review,
.exchange-review .section,
.exchange-review .feature-item,
.exchange-review .payment-item,
.exchange-review .tip-item,
.exchange-review .pros,
.exchange-review .cons,
.exchange-review .security-item,
.exchange-review .restricted-countries,
.exchange-review .arbitrage-pros,
.exchange-review .arbitrage-warning,
.exchange-review .arbitrage-conclusion {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 768px) {
    /* Общие адаптивные стили */
    .exchanges-grid {
        grid-template-columns: 1fr;
    }
    
    .exchange-header {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }
    
    .exchange-header .exchange-logo {
        width: 100px;
        height: 100px;
    }
    
    .sort-options {
        flex-direction: column;
        align-items: center;
    }
    
    .sort-options a {
        width: 200px;
    }
    
    .exchange-meta-grid,
    .stats-grid,
    .links-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        padding: 30px 15px;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    /* Адаптивность для exchange-review */
    .exchange-review .pros-cons {
        grid-template-columns: 1fr;
    }
    
    .exchange-review .feature-grid,
    .exchange-review .payment-features,
    .exchange-review .tips {
        grid-template-columns: 1fr;
    }
    
    .exchange-review .section {
        padding: 15px;
        margin: 20px 0;
    }
    
    .exchange-review .arbitrage-section {
        padding: 20px;
    }
    
    .exchange-review .section h2 {
        font-size: 1.3em;
    }
}

@media (max-width: 480px) {
    /* Общие адаптивные стили */
    .exchanges-container {
        padding: 15px;
    }
    
    .exchange-card {
        padding: 20px;
    }
    
    .section {
        padding: 20px;
    }
    
    .exchange-header {
        padding: 25px 15px;
    }
    
    .exchange-title h1 {
        font-size: 1.8rem;
    }
    
    .badge-container {
        justify-content: center;
    }
}