/*
 * Chain themes. <html data-chain="eth|sol"> is set by the chain store.
 *   ETH: brand blue (the default theme in style.css)
 *   SOL: purple
 * The accent colour is applied as an outline around the top bar, cards and
 * key controls, so the active chain is obvious at a glance.
 */

:root,
html[data-chain="eth"] {
    --chain-accent: #0b7cf4;
    --chain-accent-dark: #0653b0;
    --chain-accent-rgb: 11, 124, 244;
    --chain-accent-soft: #e8f2ff;
}

html[data-chain="sol"] {
    --chain-accent: #9945ff;
    --chain-accent-dark: #6d28d9;
    --chain-accent-rgb: 153, 69, 255;
    --chain-accent-soft: #f3e8ff;

    /* re-point the existing theme tokens */
    --color-secondary: #9945ff;
    --color-light-secondary: #f3e8ff;
    --color-lighten-secondary: #faf5ff;
    --color-border-secondary: #ddd6fe;
    --color-darkred: #6d28d9;
}

/* ── Outline ─────────────────────────────────────────────────────────────── */

header.sticky-top .navbar {
    border-bottom: 3px solid var(--chain-accent);
    transition: border-color 0.25s ease;
}

.card,
.form-control:focus,
.form-select:focus {
    border-color: rgba(var(--chain-accent-rgb), 0.45) !important;
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--chain-accent-rgb), 0.2) !important;
}

/* ── Buttons that hardcode blue in style.css ─────────────────────────────── */

html[data-chain="sol"] .btn.btn-banger {
    --bs-btn-bg: #9945ff;
    --bs-btn-border-color: #9945ff;
}

html[data-chain="sol"] .btn.btn-primary,
html[data-chain="sol"] .btn.btn-banger,
html[data-chain="sol"] .btn.btn-secondary {
    --bs-btn-hover-bg: #6d28d9;
    --bs-btn-hover-border-color: #6d28d9;
    --bs-btn-focus-shadow-rgb: 153, 69, 255;
    --bs-btn-active-bg: #6d28d9;
    --bs-btn-active-border-color: #6d28d9;
    --bs-btn-disabled-bg: #6d28d9;
    --bs-btn-disabled-border-color: #6d28d9;
}

html[data-chain="sol"] .btn.btn-warning {
    --bs-btn-bg: #6d28d9;
    --bs-btn-border-color: #6d28d9;
}

html[data-chain="sol"] .register-sec .form-sec .form-body .form-content h2 {
    color: #9945ff;
}

html[data-chain="sol"] .profile-sec .title::before {
    background-color: #9945ff;
}

/* ── Chain switcher ─────────────────────────────────────────────────────── */

.chain-switch {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    gap: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid var(--chain-accent);
    transition: border-color 0.25s ease;
}

.chain-switch button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    border-radius: 999px;
    padding: 7px 12px;
    background: transparent;
    color: #8891a6;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.chain-switch button:hover:not(:disabled) {
    color: #fff;
}

.chain-switch button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.chain-switch button.active.eth {
    background: #0b7cf4;
    color: #fff;
}

.chain-switch button.active.sol {
    background: #9945ff;
    color: #fff;
}

.chain-switch button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 1px;
}

.chain-switch svg {
    width: 14px;
    height: 14px;
    flex: none;
}

@media (max-width: 575.9px) {
    .chain-switch button {
        padding: 7px 9px;
    }
    .chain-switch .chain-label {
        display: none;
    }
}

/* ── Solana "coming soon" panel ─────────────────────────────────────────── */

.sol-coming-soon {
    border: 2px solid var(--chain-accent) !important;
}

.sol-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    background: var(--chain-accent-soft);
    color: var(--chain-accent-dark);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
