/* ============================================================
   Vault Data Servers — BTCPay Server Full Rebrand v2
   Matches: vaultdataservers.com
   Scope: Server-wide (admin + checkout + receipt + POS)
   
   Apply via: Server Settings → Branding
   Extension Type: Extends BTCPay Server Dark theme
   
   FIXES in v2:
   - Removed aggressive [class*=""] wildcard selectors
   - Fixed sidebar nav button styling
   - Fixed transaction text visibility
   - More surgical selectors throughout
   ============================================================ */

/* ============================================
   BRAND COLOR SYSTEM (variables only)
   ============================================ */

:root,
:root[data-btcpay-theme="dark"] {

  /* Primary ramp — Vault blue */
  --btcpay-primary-100: #dbeafe;
  --btcpay-primary-200: #bfdbfe;
  --btcpay-primary-300: #93c5fd;
  --btcpay-primary-400: #60a5fa;
  --btcpay-primary-500: #3b82f6;
  --btcpay-primary-600: #2563eb;
  --btcpay-primary-700: #1d4ed8;
  --btcpay-primary-800: #1e40af;
  --btcpay-primary-900: #1e3a8a;

  --btcpay-primary-rgb: 59, 130, 246;
  --btcpay-primary-accent-rgb: 6, 182, 212;
  --btcpay-primary: rgb(var(--btcpay-primary-rgb));
  --btcpay-primary-accent: rgb(var(--btcpay-primary-accent-rgb));
  --btcpay-primary-shadow: rgba(var(--btcpay-primary-rgb), .35);

  /* Backgrounds */
  --btcpay-body-bg: #090d17;
  --btcpay-bg-tile: #0f141f;

  /* Text — ensure high contrast */
  --btcpay-body-text: #e5e7eb;
  --btcpay-body-text-muted: #9ca3af;

  /* Borders */
  --btcpay-body-border-light: #232b3a;
  --btcpay-body-border-medium: #2d3748;

  /* Typography */
  --btcpay-font-family-base: 'Inter', -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;

  /* Forms */
  --btcpay-form-bg: #0f141f;
  --btcpay-form-border: #232b3a;
  --btcpay-form-text: #e5e7eb;
  --btcpay-form-bg-focus: #161d2e;
  --btcpay-form-border-focus: #3b82f6;

  /* Neutrals */
  --btcpay-neutral-400: #9ca3af;
  --btcpay-neutral-500: #6b7280;
  --btcpay-neutral-600: #4b5563;
  --btcpay-neutral-700: #374151;
  --btcpay-neutral-800: #1f2937;
}


/* ============================================
   GLOBAL
   ============================================ */

body {
  background-color: var(--btcpay-body-bg) !important;
  color: var(--btcpay-body-text) !important;
  font-family: var(--btcpay-font-family-base) !important;
}

/* Ensure ALL text defaults to readable light color */
body, p, span, div, td, th, li, label, small, strong, em {
  color: inherit;
}

h1, h2, h3, h4, h5, h6 {
  color: #ffffff !important;
}


/* ============================================
   SIDEBAR NAVIGATION (BTCPay v2 specific)
   Using #mainNav which is BTCPay's actual sidebar ID
   ============================================ */

#mainNav {
  background-color: #0a0f1a !important;
  border-right: 1px solid #232b3a !important;
}

/* All sidebar nav links — default state */
#mainNav .nav-link {
  color: #9ca3af !important;
  border-radius: 0.375rem !important;
  padding: 0.5rem 0.75rem !important;
  margin: 1px 0.5rem !important;
  transition: color 0.2s ease, background-color 0.2s ease !important;
  border-left: none !important;
}

/* Sidebar hover */
#mainNav .nav-link:hover {
  color: #e5e7eb !important;
  background-color: rgba(255, 255, 255, 0.06) !important;
}

/* Sidebar active */
#mainNav .nav-link.active {
  color: #60a5fa !important;
  background-color: rgba(59, 130, 246, 0.1) !important;
}

/* Sidebar section headers (WALLETS, PAYMENTS, PLUGINS, etc.) */
#mainNav .nav-section-title,
#mainNav .category-link {
  color: #3b82f6 !important;
  font-weight: 600 !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
}

/* Sidebar icons */
#mainNav .nav-link .icon,
#mainNav .nav-link svg {
  opacity: 0.7;
}

#mainNav .nav-link:hover .icon,
#mainNav .nav-link:hover svg,
#mainNav .nav-link.active .icon,
#mainNav .nav-link.active svg {
  opacity: 1;
}

/* Store selector dropdown in sidebar */
#mainNav .store-selector-wrapper,
#mainNav .dropdown-toggle {
  border-bottom: 1px solid #232b3a !important;
}


/* ============================================
   TOP HEADER / NAVBAR
   ============================================ */

header.navbar,
.btcpay-header {
  background-color: var(--btcpay-body-bg) !important;
  border-bottom: 1px solid #232b3a !important;
}


/* ============================================
   MAIN CONTENT AREA
   ============================================ */

#mainContent,
main {
  background-color: var(--btcpay-body-bg) !important;
}


/* ============================================
   CARDS (Bootstrap .card only, not wildcards)
   ============================================ */

.card {
  background-color: #0f141f !important;
  border: 1px solid #232b3a !important;
  border-radius: 0.75rem !important;
}

.card-header {
  background-color: rgba(255, 255, 255, 0.02) !important;
  border-bottom: 1px solid #232b3a !important;
  color: #ffffff !important;
}

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

.card-footer {
  background-color: rgba(255, 255, 255, 0.02) !important;
  border-top: 1px solid #232b3a !important;
}


/* ============================================
   DASHBOARD — TRANSACTION LIST / RECENT INVOICES
   Force all text to be visible
   ============================================ */

/* Dashboard tiles */
.tile {
  background-color: #0f141f !important;
  border: 1px solid #232b3a !important;
  border-radius: 0.75rem !important;
}

/* Ensure dashboard widget text is readable */
.widget-header,
.tile-header {
  color: #ffffff !important;
}

/* Transaction / invoice list items */
.invoice-list,
.invoice-list *,
.recent-transactions,
.recent-transactions *,
.dashboard-transactions,
.dashboard-transactions * {
  color: #e5e7eb !important;
}

/* All table text — force readable */
.table,
.table th,
.table td,
.table tr,
table,
table th,
table td,
table tr {
  color: #e5e7eb !important;
}

.table th,
table th {
  color: #9ca3af !important;
  border-bottom: 1px solid #232b3a !important;
  font-weight: 600 !important;
  font-size: 0.8rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
}

.table td,
table td {
  border-bottom: 1px solid rgba(35, 43, 58, 0.5) !important;
  color: #e5e7eb !important;
}

/* Striped rows */
.table-striped > tbody > tr:nth-of-type(odd) {
  --bs-table-striped-bg: rgba(255, 255, 255, 0.02) !important;
  background-color: rgba(255, 255, 255, 0.02) !important;
}

.table-hover > tbody > tr:hover {
  --bs-table-hover-bg: rgba(59, 130, 246, 0.05) !important;
  background-color: rgba(59, 130, 246, 0.05) !important;
}

/* Override Bootstrap's table bg variables */
.table {
  --bs-table-bg: transparent !important;
  --bs-table-color: #e5e7eb !important;
  --bs-table-striped-color: #e5e7eb !important;
  --bs-table-hover-color: #ffffff !important;
}

/* Links inside tables */
.table a,
table a {
  color: #60a5fa !important;
}

/* Dashboard amounts / values */
.amount,
.money,
.currency-value,
[data-amount],
.fw-semibold,
.fw-bold {
  color: #ffffff !important;
}

/* Muted / secondary text on dashboard */
.text-muted,
.text-secondary,
small.text-muted {
  color: #9ca3af !important;
}

/* Date/time stamps */
.text-nowrap,
time {
  color: #9ca3af !important;
}


/* ============================================
   BUTTONS
   ============================================ */

/* Primary — gradient */
.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #06b6d4) !important;
  border: none !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border-radius: 0.625rem !important;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25) !important;
  transition: all 0.3s ease !important;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #0891b2) !important;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4) !important;
  transform: translateY(-1px);
  color: #ffffff !important;
}

.btn-primary:active {
  transform: translateY(0) !important;
}

/* Secondary */
.btn-secondary {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid #232b3a !important;
  color: #e5e7eb !important;
  border-radius: 0.625rem !important;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
}

/* Outline variants */
.btn-outline-primary {
  border: 1px solid #3b82f6 !important;
  color: #60a5fa !important;
  background: transparent !important;
  border-radius: 0.625rem !important;
}

.btn-outline-primary:hover {
  background: rgba(59, 130, 246, 0.1) !important;
  color: #93c5fd !important;
}

.btn-outline-secondary {
  border: 1px solid #232b3a !important;
  color: #9ca3af !important;
  background: transparent !important;
  border-radius: 0.625rem !important;
}

.btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: #3b82f6 !important;
  color: #e5e7eb !important;
}

/* Danger */
.btn-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  color: #f87171 !important;
  border-radius: 0.625rem !important;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #ffffff !important;
}

/* Success */
.btn-success {
  background: rgba(16, 185, 129, 0.15) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  color: #34d399 !important;
  border-radius: 0.625rem !important;
}

.btn-success:hover {
  background: rgba(16, 185, 129, 0.25) !important;
  color: #ffffff !important;
}

/* Link-style button */
.btn-link {
  color: #60a5fa !important;
  text-decoration: none !important;
}

.btn-link:hover {
  color: #93c5fd !important;
}


/* ============================================
   LINKS
   ============================================ */

a {
  color: #60a5fa !important;
}

a:hover {
  color: #93c5fd !important;
}

/* Don't color nav links blue — sidebar handles its own */
#mainNav a {
  color: inherit !important;
}


/* ============================================
   FORMS / INPUTS
   ============================================ */

.form-control,
.form-select {
  background-color: #0f141f !important;
  border: 1px solid #232b3a !important;
  color: #e5e7eb !important;
  border-radius: 0.625rem !important;
}

.form-control:focus,
.form-select:focus {
  background-color: #161d2e !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
  color: #ffffff !important;
}

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

.input-group-text {
  background-color: #0f141f !important;
  border: 1px solid #232b3a !important;
  color: #9ca3af !important;
}

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

.form-text {
  color: #6b7280 !important;
}

/* Checkboxes / toggles */
.form-check-input:checked {
  background-color: #3b82f6 !important;
  border-color: #3b82f6 !important;
}


/* ============================================
   BADGES / STATUS
   ============================================ */

.badge {
  border-radius: 0.5rem !important;
  font-weight: 500 !important;
}

.badge.bg-success,
.badge-success {
  background-color: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
}

.badge.bg-warning,
.badge-warning {
  background-color: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
}

.badge.bg-danger,
.badge-danger {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
}

.badge.bg-info,
.badge-info {
  background-color: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
}

.badge.bg-secondary,
.badge-secondary {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #9ca3af !important;
}

.badge.bg-primary {
  background-color: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
}

.badge.bg-light {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #e5e7eb !important;
}


/* ============================================
   ALERTS
   ============================================ */

.alert {
  border-radius: 0.75rem !important;
}

.alert-info {
  background-color: rgba(59, 130, 246, 0.08) !important;
  border-color: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.08) !important;
  border-color: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.08) !important;
  border-color: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
}

.alert-danger {
  background-color: rgba(239, 68, 68, 0.08) !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
}


/* ============================================
   MODALS
   ============================================ */

.modal-content {
  background-color: #0f141f !important;
  border: 1px solid #232b3a !important;
  border-radius: 1rem !important;
}

.modal-header {
  border-bottom: 1px solid #232b3a !important;
  color: #ffffff !important;
}

.modal-footer {
  border-top: 1px solid #232b3a !important;
}

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

.modal-backdrop {
  background-color: rgba(9, 13, 23, 0.85) !important;
}


/* ============================================
   DROPDOWNS
   ============================================ */

.dropdown-menu {
  background-color: #0f141f !important;
  border: 1px solid #232b3a !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4) !important;
}

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

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: rgba(59, 130, 246, 0.1) !important;
  color: #ffffff !important;
}

.dropdown-item.active {
  background-color: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
}

.dropdown-divider {
  border-color: #232b3a !important;
}


/* ============================================
   NAV TABS
   ============================================ */

.nav-tabs {
  border-bottom: 1px solid #232b3a !important;
}

.nav-tabs .nav-link {
  color: #9ca3af !important;
  border: none !important;
}

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

.nav-tabs .nav-link.active {
  color: #60a5fa !important;
  background-color: transparent !important;
  border-bottom: 2px solid #3b82f6 !important;
}

.nav-pills .nav-link.active {
  background-color: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
}


/* ============================================
   PAGINATION
   ============================================ */

.page-link {
  background-color: #0f141f !important;
  border-color: #232b3a !important;
  color: #9ca3af !important;
}

.page-link:hover {
  background-color: rgba(59, 130, 246, 0.1) !important;
  color: #60a5fa !important;
}

.page-item.active .page-link {
  background-color: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
}


/* ============================================
   LIST GROUPS
   ============================================ */

.list-group-item {
  background-color: #0f141f !important;
  border-color: #232b3a !important;
  color: #e5e7eb !important;
}

.list-group-item:hover {
  background-color: #161d2e !important;
}

.list-group-item.active {
  background-color: rgba(59, 130, 246, 0.12) !important;
  border-color: #3b82f6 !important;
  color: #60a5fa !important;
}


/* ============================================
   PROGRESS BARS
   ============================================ */

.progress {
  background-color: #232b3a !important;
  border-radius: 0.5rem !important;
}

.progress-bar {
  background: linear-gradient(135deg, #3b82f6, #06b6d4) !important;
}


/* ============================================
   DIVIDERS
   ============================================ */

hr {
  border-color: #232b3a !important;
  opacity: 1 !important;
}


/* ============================================
   CODE BLOCKS
   ============================================ */

code {
  background-color: rgba(59, 130, 246, 0.1) !important;
  color: #93c5fd !important;
  padding: 0.15em 0.4em !important;
  border-radius: 0.375rem !important;
}

pre {
  background-color: #0a0f1a !important;
  border: 1px solid #232b3a !important;
  border-radius: 0.625rem !important;
  color: #e5e7eb !important;
}


/* ============================================
   BREADCRUMBS
   ============================================ */

.breadcrumb-item a {
  color: #60a5fa !important;
}

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


/* ============================================
   TOASTS
   ============================================ */

.toast {
  background-color: #0f141f !important;
  border: 1px solid #232b3a !important;
  border-radius: 0.75rem !important;
}

.toast-header {
  background-color: rgba(255, 255, 255, 0.03) !important;
  border-bottom: 1px solid #232b3a !important;
  color: #ffffff !important;
}


/* ============================================
   TOOLTIPS / POPOVERS
   ============================================ */

.tooltip-inner {
  background-color: #0f141f !important;
  color: #e5e7eb !important;
}

.popover {
  background-color: #0f141f !important;
  border: 1px solid #232b3a !important;
}

.popover-header {
  background-color: rgba(255, 255, 255, 0.03) !important;
  border-bottom: 1px solid #232b3a !important;
  color: #ffffff !important;
}

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


/* ============================================
   CHECKOUT (CUSTOMER-FACING)
   ============================================ */

#checkout-v2,
.checkout-body {
  background-color: var(--btcpay-body-bg) !important;
}

.store-logo {
  --logo-bg: transparent;
  --logo-radius: 0.75rem;
}

.store-name {
  color: #ffffff !important;
  font-weight: 600 !important;
}

.payment-tabs .tab.active,
.payment-method.active {
  border-color: #3b82f6 !important;
  background: rgba(59, 130, 246, 0.08) !important;
  color: #ffffff !important;
}

.qr-container {
  background: #ffffff !important;
  border-radius: 1rem !important;
  padding: 1rem !important;
}

.btn-copy {
  background: rgba(59, 130, 246, 0.1) !important;
  border: 1px solid #232b3a !important;
  color: #60a5fa !important;
}

.btn-copy:hover {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
}


/* ============================================
   RECEIPT
   ============================================ */

.receipt {
  background-color: #0f141f !important;
  border: 1px solid #232b3a !important;
  border-radius: 1rem !important;
}


/* ============================================
   FOOTER
   ============================================ */

footer,
.btcpay-footer,
.powered__by__btcpayserver {
  color: #6b7280 !important;
  border-top: 1px solid #232b3a !important;
}

footer a,
.powered__by__btcpayserver a {
  color: #6b7280 !important;
}

footer a:hover,
.powered__by__btcpayserver a:hover {
  color: #9ca3af !important;
}


/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #090d17; }
::-webkit-scrollbar-thumb { background: #232b3a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3b82f6; }


/* ============================================
   SELECTION / FOCUS
   ============================================ */

::selection {
  background: rgba(59, 130, 246, 0.3);
  color: #ffffff;
}

*:focus-visible {
  outline: 2px solid #3b82f6 !important;
  outline-offset: 2px !important;
}
