/*
 * NPM Pitch Black Dark Theme
 * Custom dark theme override for Nginx Proxy Manager
 */

/* =============================================
   ROOT / GLOBAL VARIABLE OVERRIDES
   ============================================= */
:root,
[data-bs-theme="light"],
[data-bs-theme="dark"],
body {
  color-scheme: dark !important;

  /* Core body colors - pitch black */
  --tblr-body-color: #e0e0e0 !important;
  --tblr-body-color-rgb: 224, 224, 224 !important;
  --tblr-body-bg: #000000 !important;
  --tblr-body-bg-rgb: 0, 0, 0 !important;

  /* Emphasis */
  --tblr-emphasis-color: #ffffff !important;
  --tblr-emphasis-color-rgb: 255, 255, 255 !important;

  /* Secondary */
  --tblr-secondary-color: rgba(224, 224, 224, 0.75) !important;
  --tblr-secondary-color-rgb: 224, 224, 224 !important;
  --tblr-secondary-bg: #1a1a1a !important;
  --tblr-secondary-bg-rgb: 26, 26, 26 !important;

  /* Tertiary */
  --tblr-tertiary-color: rgba(224, 224, 224, 0.5) !important;
  --tblr-tertiary-color-rgb: 224, 224, 224 !important;
  --tblr-tertiary-bg: #0d0d0d !important;
  --tblr-tertiary-bg-rgb: 13, 13, 13 !important;

  /* Borders */
  --tblr-border-color: #2a2a2a !important;
  --tblr-border-color-translucent: rgba(255, 255, 255, 0.08) !important;

  /* Primary color - ZSM purple */
  --tblr-primary: #6f42c1 !important;
  --tblr-primary-rgb: 111, 66, 193 !important;
  --tblr-blue: #6f42c1 !important;
  --tblr-blue-rgb: 111, 66, 193 !important;

  /* Green/Success -> ZSM purple */
  --tblr-green: #6f42c1 !important;
  --tblr-green-rgb: 111, 66, 193 !important;
  --tblr-success: #6f42c1 !important;
  --tblr-success-rgb: 111, 66, 193 !important;

  /* Links */
  --tblr-link-color: #9b7ad8 !important;
  --tblr-link-hover-color: #b99de6 !important;
  --tblr-link-color-rgb: 155, 122, 216 !important;
  --tblr-link-hover-color-rgb: 185, 157, 230 !important;

  /* Headings */
  --tblr-heading-color: #ffffff !important;

  /* Muted */
  --tblr-muted: #888888 !important;

  /* Light / Dark overrides */
  --tblr-light: #1a1a1a !important;
  --tblr-light-rgb: 26, 26, 26 !important;
  --tblr-dark: #e0e0e0 !important;
  --tblr-dark-rgb: 224, 224, 224 !important;

  /* Subtle backgrounds */
  --tblr-primary-bg-subtle: #1a0f2e !important;
  --tblr-secondary-bg-subtle: #111111 !important;
  --tblr-success-bg-subtle: #1a0f2e !important;
  --tblr-info-bg-subtle: #091a2a !important;
  --tblr-warning-bg-subtle: #1a1300 !important;
  --tblr-danger-bg-subtle: #1a0808 !important;
  --tblr-light-bg-subtle: #0d0d0d !important;
  --tblr-dark-bg-subtle: #0a0a0a !important;

  /* Subtle borders */
  --tblr-primary-border-subtle: #3d2170 !important;
  --tblr-secondary-border-subtle: #333333 !important;
  --tblr-success-border-subtle: #3d2170 !important;
  --tblr-info-border-subtle: #1e3a5f !important;
  --tblr-warning-border-subtle: #3d2f00 !important;
  --tblr-danger-border-subtle: #450a0a !important;
  --tblr-light-border-subtle: #2a2a2a !important;
  --tblr-dark-border-subtle: #1a1a1a !important;

  /* Code */
  --tblr-code-color: #a5b4c4 !important;

  /* Highlight */
  --tblr-highlight-color: #e0e0e0 !important;
  --tblr-highlight-bg: #3d2f00 !important;

  /* Backgrounds used in Tabler */
  --tblr-bg-surface: #000000 !important;
  --tblr-bg-surface-secondary: #0d0d0d !important;
  --tblr-bg-surface-tertiary: #1a1a1a !important;
  --tblr-bg-forms: #0d0d0d !important;

  /* Active backgrounds */
  --tblr-active-bg: #1a1a1a !important;

  /* Card */
  --tblr-card-bg: #0d0d0d !important;
  --tblr-card-border-color: #2a2a2a !important;
  --tblr-card-cap-bg: #111111 !important;
  --tblr-card-color: #e0e0e0 !important;
}

/* =============================================
   BODY
   ============================================= */
body {
  background-color: #000000 !important;
  color: #e0e0e0 !important;
}

/* =============================================
   PAGE / LAYOUT
   ============================================= */
.page,
.page-wrapper,
.page-body {
  background-color: #000000 !important;
}

.page-header {
  background-color: #000000 !important;
  border-bottom-color: #2a2a2a !important;
}

.page-title {
  color: #ffffff !important;
}

.page-pretitle {
  color: #888888 !important;
}

/* =============================================
   NAVBAR / NAVIGATION
   ============================================= */
.navbar,
.navbar-expand-md,
.navbar-light,
.navbar-dark {
  background-color: #0a0a0a !important;
  border-bottom: 1px solid #1a1a1a !important;
  color: #e0e0e0 !important;
}

.navbar .navbar-brand,
.navbar .navbar-brand:hover {
  color: #ffffff !important;
}

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.7) !important;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
  color: #ffffff !important;
}

.navbar-nav .nav-link.active {
  color: #ffffff !important;
}

.navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Sidebar / aside nav */
.navbar-vertical,
.navbar-vertical.navbar-expand-lg {
  background-color: #0a0a0a !important;
  border-right: 1px solid #1a1a1a !important;
}

.navbar-vertical .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.7) !important;
}

.navbar-vertical .navbar-nav .nav-link:hover {
  color: #ffffff !important;
  background-color: #1a1a1a !important;
}

.navbar-vertical .navbar-nav .nav-link.active {
  color: #ffffff !important;
  background-color: #1a1a1a !important;
}

/* =============================================
   CARDS
   ============================================= */
.card {
  background-color: #0d0d0d !important;
  border-color: #2a2a2a !important;
  color: #e0e0e0 !important;
}

.card-header {
  background-color: #111111 !important;
  border-bottom-color: #2a2a2a !important;
  color: #e0e0e0 !important;
}

.card-footer {
  background-color: #111111 !important;
  border-top-color: #2a2a2a !important;
  color: #e0e0e0 !important;
}

.card-title {
  color: #ffffff !important;
}

.card-body {
  color: #e0e0e0 !important;
}

/* Card stamps and status */
.card-stamp-icon {
  color: rgba(255, 255, 255, 0.05) !important;
}

/* =============================================
   TABLES
   ============================================= */
.table,
.markdown > table {
  --tblr-table-color: #e0e0e0 !important;
  --tblr-table-bg: transparent !important;
  --tblr-table-border-color: #2a2a2a !important;
  --tblr-table-striped-bg: #0a0a0a !important;
  --tblr-table-striped-color: #e0e0e0 !important;
  --tblr-table-hover-bg: #1a1a1a !important;
  --tblr-table-hover-color: #e0e0e0 !important;
  --tblr-table-active-bg: #1a1a1a !important;
  --tblr-table-active-color: #ffffff !important;
  color: #e0e0e0 !important;
}

.table > :not(caption) > * > * {
  background-color: transparent !important;
  border-bottom-color: #2a2a2a !important;
  color: #e0e0e0 !important;
}

.table thead th {
  color: #cccccc !important;
  background-color: #0d0d0d !important;
  border-bottom-color: #2a2a2a !important;
}

.table-responsive {
  background-color: transparent !important;
}

/* =============================================
   FORMS & INPUTS
   ============================================= */
.form-control,
.form-select {
  background-color: #0d0d0d !important;
  border-color: #2a2a2a !important;
  color: #e0e0e0 !important;
}

.form-control:focus,
.form-select:focus {
  background-color: #111111 !important;
  border-color: #6f42c1 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 0.25rem rgba(111, 66, 193, 0.2) !important;
}

.form-control::placeholder {
  color: #666666 !important;
}

.form-control:disabled,
.form-control[readonly] {
  background-color: #0a0a0a !important;
  color: #888888 !important;
}

.form-label,
label {
  color: #cccccc !important;
}

.form-check-input {
  background-color: #1a1a1a !important;
  border-color: #444444 !important;
}

.form-check-input:checked {
  background-color: #6f42c1 !important;
  border-color: #6f42c1 !important;
}

.form-switch .form-check-input {
  background-color: #333333 !important;
}

.form-switch .form-check-input:checked {
  background-color: #6f42c1 !important;
}

.form-selectgroup-label {
  background-color: #0d0d0d !important;
  border-color: #2a2a2a !important;
  color: #e0e0e0 !important;
}

.form-selectgroup-input:checked + .form-selectgroup-label {
  background-color: #1a1a1a !important;
  border-color: #6f42c1 !important;
  color: #ffffff !important;
}

.input-group-text {
  background-color: #1a1a1a !important;
  border-color: #2a2a2a !important;
  color: #e0e0e0 !important;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn-secondary {
  background-color: #2a2a2a !important;
  border-color: #333333 !important;
  color: #e0e0e0 !important;
}

.btn-secondary:hover {
  background-color: #333333 !important;
  border-color: #444444 !important;
  color: #ffffff !important;
}

.btn-ghost-secondary {
  color: #cccccc !important;
}

.btn-ghost-secondary:hover {
  background-color: #1a1a1a !important;
  color: #ffffff !important;
}

.btn-outline-secondary {
  border-color: #444444 !important;
  color: #cccccc !important;
}

.btn-outline-secondary:hover {
  background-color: #2a2a2a !important;
  color: #ffffff !important;
}

.btn-light {
  background-color: #1a1a1a !important;
  border-color: #2a2a2a !important;
  color: #e0e0e0 !important;
}

.btn-light:hover {
  background-color: #2a2a2a !important;
  color: #ffffff !important;
}

/* =============================================
   MODALS
   ============================================= */
.modal-content {
  background-color: #0d0d0d !important;
  border-color: #2a2a2a !important;
  color: #e0e0e0 !important;
}

.modal-header {
  border-bottom-color: #2a2a2a !important;
  color: #ffffff !important;
}

.modal-footer {
  border-top-color: #2a2a2a !important;
}

.modal-title {
  color: #ffffff !important;
}

.modal-backdrop {
  background-color: #000000 !important;
}

.btn-close {
  filter: invert(1) !important;
}

/* =============================================
   DROPDOWNS
   ============================================= */
.dropdown-menu {
  background-color: #111111 !important;
  border-color: #2a2a2a !important;
  color: #e0e0e0 !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5) !important;
}

.dropdown-item {
  color: #e0e0e0 !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: #1a1a1a !important;
  color: #ffffff !important;
}

.dropdown-item.active,
.dropdown-item:active {
  background-color: #6f42c1 !important;
  color: #ffffff !important;
}

.dropdown-divider {
  border-top-color: #2a2a2a !important;
}

.dropdown-header {
  color: #888888 !important;
}

/* =============================================
   ALERTS
   ============================================= */
.alert {
  border-color: #2a2a2a !important;
}

.alert-info {
  background-color: #091a2a !important;
  color: #8ec4f5 !important;
}

.alert-success {
  background-color: #1a0f2e !important;
  color: #b99de6 !important;
}

.alert-warning {
  background-color: #1a1300 !important;
  color: #f5c462 !important;
}

.alert-danger {
  background-color: #1a0808 !important;
  color: #e68888 !important;
}

/* =============================================
   BADGES
   ============================================= */
.badge.bg-secondary {
  background-color: #333333 !important;
  color: #e0e0e0 !important;
}

/* =============================================
   LISTS
   ============================================= */
.list-group-item {
  background-color: #0d0d0d !important;
  border-color: #2a2a2a !important;
  color: #e0e0e0 !important;
}

.list-group-item:hover {
  background-color: #1a1a1a !important;
}

.list-group-item.active {
  background-color: #6f42c1 !important;
  border-color: #6f42c1 !important;
}

/* =============================================
   TABS / NAV TABS / PILLS
   ============================================= */
.nav-tabs {
  border-bottom-color: #2a2a2a !important;
}

.nav-tabs .nav-link {
  color: #cccccc !important;
}

.nav-tabs .nav-link:hover {
  border-color: #2a2a2a !important;
  color: #ffffff !important;
}

.nav-tabs .nav-link.active {
  background-color: #0d0d0d !important;
  border-color: #2a2a2a #2a2a2a #0d0d0d !important;
  color: #ffffff !important;
}

.nav-pills .nav-link {
  color: #cccccc !important;
}

.nav-pills .nav-link.active {
  background-color: #6f42c1 !important;
  color: #ffffff !important;
}

/* =============================================
   PAGINATION
   ============================================= */
.page-link {
  background-color: #0d0d0d !important;
  border-color: #2a2a2a !important;
  color: #e0e0e0 !important;
}

.page-link:hover {
  background-color: #1a1a1a !important;
  color: #ffffff !important;
}

.page-item.active .page-link {
  background-color: #6f42c1 !important;
  border-color: #6f42c1 !important;
}

.page-item.disabled .page-link {
  background-color: #0a0a0a !important;
  color: #444444 !important;
}

/* =============================================
   TOASTS
   ============================================= */
.toast {
  background-color: #111111 !important;
  border-color: #2a2a2a !important;
  color: #e0e0e0 !important;
}

.toast-header {
  background-color: #1a1a1a !important;
  border-bottom-color: #2a2a2a !important;
  color: #ffffff !important;
}

/* =============================================
   PROGRESS BARS
   ============================================= */
.progress {
  background-color: #1a1a1a !important;
}

/* =============================================
   BREADCRUMBS
   ============================================= */
.breadcrumb {
  color: #888888 !important;
}

.breadcrumb-item a {
  color: #9b7ad8 !important;
}

.breadcrumb-item.active {
  color: #cccccc !important;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: #666666 !important;
}

/* =============================================
   TOOLTIPS & POPOVERS
   ============================================= */
.tooltip-inner {
  background-color: #1a1a1a !important;
  color: #e0e0e0 !important;
}

.popover {
  background-color: #111111 !important;
  border-color: #2a2a2a !important;
}

.popover-body {
  color: #e0e0e0 !important;
}

.popover-header {
  background-color: #1a1a1a !important;
  border-bottom-color: #2a2a2a !important;
  color: #ffffff !important;
}

/* =============================================
   OFFCANVAS
   ============================================= */
.offcanvas {
  background-color: #0d0d0d !important;
  color: #e0e0e0 !important;
}

.offcanvas-header {
  border-bottom-color: #2a2a2a !important;
}

/* =============================================
   TEXT & TYPOGRAPHY
   ============================================= */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: #ffffff !important;
}

.text-body {
  color: #e0e0e0 !important;
}

.text-muted {
  color: #888888 !important;
}

.text-secondary {
  color: #aaaaaa !important;
}

.text-dark {
  color: #e0e0e0 !important;
}

a {
  color: #9b7ad8;
}

a:hover {
  color: #b99de6;
}

/* =============================================
   SCROLLBARS (webkit)
   ============================================= */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
  background: #333333;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #444444;
}

/* =============================================
   TABLER-SPECIFIC COMPONENTS
   ============================================= */

/* Status dots */
.status-dot {
  border: 2px solid #0d0d0d !important;
}

/* Avatars */
.avatar {
  background-color: #1a1a1a !important;
  color: #e0e0e0 !important;
}

/* Divider */
.hr,
hr {
  border-color: #2a2a2a !important;
  color: #2a2a2a !important;
}

/* Empty state */
.empty {
  color: #888888 !important;
}

.empty-title {
  color: #cccccc !important;
}

/* Subheader */
.subheader {
  color: #888888 !important;
}

/* Ribbon */
.ribbon {
  color: #ffffff !important;
}

/* Steps */
.steps-item.active .steps-item-dot {
  background-color: #6f42c1 !important;
}

/* =============================================
   NPM-SPECIFIC OVERRIDES
   ============================================= */

/* Login page */
.page.page-center {
  background-color: #000000 !important;
}

/* Selectize / select dropdowns */
.selectize-control .selectize-input {
  background-color: #0d0d0d !important;
  border-color: #2a2a2a !important;
  color: #e0e0e0 !important;
}

.selectize-dropdown {
  background-color: #111111 !important;
  border-color: #2a2a2a !important;
  color: #e0e0e0 !important;
}

.selectize-dropdown .option {
  color: #e0e0e0 !important;
}

.selectize-dropdown .option:hover,
.selectize-dropdown .active {
  background-color: #1a1a1a !important;
  color: #ffffff !important;
}

/* Footer */
footer,
.footer {
  background-color: #000000 !important;
  border-top-color: #2a2a2a !important;
  color: #888888 !important;
}

/* Container borders */
.border {
  border-color: #2a2a2a !important;
}

.border-top {
  border-top-color: #2a2a2a !important;
}

.border-bottom {
  border-bottom-color: #2a2a2a !important;
}

.border-start {
  border-left-color: #2a2a2a !important;
}

.border-end {
  border-right-color: #2a2a2a !important;
}

/* Shadows - darken them */
.shadow,
.card {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4) !important;
}

.shadow-sm {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.shadow-lg {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5) !important;
}

/* Background utility overrides */
.bg-white {
  background-color: #0d0d0d !important;
}

.bg-light {
  background-color: #111111 !important;
}

.bg-body {
  background-color: #000000 !important;
}

/* Code blocks */
code {
  color: #a5b4c4 !important;
  background-color: #1a1a1a !important;
}

pre {
  color: #e0e0e0 !important;
  background-color: #0d0d0d !important;
}

/* Accordion */
.accordion-item {
  background-color: #0d0d0d !important;
  border-color: #2a2a2a !important;
}

.accordion-button {
  background-color: #0d0d0d !important;
  color: #e0e0e0 !important;
}

.accordion-button:not(.collapsed) {
  background-color: #111111 !important;
  color: #ffffff !important;
}

.accordion-button::after {
  filter: invert(1) !important;
}

/* Datagrid */
.datagrid-title {
  color: #888888 !important;
}

.datagrid-content {
  color: #e0e0e0 !important;
}

/* Icon colors in navigation */
.nav-link-icon {
  color: rgba(255, 255, 255, 0.5) !important;
}

.nav-link:hover .nav-link-icon,
.nav-link.active .nav-link-icon {
  color: rgba(255, 255, 255, 0.9) !important;
}

/* =============================================
   ZSM LOGO
   ============================================= */

/* Ensure logo displays well on dark background */
.navbar-brand img,
img[src*="logo"] {
  filter: brightness(1.1) !important;
}

/* =============================================
   PRIMARY BUTTON & COMPONENT OVERRIDES
   ============================================= */
.btn-primary {
  background-color: #6f42c1 !important;
  border-color: #6f42c1 !important;
}

.btn-primary:hover {
  background-color: #5a32a3 !important;
  border-color: #5a32a3 !important;
}

.btn-primary:focus {
  box-shadow: 0 0 0 0.25rem rgba(111, 66, 193, 0.3) !important;
}

.btn-outline-primary {
  border-color: #6f42c1 !important;
  color: #9b7ad8 !important;
}

.btn-outline-primary:hover {
  background-color: #6f42c1 !important;
  color: #ffffff !important;
}

.btn-ghost-primary {
  color: #9b7ad8 !important;
}

.btn-ghost-primary:hover {
  background-color: rgba(111, 66, 193, 0.1) !important;
  color: #b99de6 !important;
}

.btn-success,
.btn-green {
  background-color: #6f42c1 !important;
  border-color: #6f42c1 !important;
}

.btn-success:hover,
.btn-green:hover {
  background-color: #5a32a3 !important;
  border-color: #5a32a3 !important;
}

/* Progress bars */
.progress-bar,
.bg-primary,
.bg-success,
.bg-green {
  background-color: #6f42c1 !important;
}

/* Text colors */
.text-primary {
  color: #9b7ad8 !important;
}

.text-success,
.text-green {
  color: #9b7ad8 !important;
}

/* Badge overrides */
.badge.bg-primary,
.badge.bg-success,
.badge.bg-green {
  background-color: #6f42c1 !important;
  color: #ffffff !important;
}

/* Status indicators */
.status-green,
.status-success {
  color: #6f42c1 !important;
}

.status-dot-green,
.status-dot-success {
  background-color: #6f42c1 !important;
}

/* Spinner */
.spinner-border.text-primary,
.spinner-border.text-success {
  color: #6f42c1 !important;
}
