/* DistroHub theme tokens — applied via html[data-theme="..."] */

:root,
html[data-theme="sunrise"] {
    --dh-theme-name: "Sunrise";
    --tblr-primary: #FF6500;
    --tblr-primary-rgb: 255, 101, 0;
    --tblr-primary-darken: #E65B00;
    --tblr-primary-fg: #fff;
    --tblr-tabler: #FF6500;
    --tblr-link-color: #FF6500;
    --tblr-link-hover-color: #E65B00;
    --dh-sidebar-bg: #1c1410;
    --dh-sidebar-header: #140e0b;
    --dh-sidebar-text: #e8e8e8;
    --dh-sidebar-active: #FF6500;
    --dh-sidebar-hover: rgba(255, 101, 0, 0.22);
    --dh-accent: #FF6500;
    --dh-accent-soft: rgba(255, 101, 0, 0.12);
    --dh-topbar-bg: #f7f7f7;
    --dh-topbar-border: #d6d5d5;
}

html[data-theme="ocean"] {
    --dh-theme-name: "Ocean";
    --tblr-primary: #0c8ce9;
    --tblr-primary-rgb: 12, 140, 233;
    --tblr-primary-darken: #0a74c2;
    --tblr-primary-fg: #fff;
    --tblr-tabler: #0c8ce9;
    --tblr-link-color: #0c8ce9;
    --tblr-link-hover-color: #0a74c2;
    --dh-sidebar-bg: #0b1f33;
    --dh-sidebar-header: #081827;
    --dh-sidebar-text: #d7e6f5;
    --dh-sidebar-active: #0c8ce9;
    --dh-sidebar-hover: rgba(12, 140, 233, 0.22);
    --dh-accent: #0c8ce9;
    --dh-accent-soft: rgba(12, 140, 233, 0.12);
    --dh-topbar-bg: #f3f7fb;
    --dh-topbar-border: #d5e2ef;
}

html[data-theme="forest"] {
    --dh-theme-name: "Forest";
    --tblr-primary: #2f9e44;
    --tblr-primary-rgb: 47, 158, 68;
    --tblr-primary-darken: #278a39;
    --tblr-primary-fg: #fff;
    --tblr-tabler: #2f9e44;
    --tblr-link-color: #2f9e44;
    --tblr-link-hover-color: #278a39;
    --dh-sidebar-bg: #14241a;
    --dh-sidebar-header: #0f1b14;
    --dh-sidebar-text: #dff0e4;
    --dh-sidebar-active: #2f9e44;
    --dh-sidebar-hover: rgba(47, 158, 68, 0.22);
    --dh-accent: #2f9e44;
    --dh-accent-soft: rgba(47, 158, 68, 0.12);
    --dh-topbar-bg: #f4f8f5;
    --dh-topbar-border: #d5e4da;
}

html[data-theme="violet"] {
    --dh-theme-name: "Violet";
    --tblr-primary: #7950f2;
    --tblr-primary-rgb: 121, 80, 242;
    --tblr-primary-darken: #6741d9;
    --tblr-primary-fg: #fff;
    --tblr-tabler: #7950f2;
    --tblr-link-color: #7950f2;
    --tblr-link-hover-color: #6741d9;
    --dh-sidebar-bg: #1b1430;
    --dh-sidebar-header: #140f24;
    --dh-sidebar-text: #e4dff8;
    --dh-sidebar-active: #7950f2;
    --dh-sidebar-hover: rgba(121, 80, 242, 0.22);
    --dh-accent: #7950f2;
    --dh-accent-soft: rgba(121, 80, 242, 0.12);
    --dh-topbar-bg: #f6f4fb;
    --dh-topbar-border: #ddd6ef;
}

/* Force sidebar to follow theme (beats Tabler + Blazor scoped CSS) */
html .page > .sidebar,
html .sidebar,
html .sidebar .nav-scrollable {
    background-color: var(--dh-sidebar-bg) !important;
    background-image: none !important;
}

html .sidebar .top-row.navbar,
html .sidebar .top-row {
    background-color: var(--dh-sidebar-header) !important;
    background-image: none !important;
}

html .sidebar .nav-link,
html .sidebar a.nav-link,
html .sidebar .menu-parent.nav-link {
    color: var(--dh-sidebar-text) !important;
    background-color: transparent !important;
    background-image: none !important;
}

html .sidebar .nav-link:hover,
html .sidebar a.nav-link:hover,
html .sidebar .menu-parent.nav-link:hover {
    color: #fff !important;
    background-color: var(--dh-sidebar-hover) !important;
}

html .sidebar a.nav-link.active,
html .sidebar .nav-link.active {
    color: #fff !important;
    background-color: var(--dh-sidebar-active) !important;
}

/* Tabler primary surfaces that hardcode rgb in places */
.btn-primary,
.bg-primary,
.badge.bg-primary,
.progress-bar,
.nav-pills .nav-link.active,
.form-check-input:checked {
    --tblr-btn-bg: var(--tblr-primary);
    --tblr-btn-border-color: var(--tblr-primary);
    --tblr-btn-hover-bg: var(--tblr-primary-darken);
    --tblr-btn-hover-border-color: var(--tblr-primary-darken);
}

.btn-primary {
    background-color: var(--tblr-primary) !important;
    border-color: var(--tblr-primary) !important;
    color: var(--tblr-primary-fg) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--tblr-primary-darken) !important;
    border-color: var(--tblr-primary-darken) !important;
}

.text-primary {
    color: var(--tblr-primary) !important;
}

.border-primary {
    border-color: var(--tblr-primary) !important;
}

a:not(.nav-link):not(.dropdown-item):not(.btn) {
    color: var(--tblr-link-color);
}

a:not(.nav-link):not(.dropdown-item):not(.btn):hover {
    color: var(--tblr-link-hover-color);
}

/* Theme picker */
.theme-picker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
}

.theme-picker-label {
    font-size: 0.75rem;
    color: #6c7a91;
    font-weight: 600;
    margin-right: 0.15rem;
}

.theme-swatch {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(32, 42, 58, 0.18);
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.theme-swatch:hover {
    transform: scale(1.08);
}

.theme-swatch.is-active {
    box-shadow: 0 0 0 2px var(--tblr-primary);
    transform: scale(1.1);
}

.theme-swatch[data-theme-id="sunrise"] { background: linear-gradient(135deg, #1c1410 45%, #FF6500 45%); }
.theme-swatch[data-theme-id="ocean"] { background: linear-gradient(135deg, #0b1f33 45%, #0c8ce9 45%); }
.theme-swatch[data-theme-id="forest"] { background: linear-gradient(135deg, #14241a 45%, #2f9e44 45%); }
.theme-swatch[data-theme-id="violet"] { background: linear-gradient(135deg, #1b1430 45%, #7950f2 45%); }
