/* --- Глобальные стили и переменные --- */
:root {
    --secondary-color: #00c6a7;
    --dark-blue: #1a1f3a;
    --body-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --footer-bg: #161924;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --border-radius: 12px;
    /* Убрали Manrope, теперь наследуется Montserrat из style.css */
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Секция Hero --- */
.hero {
    padding: 50px 0;
    background: linear-gradient(135deg, #037deb 0%, #522fd9 50%, #00c6a7 90%);
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.hero .container {
    position: relative;
    z-index: 1;
    text-align: center;
}

.breadcrumbs { 
    margin-bottom: 30px; 
}

.hero h1 {
    /* Синхронизировано с style.css .hero-title */
    font-size: 3rem; 
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
    color: #e2e8f0;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* --- ОБНОВЛЕННЫЕ СТИЛИ СТАТИСТИКИ (Минималистичные) --- */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.hero-stat:hover {
    transform: translateY(-4px);
}

.hero-stat .value {
    font-size: 2.3rem;
    font-weight: 800;
    color: #ffffff;
    text-align: center;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hero-stat .label {
    font-size: 0.9rem;
    color: #cbd5e0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    text-align: center;
}

/* Мобильная адаптация Hero */
@media (max-width: 768px) {
    .hero h1 {
        /* Синхронизировано с responsive.css */
        font-size: 1.8rem; 
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 30px;
        align-items: center;
    }
    
    .hero-stat .value {
        font-size: 2rem;
    }
    
    .hero-stat .label {
        font-size: 0.85rem;
    }
}

@media (max-width: 992px) and (min-width: 769px) {
    .hero-stats {
        gap: 40px;
    }
}

/* --- Фильтры --- */
.filters-section {
    padding: 20px 0;
    background: white;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 80px;
    z-index: 100;
}
.filters {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.filter-group label {
    font-weight: 600;
    font-size: 0.9rem; /* Приведено к rem */
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
}
.filter-select {
    padding: 8px 30px 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-dark);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
}
.filter-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    margin-left: auto;
}
.filter-tag {
    text-decoration: none;
    display: inline-block;
    padding: 6px 14px;
    background: var(--body-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
    cursor: pointer;
}
.filter-tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.filter-tag.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}


/* --- Секция сравнения --- */
.comparison-section {
    margin-bottom: 60px;
}
.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
.comparison-header h2 {
    /* Синхронизировано с style.css .section-title */
    font-size: 2rem; 
    font-weight: 800;
}
.comparison-toggle .fas {
    margin-right: 8px;
}

.comparison-table {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
}
.comparison-table table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
    padding: 16px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.comparison-table th {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    font-weight: 700;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem; /* Оптимизация размера */
}
.comparison-table th:first-child,
.comparison-table td:first-child {
    text-align: left;
}
.comparison-table tr:last-child td {
    border-bottom: none;
}
.comparison-table tr:hover td {
    background: rgba(106, 68, 255, 0.02);
}
.exchange-name {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1rem; /* Чуть уменьшили для аккуратности */
}
.exchange-logo1 {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.stars {
    color: #ffc107;
    font-size: 1rem;
    letter-spacing: 1px;
}
.rating-value {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.fee {
    font-weight: 700;
    color: var(--success-color);
}
.volume {
    font-weight: 700;
}

/* Уровень безопасности */
.security-level {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    background: rgba(94, 53, 177, 0.1);
    color: #5e35b1;
    transition: all 0.3s ease;
}


/* --- Карточки бирж --- */
.exchanges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(328px, 1fr));
    gap: 30px;
    margin-top: 5px;
}
.exchange-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}
.exchange-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}
.exchange-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}
.exchange-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 24px 0 24px;
    margin-bottom: 24px;
    width: 100%;
}
.exchange-info {
    display: flex;
    align-items: center;
    gap: 15px;
}
.exchange-logo-large {
    width: 50px;
    height: 50px;
    border-radius: 12px;
}
.exchange-details h3 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 5px;
}
.exchange-type {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.exchange-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
/* Цвета для значков */
.badge-green { background-color: var(--success-color); }
.badge-yellow { background-color: var(--warning-color); color: #333; }
.badge-red { background-color: var(--danger-color); }
.badge-purple { background-color: #10b981; }
.badge-blue { background-color: #007bff; }

.exchange-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0 24px;
    margin-bottom: 24px;
    width: 100%;
}
.stat-box {
    background: #f8f9fa;
    padding: 10px 5px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 85px; 
    height: 100%;
    box-sizing: border-box;
}
.stat-box .value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-color);
}
.stat-box .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
    font-weight: 600;
}
.exchange-features1 {
    padding: 0 24px;
    margin-bottom: 24px;
    flex-grow: 1;
}
.features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.feature-tag {
    padding: 4px 10px;
    background: rgba(106, 68, 255, 0.08);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}
.exchange-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding: 0 24px 24px 24px;
    width: 100%;
}
.exchange-actions .btn {
    flex: 1;
    padding: 10px;
    font-weight: 700;
}
.exchange-actions .btn-outline {
    border: 2px solid var(--border-color);
}
.exchange-actions .btn-primary .fa-xs {
    margin-left: 5px;
    font-size: 0.7em;
    vertical-align: middle;
}

/* --- Кнопки --- */
.btn {
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
}
.btn-table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    transition: var(--transition);
}
.btn-table-action:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

/* --- Анимации --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ============================================
   МОБИЛЬНАЯ АДАПТАЦИЯ - БИРЖИ
   ============================================ */

/* === БРЕЙКПОИНТ 1200px === */
@media (max-width: 1200px) {
    .hero h1 {
        font-size: 3rem;
    }
    
    .hero-stats {
        gap: 40px;
    }
    
    .exchanges-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

/* === БРЕЙКПОИНТ 992px === */
@media (max-width: 992px) {
    /* Hero */
    .hero {
        padding: 40px 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .hero-stats {
        gap: 30px;
        margin-top: 40px;
    }
    
    .hero-stat .value {
        font-size: 2rem;
    }
    
    /* Фильтры */
    .filters-section {
        position: static; 
        top: auto;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-tags {
        margin-left: 0;
        justify-content: flex-start;
    }
    
    /* Таблица сравнения */
    .comparison-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .comparison-header h2 {
        font-size: 1.8rem;
    }
    
    .comparison-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .comparison-table table {
        min-width: 700px;
    }
    
    /* Карточки */
    .exchanges-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
	.comparison-table th:first-child { background: linear-gradient(135deg, #f8f9fa, #e9ecef); }
}

/* === БРЕЙКПОИНТ 768px (Планшеты портрет) === */
@media (max-width: 768px) {
    /* Hero */
    .hero {
        padding: 30px 0;
    }
    
    .hero h1 {
        /* Синхронизировано с responsive.css */
        font-size: 1.5rem; 
        margin-bottom: 15px;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 25px;
        padding: 0 10px;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 25px;
        margin-top: 35px;
    }
    
    .hero-stat .value {
        font-size: 1.8rem;
    }
    
    .hero-stat .label {
        font-size: 0.85rem;
    }
    
    /* Хлебные крошки */
    .breadcrumbs {
        margin-bottom: 20px;
        font-size: 0.85rem;
    }
    
    /* Секция сравнения */
    .comparison-section {
        margin-bottom: 40px;
        width: 100%;       
        max-width: 100%;   
        overflow: hidden;  
    }
    .comparison-table {
        display: block;      
        width: 100%;         
        max-width: 100%;    
        overflow-x: auto;    
        -webkit-overflow-scrolling: touch; 
        border-radius: 12px; 
    }
    
    .comparison-table table {
        width: max-content;  
        min-width: 700px;    
        border-collapse: separate; 
    }
    
    .comparison-table th, 
    .comparison-table td {
        white-space: nowrap; 
        padding: 10px;
    }
    
    .comparison-header h2 {
        /* Синхронизировано с responsive.css */
        font-size: 1.5rem; 
    }
    
    .comparison-toggle {
        width: 100%;
        justify-content: center;
    }
    
    /* Заголовок каталога */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 20px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    /* Фильтры */
    .filters1 {
        flex-direction: column;
        gap: 12px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
        padding: 12px 35px 12px 15px;
    }
    
    .filter-tags {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
        flex-wrap: nowrap;
    }
    
    .filter-tag {
        flex-shrink: 0;
        padding: 8px 16px;
    }
    
    /* Карточки - одна колонка */
    .exchanges-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Внутренности карточки */
    .exchange-card {
        border-radius: 14px;
    }
    
    .exchange-header {
        padding: 20px 16px 0 16px;
        margin-bottom: 20px;
    }
    
    .exchange-logo-large {
        width: 45px;
        height: 45px;
    }
    
    .exchange-details h3 {
        font-size: 1.1rem;
    }
    
    .exchange-type {
        font-size: 0.8rem;
    }
    
    .exchange-badge {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    /* Статистика внутри карточки */
    .exchange-stats {
        padding: 0 16px;
        margin-bottom: 20px;
        gap: 10px;
    }
    
    .stat-box {
        padding: 12px 8px;
        min-height: 75px;
        border-radius: 10px;
    }
    
    .stat-box .value {
        font-size: 1rem;
    }
    
    .stat-box .label {
        font-size: 0.7rem;
        margin-top: 4px;
    }
    
    /* Теги фишек */
    .exchange-features1 {
        padding: 0 16px;
        margin-bottom: 20px;
    }
    
    .features-list {
        gap: 6px;
    }
    
    .feature-tag {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    /* Кнопки */
    .exchange-actions {
        padding: 0 16px 20px 16px;
        gap: 10px;
    }
    
    .exchange-actions .btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* === БРЕЙКПОИНТ 576px (Большие телефоны) === */
@media (max-width: 576px) {
    /* Hero */
    .hero {
        padding: 25px 0;
    }
    
    
    .hero-stats {
        gap: 20px;
        margin-top: 30px;
    }
    
    .hero-stat .value {
        font-size: 1.5rem;
    }
    
    .hero-stat .label {
        font-size: 0.8rem;
        letter-spacing: 0.5px;
    }
    
    /* Таблица */
    .comparison-table th,
    .comparison-table td {
        padding: 12px 10px;
        font-size: 0.85rem;
    }
    
    .exchange-name {
        font-size: 0.95rem;
        gap: 8px;
    }
    
    .exchange-logo1 {
        width: 28px;
        height: 28px;
    }
    
    /* Карточки */
    .exchange-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .exchange-badge {
        align-self: flex-start;
    }
    
    .stat-box {
        min-height: 70px;
        padding: 10px 6px;
    }
    
    .stat-box .value {
        font-size: 0.95rem;
    }
    
    
    /* Звезды рейтинга */
    .stars-wrapper {
        font-size: 0.75rem;
    }
}

/* === БРЕЙКПОИНТ 480px (Средние телефоны) === */
@media (max-width: 480px) {
    
    .hero-stat .value {
        font-size: 1.3rem;
    }
    
    .comparison-header h2 {
        font-size: 1.3rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .filter-tag {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .exchange-stats {
        gap: 8px;
    }
    
    .stat-box {
        min-height: 65px;
    }
}

/* === БРЕЙКПОИНТ 375px (iPhone SE и маленькие телефоны) === */
@media (max-width: 375px) {
    .hero {
        padding: 20px 0;
    }
        
    .hero-stat .value {
        font-size: 1.2rem;
    }
    
    .hero-stat .label {
        font-size: 0.75rem;
    }
    
    .exchange-header {
        padding: 16px 14px 0 14px;
    }
    
    .exchange-stats {
        padding: 0 14px;
    }
    
    .exchange-features1 {
        padding: 0 14px;
    }
    
    .exchange-actions {
        padding: 0 14px 16px 14px;
        flex-direction: column;
    }
    
    .exchange-actions .btn {
        width: 100%;
    }
    
    .stat-box .value {
        font-size: 0.85rem;
    }
    
}

/* === УЛУЧШЕНИЯ ПРОКРУТКИ ТАБЛИЦЫ === */
@media (max-width: 992px) {
    .comparison-table {
        position: relative;
    }
    
    /* Подсказка о прокрутке */
    .comparison-table::after {
        content: '← Прокрутите →';
        position: absolute;
        bottom: -25px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.75rem;
        color: var(--text-muted);
        opacity: 0.7;
    }
}

/* === ФИКС ДЛЯ TOUCH УСТРОЙСТВ === */
@media (hover: none) and (pointer: coarse) {
    .exchange-card:hover {
        transform: none;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    }
    
    .filter-tag:hover {
        transform: none;
    }
    
    .hero-stat:hover {
        transform: none;
    }
}