/**
 * Guest panel shell dark mode (services / terms / api / how-to-use).
 * Activates only with html.dark-mode — light theme unchanged.
 * Hope UI data-bs-theme=dark covers most chrome; this fills gaps.
 */

html.dark-mode body.g-sidenav-show,
html.dark-mode body.panel-guest {
  background-color: #0f172a !important;
  color: #e2e8f0;
}

html.dark-mode .sidebar.sidebar-base.sidebar-guest,
html.dark-mode .sidebar.sidebar-base.sidebar-white {
  background-color: #1e293b !important;
  border-color: rgba(56, 189, 248, 0.15) !important;
}

html.dark-mode .sidebar.sidebar-guest .nav-link,
html.dark-mode .sidebar.sidebar-white .nav-link,
html.dark-mode .sidebar.sidebar-guest .item-name,
html.dark-mode .sidebar.sidebar-white .item-name {
  color: #cbd5e1 !important;
}

html.dark-mode .sidebar.sidebar-guest .nav-link:hover,
html.dark-mode .sidebar.sidebar-guest .nav-link.active,
html.dark-mode .sidebar.sidebar-white .nav-link:hover,
html.dark-mode .sidebar.sidebar-white .nav-link.active {
  color: #60a5fa !important;
}

html.dark-mode .sidebar .logo-title {
  color: #e2e8f0 !important;
}

html.dark-mode .main-content,
html.dark-mode .content-inner {
  background-color: transparent !important;
  color: #cbd5e1;
}

html.dark-mode .card,
html.dark-mode .card-body,
html.dark-mode .accordion-item,
html.dark-mode .table,
html.dark-mode .modal-content {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: rgba(56, 189, 248, 0.18) !important;
}

html.dark-mode .card-header,
html.dark-mode .accordion-button {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
}

html.dark-mode .accordion-button:not(.collapsed) {
  background-color: #0f172a !important;
  color: #93c5fd !important;
}

html.dark-mode .accordion-button::after {
  filter: invert(1);
}

html.dark-mode h1,
html.dark-mode h2,
html.dark-mode h3,
html.dark-mode h4,
html.dark-mode h5,
html.dark-mode .text-dark,
html.dark-mode .font-weight-bold {
  color: #e2e8f0 !important;
}

html.dark-mode .text-gradient-info {
  -webkit-text-fill-color: unset !important;
  color: #38bdf8 !important;
  background: none !important;
}

html.dark-mode .form-control,
html.dark-mode .select2-container--default .select2-selection--single,
html.dark-mode input,
html.dark-mode textarea,
html.dark-mode select {
  background-color: #0f172a !important;
  color: #e2e8f0 !important;
  border-color: rgba(148, 163, 184, 0.35) !important;
}

html.dark-mode .table th,
html.dark-mode .table td {
  color: #cbd5e1 !important;
  border-color: rgba(71, 85, 105, 0.6) !important;
}

html.dark-mode .breadcrumb,
html.dark-mode .breadcrumb-item a {
  color: #93c5fd !important;
}

html.dark-mode .btn-new,
html.dark-mode a.btn-new {
  color: #fff !important;
  background-color: #2563eb !important;
  border-color: #2563eb !important;
}

html.dark-mode .api-code-btn.btn-info {
  background-color: #2563eb !important;
  border-color: #2563eb !important;
  color: #fff !important;
}

html.dark-mode .accordion-button,
html.dark-mode .services-index-page .accordion-button,
html.dark-mode .btn.w-100.text-start {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: rgba(56, 189, 248, 0.18) !important;
}

html.dark-mode .select2-dropdown,
html.dark-mode .select2-container--default .select2-results__option,
html.dark-mode .select2-container--bootstrap4 .select2-results__option {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
}

html.dark-mode .select2-container--bootstrap4 .select2-selection--single {
  background: #0f172a !important;
  background-color: #0f172a !important;
  color: #e2e8f0 !important;
  border-color: rgba(148, 163, 184, 0.35) !important;
}

html.dark-mode .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered,
html.dark-mode .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered > span {
  background: transparent !important;
  background-color: transparent !important;
  color: #e2e8f0 !important;
}

html.dark-mode .htu-card,
html.dark-mode .card.htu-card {
  background-color: #1e293b !important;
  border-color: rgba(56, 189, 248, 0.2) !important;
}

/* Guest theme toggle in sidebar */
.sidebar-guest-theme {
  padding: 0.75rem 1rem 0.5rem;
}

.sidebar-guest-theme .theme-toggle-btn {
  width: 100%;
  justify-content: flex-start;
  gap: 0.65rem;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.12);
  color: #334155;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
}

.sidebar-guest-theme .theme-toggle-btn .theme-icon {
  width: 1.1rem;
  text-align: center;
}

html.dark-mode .sidebar-guest-theme .theme-toggle-btn {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(56, 189, 248, 0.3);
  color: #e2e8f0;
}

html.dark-mode .sidebar-guest-theme .theme-toggle-btn .theme-icon {
  color: #facc15;
}
