/**
 * Survivor Toolkit — module navbar, sidebar, aliases.
 * Navbar light-theme rules live here (not in survivor-theme.css).
 */

:root,
body[data-module] {
    --module-accent: var(--survivor-brand, #73b512);
    --module-accent-fg: var(--survivor-brand-fg, #070b0e);
    --module-accent-hover: var(--survivor-brand-hover, rgba(115, 181, 18, 0.1));
    --module-accent-ring: var(--survivor-brand-ring, rgba(115, 181, 18, 0.25));
    --module-table-hover: var(--survivor-table-hover, rgba(115, 181, 18, 0.05));
}

/* ——— Navbar (единый тёмный стиль) ——— */
#mainNavbar,
.navbar#mainNavbar,
.navbar[data-module] {
    background-color: color-mix(in srgb, var(--survivor-navbar, #060b0e) 92%, transparent) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--survivor-border, #0f1519);
    transition: none !important;
}

#mainNavbar .navbar-brand,
#mainNavbar .navbar-nav .nav-link,
#mainNavbar .dropdown-toggle,
.navbar[data-module] .navbar-brand,
.navbar[data-module] .navbar-nav .nav-link,
.navbar[data-module] .dropdown-toggle {
    color: var(--survivor-text-dim, #64748b) !important;
    opacity: 1;
}

#mainNavbar .navbar-brand {
    color: var(--survivor-foreground, #e2e4e8) !important;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

#mainNavbar .navbar-brand .brand-name-base {
    color: var(--survivor-foreground, #e2e4e8);
}

#mainNavbar .navbar-brand .brand-accent {
    color: var(--survivor-brand, #73b512) !important;
}

[data-bs-theme="light"] #mainNavbar,
[data-bs-theme="light"] .navbar#mainNavbar {
    background-color: color-mix(in srgb, var(--survivor-navbar, #b0bac6) 94%, transparent) !important;
    border-bottom-color: var(--site-border);
}

[data-bs-theme="light"] #mainNavbar .navbar-brand .brand-name-base {
    color: var(--site-text, #141a22) !important;
}

[data-bs-theme="light"] #mainNavbar .navbar-brand .brand-accent {
    color: var(--survivor-brand, #73b512) !important;
}

[data-bs-theme="light"] #mainNavbar .navbar-brand,
[data-bs-theme="light"] #mainNavbar .navbar-nav .nav-link,
[data-bs-theme="light"] #mainNavbar .dropdown-toggle {
    color: var(--site-muted) !important;
}

[data-bs-theme="light"] #mainNavbar .navbar-brand,
[data-bs-theme="light"] #mainNavbar .navbar-brand .brand-name-base {
    color: var(--site-text) !important;
}

[data-bs-theme="light"] #mainNavbar .navbar-nav .nav-link:hover,
[data-bs-theme="light"] #mainNavbar .navbar-nav .nav-link.active {
    color: var(--site-text) !important;
}

[data-bs-theme="light"] #mainNavbar .navbar-nav .nav-link.active {
    border-bottom-color: var(--survivor-brand);
}

#mainNavbar .navbar-nav .nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    transform: none !important;
}

#mainNavbar .navbar-nav .nav-link:hover,
#mainNavbar .navbar-nav .nav-link:focus {
    color: var(--survivor-foreground, #e2e4e8) !important;
    background: transparent !important;
    transform: none !important;
}

#mainNavbar .navbar-nav .nav-link.active {
    color: var(--survivor-foreground, #e2e4e8) !important;
    border-bottom-color: var(--survivor-brand, #73b512);
    background: transparent !important;
}

#mainNavbar .navbar-toggler {
    border-color: var(--survivor-border, #0f1519);
}

#mainNavbar .navbar-toggler-icon {
    filter: brightness(0) invert(0.85);
}

#mainNavbar .btn-outline-light {
    border-color: var(--survivor-border, #0f1519) !important;
    color: var(--survivor-foreground, #e2e4e8) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

#mainNavbar .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--survivor-foreground, #e2e4e8) !important;
    border-color: var(--survivor-border, #0f1519) !important;
}

#mainNavbar .theme-toggle-btn {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    line-height: 1;
}

#mainNavbar .theme-toggle-btn__track {
    display: flex;
    align-items: center;
    width: 3.25rem;
    height: 1.875rem;
    border-radius: 9999px;
    border: 2px solid var(--survivor-border, #0f1519);
    background: rgba(255, 255, 255, 0.08);
    padding: 0.125rem;
}

#mainNavbar .theme-toggle-btn__thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 50%;
    background-color: var(--survivor-brand, #73b512);
    color: var(--survivor-brand-fg, #070b0e);
    transition: margin 0.2s ease;
    margin-left: 0;
    flex-shrink: 0;
}

#mainNavbar .theme-toggle-btn__icon {
    font-size: 0.7rem;
    line-height: 1;
}

#mainNavbar .theme-toggle-btn__icon--dark {
    display: none;
}

#mainNavbar .theme-toggle-btn.is-dark .theme-toggle-btn__thumb {
    margin-left: auto;
}

#mainNavbar .theme-toggle-btn.is-dark .theme-toggle-btn__icon--light {
    display: none;
}

#mainNavbar .theme-toggle-btn.is-dark .theme-toggle-btn__icon--dark {
    display: block;
}

#mainNavbar .navbar-tool-btn {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    padding: 0.375rem 0.75rem;
    white-space: nowrap;
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

#mainNavbar .navbar-tool-btn .bi-translate {
    font-size: 0.95rem;
}

[data-bs-theme="light"] #mainNavbar .theme-toggle-btn__track {
    background: rgba(0, 0, 0, 0.06);
    border-color: var(--site-border);
}

/* ——— Subnavbar ——— */
.subnavbar[data-module] {
    border-bottom: 1px solid var(--survivor-border, #0f1519);
}

.subnavbar[data-module] .nav-link.active {
    background-color: var(--survivor-brand-hover, rgba(115, 181, 18, 0.1));
    color: var(--survivor-brand, #73b512);
    border: 1px solid color-mix(in srgb, var(--survivor-brand) 30%, transparent);
}

.subnavbar[data-module] .nav-link:hover {
    background-color: var(--survivor-brand-hover, rgba(115, 181, 18, 0.1));
    color: var(--survivor-foreground, #e2e4e8);
}

[data-bs-theme="light"] .subnavbar[data-module] .nav-link:hover,
[data-bs-theme="light"] .subnavbar .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.06);
    color: var(--site-text);
}

/* ——— Module utilities ——— */
.text-module-accent,
.module-color {
    color: var(--module-accent) !important;
}

/* ——— Page styling inside modules ——— */
body[data-module] .table thead th {
    border-bottom-color: var(--survivor-border, #0f1519) !important;
}

body[data-module] .table-hover tbody tr:hover {
    background-color: var(--module-table-hover) !important;
}

body[data-module] .form-check-input:checked,
body[data-module] .form-switch .form-check-input:checked,
body[data-module] .form-check-input[type="radio"]:checked {
    background-color: var(--module-accent) !important;
    border-color: var(--module-accent) !important;
}

body[data-module] .form-check-input:focus {
    border-color: var(--module-accent) !important;
    box-shadow: 0 0 0 0.2rem var(--module-accent-ring) !important;
}

body[data-module] .form-range::-webkit-slider-thumb,
body[data-module] .form-range::-moz-range-thumb {
    background-color: var(--module-accent) !important;
}

body[data-module] footer h5,
body[data-module] .site-footer-title {
    color: var(--survivor-foreground, #e2e4e8) !important;
}

body[data-module] .pagination .page-link {
    color: var(--module-accent) !important;
}

body[data-module] .pagination .page-item.active .page-link {
    background-color: var(--module-accent) !important;
    border-color: var(--module-accent) !important;
    color: var(--module-accent-fg) !important;
}

body[data-module] .pagination .page-link:hover {
    color: var(--module-accent) !important;
    background-color: var(--module-accent-hover) !important;
}

body[data-module] .table thead th a.fw-bold,
body[data-module] .table thead th a .bi-arrow-up,
body[data-module] .table thead th a .bi-arrow-down {
    color: var(--module-accent) !important;
}

body[data-module] .table .btn-outline-info,
body[data-module] .table .btn-outline-primary {
    border-color: var(--module-accent) !important;
    color: var(--module-accent) !important;
}

body[data-module] .table .btn-outline-info:hover,
body[data-module] .table .btn-outline-primary:hover {
    background-color: var(--module-accent) !important;
    color: var(--module-accent-fg) !important;
}

/* ——— Admin sidebar ——— */
.admin-sidebar-brand {
    color: var(--survivor-brand, #73b512);
}

.admin-sidebar-nav .nav-link:hover {
    color: var(--survivor-brand, #73b512);
}

.admin-sidebar-nav .nav-link.active {
    background: var(--survivor-brand, #73b512);
    color: var(--survivor-brand-fg, #070b0e);
}
