/**
 * Coin Exchanges Block Styles
 * Табличный аккордеон для блока «Где купить монету»
 * Тёмная тема, единообразная с coin-wallets.css
 */

/* === Основной контейнер === */
.coin-exchanges-container {
    width: 100%;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    margin: 25px 0;
    position: relative;
    max-width: 900px;
    box-sizing: border-box;
}

/* === Заголовок блока === */
.coin-exchanges-container .exchanges-header {
    background: transparent;
    padding: 25px 0;
    border-bottom: 2px solid rgba(149, 206, 90, 0.2);
    text-align: center;
    position: relative;
    margin-bottom: 10px;
}

.coin-exchanges-container .exchanges-collapse-btn {
    position: absolute;
    top: 20px;
    right: 0;
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 14px;
}

.coin-exchanges-container .exchanges-collapse-btn:hover {
    background: #e8e8e8;
    color: var(--wallet-accent, #95ce5a);
    transform: scale(1.1);
}

.coin-exchanges-container .exchanges-title {
    font-size: 28px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 15px;
    position: relative;
    display: inline-block;
}

.coin-exchanges-container .exchanges-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--wallet-accent, #95ce5a), var(--wallet-accent-dark, #78a93a));
    border-radius: 2px;
}

.coin-exchanges-container .exchanges-description {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

/* === Категория === */
.coin-exchanges-container .exchange-category {
    margin-bottom: 30px;
}

.coin-exchanges-container .category-header {
    display: flex;
    align-items: flex-start;
    padding: 15px 0;
    background: transparent;
    border-bottom: 1px solid rgba(149, 206, 90, 0.2);
    border-left: 4px solid var(--wallet-accent, #95ce5a);
    padding-left: 20px;
    margin-bottom: 0;
}

.coin-exchanges-container .category-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--wallet-accent, #95ce5a), var(--wallet-accent-dark, #78a93a));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(149, 206, 90, 0.3);
    flex-shrink: 0;
}

.coin-exchanges-container .category-info {
    flex: 1;
}

.coin-exchanges-container .category-title {
    font-size: 24px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 5px;
}

.coin-exchanges-container .category-description {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* === Табличный заголовок (десктоп) === */
.coin-exchanges-container .exchange-table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 0.8fr 1.2fr 0.8fr auto 36px;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--wallet-border, #2a2e39);
    font-size: 11px;
    font-weight: 600;
    color: var(--wallet-text-light, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-items: center;
}

.coin-exchanges-container .exchange-table-header span:last-child {
    text-align: center;
}

/* === Строки (тёмная тема) === */
.coin-exchanges-container .exchange-rows-wrap {
    background: var(--wallet-card-bg, #1e222d);
    border-radius: 12px;
    border: 1px solid var(--wallet-border, #2a2e39);
    overflow: hidden;
}

.coin-exchanges-container .exchange-row {
    border-bottom: 1px solid var(--wallet-border, #2a2e39);
    transition: all 0.2s ease;
}

.coin-exchanges-container .exchange-row:last-child {
    border-bottom: none;
}

.coin-exchanges-container .exchange-row:hover {
    background: var(--wallet-card-hover, #2a2e39);
}

.coin-exchanges-container .exchange-row.exchange-row-open {
    background: rgba(149, 206, 90, 0.05);
}

/* === Заголовок строки (всегда видна) === */
.coin-exchanges-container .exchange-row-header {
    display: grid;
    grid-template-columns: 2fr 1fr 0.8fr 1.2fr 0.8fr auto 36px;
    gap: 10px;
    padding: 12px 15px;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

/* Лого + имя */
.coin-exchanges-container .exchange-name-col {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.coin-exchanges-container .exchange-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--wallet-border, #2a2e39);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.coin-exchanges-container .exchange-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    width: auto;
    height: auto;
}

.coin-exchanges-container .exchange-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--wallet-text, #d1d4dc);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Рейтинг */
.coin-exchanges-container .exchange-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.coin-exchanges-container .exchange-rating-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
    padding-bottom: 1px;
    transition: border-color 0.2s ease;
    white-space: nowrap;
}

.coin-exchanges-container .exchange-rating-link:hover {
    border-bottom-color: #ffc107;
    text-decoration: none;
}

.coin-exchanges-container .exchange-rating .stars {
    display: flex;
    gap: 1px;
    font-size: 12px;
    color: #ffc107;
}

.coin-exchanges-container .exchange-rating .rating-value {
    font-size: 13px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--wallet-text, #d1d4dc);
}

.coin-exchanges-container .exchange-rating .rating-value.high {
    background: rgba(38, 166, 154, 0.2);
    color: #4db6ac;
}

.coin-exchanges-container .exchange-rating .rating-value.medium {
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
}

.coin-exchanges-container .exchange-rating .rating-value.low {
    background: rgba(239, 83, 80, 0.2);
    color: #ef9a9a;
}

/* KYC бейдж */
.coin-exchanges-container .exchange-kyc {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    width: fit-content;
}

.coin-exchanges-container .exchange-kyc i {
    font-size: 10px;
}

.coin-exchanges-container .exchange-kyc.kyc-required {
    background: rgba(239, 83, 80, 0.15);
    color: #ef9a9a;
    border: 1px solid rgba(239, 83, 80, 0.25);
}

.coin-exchanges-container .exchange-kyc.kyc-partial {
    background: rgba(255, 152, 0, 0.15);
    color: #ffcc80;
    border: 1px solid rgba(255, 152, 0, 0.25);
}

.coin-exchanges-container .exchange-kyc.kyc-none {
    background: rgba(38, 166, 154, 0.15);
    color: #80cbc4;
    border: 1px solid rgba(38, 166, 154, 0.25);
}

/* Пары */
.coin-exchanges-container .exchange-pairs {
    font-size: 13px;
    color: var(--wallet-text-light, #9ca3af);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Статус */
.coin-exchanges-container .exchange-status {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.coin-exchanges-container .exchange-status i {
    font-size: 11px;
}

.coin-exchanges-container .exchange-status.status-active {
    color: #4db6ac;
}

.coin-exchanges-container .exchange-status.status-warning {
    color: #ffb74d;
}

.coin-exchanges-container .exchange-status.status-danger {
    color: #ef9a9a;
}

/* === CTA кнопка в header строки === */
.coin-exchanges-container .exchange-cta {
    display: flex;
    align-items: center;
}

.coin-exchanges-container .exchange-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    background: var(--wallet-accent, #95ce5a);
    color: #000;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(149, 206, 90, 0.3);
}

.coin-exchanges-container .exchange-cta-btn:hover {
    background: #a9dd78;
    color: #000;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(169, 221, 120, 0.4);
}

.coin-exchanges-container .exchange-cta-btn i {
    font-size: 10px;
}

/* Outline-вариант кнопки (для сайтов без реф-ссылки) */
.coin-exchanges-container .exchange-cta-btn.exchange-cta-outline {
    background: transparent;
    color: var(--wallet-text-light, #9ca3af);
    border: 1px solid var(--wallet-border, #2a2e39);
    box-shadow: none;
}

.coin-exchanges-container .exchange-cta-btn.exchange-cta-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--wallet-text, #d1d4dc);
    border-color: var(--wallet-text-light, #9ca3af);
    box-shadow: none;
    transform: translateY(-1px);
}

/* Стрелка toggle */
.coin-exchanges-container .exchange-toggle {
    text-align: center;
    color: var(--wallet-text-light, #9ca3af);
    font-size: 12px;
    transition: transform 0.3s ease;
}

.coin-exchanges-container .exchange-row-open .exchange-toggle {
    transform: rotate(180deg);
}

/* === Раскрытая часть (детали) === */
.coin-exchanges-container .exchange-details {
    padding: 0 15px 15px 15px;
    overflow: hidden;
}

.coin-exchanges-container .exchange-details[style*="display: none"] {
    padding: 0 15px;
}

.coin-exchanges-container .exchange-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 12px;
}

.coin-exchanges-container .detail-item {
    display: flex;
    gap: 6px;
    font-size: 13px;
    line-height: 1.5;
}

.coin-exchanges-container .detail-label {
    font-weight: 600;
    color: var(--wallet-text-light, #9ca3af);
    white-space: nowrap;
    flex-shrink: 0;
}

.coin-exchanges-container .detail-item span:last-child {
    color: var(--wallet-text, #d1d4dc);
}

.coin-exchanges-container .detail-cons {
    grid-column: 1 / -1;
}

.coin-exchanges-container .detail-cons span:last-child {
    color: #ef9a9a;
}

/* Кнопки действий (в деталях) */
.coin-exchanges-container .exchange-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.coin-exchanges-container .exchange-detail-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #000;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    background: var(--wallet-accent, #95ce5a);
    box-shadow: 0 3px 10px rgba(149, 206, 90, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.coin-exchanges-container .exchange-detail-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.coin-exchanges-container .exchange-detail-button:hover {
    background: #a9dd78;
    box-shadow: 0 5px 14px rgba(169, 221, 120, 0.4);
    transform: translateY(-1px);
    color: #000;
    text-decoration: none;
}

.coin-exchanges-container .exchange-detail-button:hover::before {
    left: 100%;
}

.coin-exchanges-container .exchange-detail-button i {
    font-size: 12px;
}

.coin-exchanges-container .exchange-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--wallet-text, #d1d4dc);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border: 1px solid var(--wallet-border, #2a2e39);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.coin-exchanges-container .exchange-link:hover {
    color: var(--wallet-accent, #95ce5a);
    border-color: var(--wallet-accent, #95ce5a);
    text-decoration: none;
}

.coin-exchanges-container .exchange-link i {
    font-size: 11px;
}

/* === Адаптивность: 768px === */
@media (max-width: 768px) {
    .coin-exchanges-container {
        max-width: 100%;
    }

    .coin-exchanges-container .exchange-table-header {
        display: none;
    }

    .coin-exchanges-container .exchange-row-header {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 15px;
        grid-template-columns: none;
    }

    .coin-exchanges-container .exchange-name-col {
        flex: 1 1 auto;
        min-width: 120px;
    }

    .coin-exchanges-container .exchange-rating {
        order: 2;
    }

    .coin-exchanges-container .exchange-kyc {
        order: 3;
    }

    .coin-exchanges-container .exchange-pairs {
        display: none;
    }

    .coin-exchanges-container .exchange-status {
        display: none;
    }

    .coin-exchanges-container .exchange-cta {
        order: 5;
    }

    .coin-exchanges-container .exchange-toggle {
        order: 6;
        margin-left: auto;
    }

    .coin-exchanges-container .exchange-detail-grid {
        grid-template-columns: 1fr;
    }

    .coin-exchanges-container .category-header {
        flex-direction: column;
        text-align: center;
    }

    .coin-exchanges-container .category-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .coin-exchanges-container .exchange-actions {
        flex-direction: column;
    }

    .coin-exchanges-container .exchange-detail-button,
    .coin-exchanges-container .exchange-link {
        width: 100%;
        justify-content: center;
    }
}

/* === Адаптивность: 480px === */
@media (max-width: 480px) {
    .coin-exchanges-container .exchanges-header {
        padding: 20px 0;
    }

    .coin-exchanges-container .exchanges-collapse-btn {
        top: 15px;
        right: 0;
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .coin-exchanges-container .exchanges-title {
        font-size: 22px;
        padding-right: 45px;
    }

    .coin-exchanges-container .exchanges-description {
        font-size: 14px;
    }

    .coin-exchanges-container .exchange-row-header {
        padding: 10px 12px;
    }

    .coin-exchanges-container .exchange-logo {
        width: 30px;
        height: 30px;
    }

    .coin-exchanges-container .exchange-name {
        font-size: 14px;
    }

    .coin-exchanges-container .exchange-rating .stars {
        display: none;
    }

    .coin-exchanges-container .exchange-cta-btn {
        padding: 4px 10px;
        font-size: 11px;
    }

    .coin-exchanges-container .exchange-details {
        padding: 0 12px 12px 12px;
    }

    .coin-exchanges-container .exchange-detail-grid {
        padding: 10px 12px;
    }

    .coin-exchanges-container .category-header {
        padding: 12px 15px;
    }

    .coin-exchanges-container .category-title {
        font-size: 20px;
    }
}


/* Offset for fixed mobile header (44px) + progress bar (4px) + buffer */
#buy-eth,
#store-eth {
    scroll-margin-top: 60px;
}

@media (max-width: 768px) {
    #buy-eth,
    #store-eth {
        scroll-margin-top: 60px;
    }
}
