/* Dark Theme & Surface Overrides for Stoon Theme */

:root {
  --stoon-dark-bg: #0f172a;
  --stoon-dark-surface: #1e293b;
  --stoon-dark-card: #182234;
  --stoon-dark-border: rgba(255, 255, 255, 0.1);
  --stoon-dark-text: #f8fafc;
  --stoon-dark-muted: #94a3b8;
}

/* 1. Global Body & Root Backgrounds */
[data-bs-theme="dark"],
body.dark-mode,
.dark-mode,
.theme-dark {
  background-color: var(--stoon-dark-bg) !important;
  color: var(--stoon-dark-text) !important;
}

[data-bs-theme="dark"] body.stoon-body,
body.dark-mode.stoon-body,
.dark-mode body.stoon-body {
  background-color: var(--stoon-dark-bg) !important;
  color: var(--stoon-dark-text) !important;
}

/* 2. Light & White Utility Background Overrides */
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-light-subtle,
[data-bs-theme="dark"] .bg-body-tertiary,
body.dark-mode .bg-light,
body.dark-mode .bg-white,
body.dark-mode .bg-light-subtle,
body.dark-mode .bg-body-tertiary,
.dark-mode .bg-light,
.dark-mode .bg-white {
  background-color: var(--stoon-dark-surface) !important;
  color: var(--stoon-dark-text) !important;
}

/* 3. Section Overrides */
[data-bs-theme="dark"] .furniture-section,
body.dark-mode .furniture-section,
.dark-mode .furniture-section {
  background-color: var(--stoon-dark-bg);
  color: var(--stoon-dark-text);
}

[data-bs-theme="dark"] .furniture-section.bg-light,
[data-bs-theme="dark"] .furniture-section.bg-white,
body.dark-mode .furniture-section.bg-light,
body.dark-mode .furniture-section.bg-white,
.dark-mode .furniture-section.bg-light,
.dark-mode .furniture-section.bg-white {
  background-color: #152033 !important;
}

[data-bs-theme="dark"] .furniture-section-head .section-title,
body.dark-mode .furniture-section-head .section-title,
.dark-mode .furniture-section-head .section-title {
  color: #ffffff !important;
}

[data-bs-theme="dark"] .furniture-section-head .section-eyebrow,
body.dark-mode .furniture-section-head .section-eyebrow,
.dark-mode .furniture-section-head .section-eyebrow {
  color: var(--stoon-accent, #d97706) !important;
}

/* 4. Furniture Outline Button in Dark Mode */
[data-bs-theme="dark"] .furniture-outline-button,
body.dark-mode .furniture-outline-button,
.dark-mode .furniture-outline-button {
  color: #f8fafc !important;
  border-color: rgba(248, 250, 252, 0.4) !important;
  background-color: transparent !important;
}

[data-bs-theme="dark"] .furniture-outline-button:hover,
[data-bs-theme="dark"] .furniture-outline-button:focus-visible,
body.dark-mode .furniture-outline-button:hover,
body.dark-mode .furniture-outline-button:focus-visible,
.dark-mode .furniture-outline-button:hover,
.dark-mode .furniture-outline-button:focus-visible {
  background-color: var(--stoon-accent, #d97706) !important;
  border-color: var(--stoon-accent, #d97706) !important;
  color: #ffffff !important;
}

/* 5. Typography & Link Contrast */
[data-bs-theme="dark"] .text-dark,
body.dark-mode .text-dark,
.dark-mode .text-dark {
  color: var(--stoon-dark-text) !important;
}

[data-bs-theme="dark"] a.text-dark:hover,
body.dark-mode a.text-dark:hover,
.dark-mode a.text-dark:hover {
  color: var(--stoon-accent, #d97706) !important;
}

[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-secondary,
body.dark-mode .text-muted,
body.dark-mode .text-secondary,
.dark-mode .text-muted,
.dark-mode .text-secondary {
  color: var(--stoon-dark-muted) !important;
}

/* 6. Card & Grid Surface Components */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .stoon-project-card,
[data-bs-theme="dark"] .stoon-service-card,
[data-bs-theme="dark"] .stoon-product-card,
body.dark-mode .card,
body.dark-mode .stoon-project-card,
body.dark-mode .stoon-service-card,
body.dark-mode .stoon-product-card,
.dark-mode .card {
  background-color: var(--stoon-dark-card) !important;
  border-color: var(--stoon-dark-border) !important;
  color: var(--stoon-dark-text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
}

[data-bs-theme="dark"] .card-body,
body.dark-mode .card-body,
.dark-mode .card-body {
  background-color: transparent !important;
  color: var(--stoon-dark-text);
}

[data-bs-theme="dark"] .card-footer,
[data-bs-theme="dark"] .card-header,
body.dark-mode .card-footer,
body.dark-mode .card-header,
.dark-mode .card-footer,
.dark-mode .card-header {
  background-color: rgba(255, 255, 255, 0.03) !important;
  border-color: var(--stoon-dark-border) !important;
}

/* 7. Header & Navigation */
[data-bs-theme="dark"] .modern-header,
body.dark-mode .modern-header,
.dark-mode .modern-header {
  background-color: rgba(15, 23, 42, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .modern-brand-title,
body.dark-mode .modern-brand-title,
.dark-mode .modern-brand-title {
  color: #ffffff !important;
}

[data-bs-theme="dark"] .nav-link,
body.dark-mode .nav-link,
.dark-mode .nav-link {
  color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .nav-link:hover,
[data-bs-theme="dark"] .nav-link.active,
body.dark-mode .nav-link:hover,
body.dark-mode .nav-link.active {
  color: var(--stoon-accent, #d97706) !important;
}

/* 8. Detail Sidebars, Bodies & Widgets */
[data-bs-theme="dark"] .stoon-detail-sidebar,
[data-bs-theme="dark"] .stoon-detail-body,
[data-bs-theme="dark"] .stoon-active-survey,
body.dark-mode .stoon-detail-sidebar,
body.dark-mode .stoon-detail-body,
body.dark-mode .stoon-active-survey,
.dark-mode .stoon-detail-sidebar,
.dark-mode .stoon-detail-body,
.dark-mode .stoon-active-survey {
  background-color: var(--stoon-dark-surface) !important;
  border-color: var(--stoon-dark-border) !important;
  color: var(--stoon-dark-text) !important;
}

/* 9. Borders & Badges */
[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-light,
body.dark-mode .border,
body.dark-mode .border-top,
body.dark-mode .border-bottom,
body.dark-mode .border-light,
.dark-mode .border-light {
  border-color: var(--stoon-dark-border) !important;
}

[data-bs-theme="dark"] .badge.bg-white,
body.dark-mode .badge.bg-white,
.dark-mode .badge.bg-white {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}

/* 10. Form Controls & Dropdowns */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .dropdown-menu,
body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .dropdown-menu,
.dark-mode .form-control,
.dark-mode .form-select,
.dark-mode .dropdown-menu {
  background-color: var(--stoon-dark-surface) !important;
  border-color: var(--stoon-dark-border) !important;
  color: var(--stoon-dark-text) !important;
}

[data-bs-theme="dark"] .modern-header.light-header .modern-search-slot .search-input,
body.dark-mode .modern-header.light-header .modern-search-slot .search-input,
.dark-mode .modern-header.light-header .modern-search-slot .search-input {
  background-color: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

[data-bs-theme="dark"] .dropdown-item,
body.dark-mode .dropdown-item,
.dark-mode .dropdown-item {
  color: var(--stoon-dark-text) !important;
}

[data-bs-theme="dark"] .dropdown-item:hover,
body.dark-mode .dropdown-item:hover,
.dark-mode .dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--stoon-accent, #d97706) !important;
}
