/* Kaidengs Neon · presentation-only skin for the existing Sub2API UI.
   Activate with <html class="dark" data-kaidengs-theme="neon">.
   Every rule is opt-in and dark-only; the original light theme is untouched. */

html[data-kaidengs-theme="neon"].dark {
  --kd-bg: #090f17;
  --kd-panel: #111a25;
  --kd-panel-raised: #172230;
  --kd-panel-inset: #0c141f;
  --kd-border: #283645;
  --kd-border-soft: #22303d;
  --kd-text: #e3ebf2;
  --kd-muted: #96a8ba;
  --kd-dim: #7f93a7;
  --kd-lime: #b5f36b;
  --kd-cyan: #66dedb;
  --kd-purple: #b7a2ef;
  color-scheme: dark;
  background-color: var(--kd-bg);
  accent-color: var(--kd-lime);
}

html[data-kaidengs-theme="neon"].dark body {
  background-color: var(--kd-bg);
  color: var(--kd-text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[data-kaidengs-theme="neon"].dark ::selection {
  color: #132014;
  background-color: #b5f36bc9;
}

/* Recolor neutral Tailwind surfaces only. Status/provider colors are retained. */
html[data-kaidengs-theme="neon"].dark :is(.dark\:bg-dark-950, .dark\:bg-slate-950) {
  background-color: #070c13;
}
html[data-kaidengs-theme="neon"].dark :is(.dark\:bg-dark-900, .dark\:bg-gray-900, .dark\:bg-slate-900) {
  background-color: var(--kd-bg);
}
html[data-kaidengs-theme="neon"].dark :is(.dark\:bg-dark-800, .dark\:bg-gray-800, .dark\:bg-slate-800) {
  background-color: var(--kd-panel);
}
html[data-kaidengs-theme="neon"].dark :is(.dark\:bg-dark-700, .dark\:bg-gray-700, .dark\:bg-slate-700) {
  background-color: #1c2a3a;
}
html[data-kaidengs-theme="neon"].dark :is(.dark\:bg-dark-600, .dark\:bg-gray-600) {
  background-color: #304359;
}
html[data-kaidengs-theme="neon"].dark :is(.dark\:bg-dark-800\/30, .dark\:bg-dark-800\/40, .dark\:bg-dark-800\/50, .dark\:bg-slate-800\/50) {
  background-color: #111a2580;
}
html[data-kaidengs-theme="neon"].dark :is(.dark\:bg-dark-800\/60, .dark\:bg-dark-800\/70, .dark\:bg-dark-800\/80, .dark\:bg-gray-800\/80) {
  background-color: #111a25d9;
}
html[data-kaidengs-theme="neon"].dark :is(.dark\:bg-dark-900\/90, .dark\:bg-dark-900\/95) {
  background-color: #090f17f2;
}
html[data-kaidengs-theme="neon"].dark :is(.dark\:bg-dark-700\/30, .dark\:bg-dark-700\/40, .dark\:bg-dark-700\/50) {
  background-color: #1c2a3a66;
}
html[data-kaidengs-theme="neon"].dark :is(.dark\:border-dark-600, .dark\:border-gray-600):not(.input-error, [aria-invalid="true"], [class*="border-red-"], [class*="border-rose-"], [class*="border-amber-"]) {
  border-color: #3a4d61;
}
html[data-kaidengs-theme="neon"].dark :is(.dark\:border-dark-700, .dark\:border-dark-700\/50, .dark\:border-dark-700\/60, .dark\:border-dark-700\/70, .dark\:border-dark-700\/80):not(.input-error, [aria-invalid="true"], [class*="border-red-"], [class*="border-rose-"], [class*="border-amber-"]) {
  border-color: var(--kd-border);
}
html[data-kaidengs-theme="neon"].dark :is(.dark\:border-dark-800, .dark\:border-dark-800\/50, .dark\:border-gray-800):not(.input-error, [aria-invalid="true"], [class*="border-red-"], [class*="border-rose-"], [class*="border-amber-"]) {
  border-color: var(--kd-border-soft);
}
html[data-kaidengs-theme="neon"].dark :is(.dark\:text-gray-100, .dark\:text-dark-100, .dark\:text-gray-200, .dark\:text-dark-200) {
  color: var(--kd-text);
}
html[data-kaidengs-theme="neon"].dark :is(.dark\:text-gray-300, .dark\:text-dark-300) {
  color: #c0cddd;
}
html[data-kaidengs-theme="neon"].dark :is(.dark\:text-gray-400, .dark\:text-dark-400) {
  color: var(--kd-muted);
}
html[data-kaidengs-theme="neon"].dark :is(.dark\:text-gray-500, .dark\:text-dark-500) {
  color: var(--kd-dim);
}

/* Grid is painted on the existing main surface, not an interaction overlay. */
html[data-kaidengs-theme="neon"].dark main {
  background-color: var(--kd-bg);
  background-image:
    radial-gradient(ellipse at 8% 0%, #93d06308 0%, transparent 42%),
    radial-gradient(ellipse at 100% 18%, #a185e409 0%, transparent 42%),
    linear-gradient(#7d9aad05 1px, transparent 1px),
    linear-gradient(90deg, #7d9aad05 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
}

html[data-kaidengs-theme="neon"].dark .sidebar {
  background-color: #0b121b;
  background-image: radial-gradient(ellipse at 20% 0%, #b5f36b05, transparent 55%);
  border-color: #26343e;
  box-shadow: 8px 0 35px #00000012;
}
html[data-kaidengs-theme="neon"].dark .sidebar-header {
  background-image: linear-gradient(105deg, #b5f36b07, transparent 80%);
  border-color: #26343e;
}
html[data-kaidengs-theme="neon"].dark .sidebar-brand-title {
  color: #edf5e7;
  letter-spacing: -.045em;
  text-shadow: 0 0 24px #b5f36b10;
}
html[data-kaidengs-theme="neon"].dark .sidebar-section-title {
  color: #8193a4;
  font-size: .6875rem;
  letter-spacing: .1em;
  font-weight: 500;
}
html[data-kaidengs-theme="neon"].dark .sidebar-link {
  border-radius: .625rem;
  color: #a4b4c5;
  font-weight: 500;
  transition-property: color, background-color, box-shadow;
}
html[data-kaidengs-theme="neon"].dark .sidebar-link:hover {
  color: #e1efdd;
  background-color: #b5f36b08;
}
html[data-kaidengs-theme="neon"].dark .sidebar-link-active,
html[data-kaidengs-theme="neon"].dark .sidebar-link-active:hover {
  color: var(--kd-lime);
  background-color: #b5f36b0c;
  background-image: linear-gradient(90deg, #b5f36b08, transparent);
  box-shadow: inset 2px 0 var(--kd-lime), inset 0 0 0 1px #b5f36b12;
}
html[data-kaidengs-theme="neon"].dark .sidebar-link-active .sidebar-label {
  color: var(--kd-lime);
}
html[data-kaidengs-theme="neon"].dark .sidebar-link-active > svg {
  filter: drop-shadow(0 0 5px #b5f36b20);
}
html[data-kaidengs-theme="neon"].dark .sidebar-link-active {
  animation: kaidengs-neon-breathe 5s ease-in-out infinite;
}
html[data-kaidengs-theme="neon"].dark main .card:hover {
  box-shadow: 0 8px 32px #02060d24, 0 0 20px #66dedb07, inset 0 1px #b5f36b12;
}
@keyframes kaidengs-neon-breathe {
  0%, 100% { box-shadow: inset 2px 0 #b5f36b, inset 0 0 0 1px #b5f36b12, 0 0 12px #b5f36b00; }
  50% { box-shadow: inset 2px 0 #b5f36b, inset 0 0 0 1px #b5f36b29, 0 0 16px #b5f36b0b; }
}
html[data-kaidengs-theme="neon"].dark :is(header.glass, .glass header, .glass) {
  background-color: #0d1520e8;
  border-color: #283543;
  box-shadow: 0 1px 0 #c2e2f004;
}

/* Cards remain the same size and retain original overflow and layout rules. */
html[data-kaidengs-theme="neon"].dark :is(.card, .card-glass):not([class*="bg-red-"], [class*="bg-rose-"], [class*="bg-amber-"], [class*="bg-yellow-"], [class*="bg-green-"], [class*="bg-emerald-"], [class*="bg-orange-"], [class*="bg-blue-"], [class*="bg-sky-"], [class*="bg-cyan-"], [class*="bg-purple-"], [class*="bg-violet-"], [class*="bg-primary-"], [class*="bg-gradient-"]) {
  background-color: var(--kd-panel);
  box-shadow: 0 6px 25px #02060d16, inset 0 1px #e8f3ff03;
}
html[data-kaidengs-theme="neon"].dark :is(.card, .card-glass):not([class*="border-red-"], [class*="border-rose-"], [class*="border-amber-"], [class*="border-yellow-"], [class*="border-green-"], [class*="border-emerald-"], [class*="border-orange-"], [class*="border-blue-"], [class*="border-sky-"], [class*="border-cyan-"], [class*="border-purple-"], [class*="border-violet-"], [class*="border-primary-"]) {
  border-color: var(--kd-border);
}
html[data-kaidengs-theme="neon"].dark :is(.card-header, .card-footer) {
  border-color: var(--kd-border-soft);
}
html[data-kaidengs-theme="neon"].dark .card-header {
  background-image: linear-gradient(90deg, #b5f36b03, transparent 50%);
}
html[data-kaidengs-theme="neon"].dark :is(h1, h2, h3):not([class*="text-red-"], [class*="text-rose-"], [class*="text-amber-"], [class*="text-yellow-"], [class*="text-green-"], [class*="text-emerald-"], [class*="text-orange-"], .text-gradient) {
  letter-spacing: -.025em;
}
html[data-kaidengs-theme="neon"].dark :is(code, pre, kbd, .font-mono) {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", "Microsoft YaHei", monospace;
}

/* Only neutral/primary actions are restyled; danger, warning, success and
   all named payment-provider button variants keep their original colors. */
html[data-kaidengs-theme="neon"].dark .btn-primary {
  color: #152010;
  background-color: var(--kd-lime);
  background-image: linear-gradient(115deg, #b5f36b, #a5e45e);
  border-color: #c4f493;
  box-shadow: 0 3px 15px #b5f36b14, inset 0 1px #ffffff2e;
  font-weight: 600;
  --tw-ring-color: #b5f36b66;
}
html[data-kaidengs-theme="neon"].dark .btn-primary:hover:not(:disabled) {
  color: #14210e;
  background-color: #c5fc86;
  background-image: linear-gradient(115deg, #c3fb82, #b1ec70);
  box-shadow: 0 5px 21px #b5f36b22, inset 0 1px #ffffff38;
}
html[data-kaidengs-theme="neon"].dark .btn-primary :is(.text-white, .dark\:text-white) {
  color: inherit;
}
html[data-kaidengs-theme="neon"].dark .btn-secondary {
  color: #c2cfdb;
  background-color: #17212d;
  border-color: #344455;
  box-shadow: inset 0 1px #ffffff03;
}
html[data-kaidengs-theme="neon"].dark .btn-secondary:hover:not(:disabled) {
  background-color: #1b2a35;
  border-color: #526d62;
  color: #e1efd6;
}
html[data-kaidengs-theme="neon"].dark .btn-ghost {
  color: #aec0ce;
}
html[data-kaidengs-theme="neon"].dark .btn-ghost:hover:not(:disabled) {
  color: var(--kd-lime);
  background-color: #b5f36b0b;
}
html[data-kaidengs-theme="neon"].dark :is(.btn-primary, .btn-secondary, .btn-ghost):focus-visible {
  outline: 2px solid #b5f36b99;
  outline-offset: 3px;
}
html[data-kaidengs-theme="neon"].dark :is(.text-primary-400, .text-primary-500, .text-primary-600, .dark\:text-primary-300, .dark\:text-primary-400, .dark\:text-primary-500) {
  color: var(--kd-lime);
}
html[data-kaidengs-theme="neon"].dark :is(.dark\:bg-primary-400\/10, .dark\:bg-primary-500\/10, .dark\:bg-primary-500\/15, .dark\:bg-primary-900\/10, .dark\:bg-primary-900\/20, .dark\:bg-primary-900\/25, .dark\:bg-primary-900\/30, .dark\:bg-primary-900\/40) {
  background-color: #b5f36b10;
}
html[data-kaidengs-theme="neon"].dark .text-gradient {
  background-image: linear-gradient(108deg, var(--kd-lime), var(--kd-cyan) 66%, #c1afed);
}
html[data-kaidengs-theme="neon"].dark :is(.border-primary-400, .border-primary-500, .dark\:border-primary-500) {
  border-color: #a7d97a;
}
html[data-kaidengs-theme="neon"].dark :is(.dark\:border-primary-700, .dark\:border-primary-800) {
  border-color: #b5f36b38;
}

/* Do not cover validation states with the neutral field skin. */
html[data-kaidengs-theme="neon"].dark :is(.input, .select):not(.input-error, [aria-invalid="true"], [class*="border-red-"], [class*="border-rose-"], [class*="border-amber-"]) {
  background-color: var(--kd-panel-inset);
  border-color: #344456;
  color: #dbe6f0;
  box-shadow: inset 0 1px 3px #00000014;
}
html[data-kaidengs-theme="neon"].dark :is(.input, .select):not(.input-error, [aria-invalid="true"], [class*="border-red-"], [class*="border-rose-"], [class*="border-amber-"]):focus {
  border-color: #9ccc70;
  box-shadow: 0 0 0 3px #b5f36b0d;
  --tw-ring-color: #b5f36b26;
}
html[data-kaidengs-theme="neon"].dark :is(.input, .select):disabled {
  opacity: .6;
}
html[data-kaidengs-theme="neon"].dark .input::placeholder {
  color: #7e92a6;
}
html[data-kaidengs-theme="neon"].dark .input-label {
  color: #b9c9d8;
}
html[data-kaidengs-theme="neon"].dark .input-hint {
  color: #8fa3b6;
}
html[data-kaidengs-theme="neon"].dark select option {
  color: #dce7ed;
  background-color: #14202d;
}

/* Opaque sticky surfaces preserve the real DataTable's z-index and scrolling. */
html[data-kaidengs-theme="neon"].dark :is(.table-container, .table-wrapper) {
  border-color: var(--kd-border);
  scrollbar-color: #4d655c #101924;
}
html[data-kaidengs-theme="neon"].dark :is(.table-container, .table-wrapper) thead,
html[data-kaidengs-theme="neon"].dark .table-wrapper .table-header,
html[data-kaidengs-theme="neon"].dark .sticky-header-cell {
  background-color: #101a26;
  border-color: var(--kd-border);
}
html[data-kaidengs-theme="neon"].dark :is(.table-container, .table-wrapper) thead th {
  color: #9eb4c7;
  border-color: var(--kd-border-soft);
}
html[data-kaidengs-theme="neon"].dark :is(.table-container, .table-wrapper) tbody td {
  border-color: #213040;
}
html[data-kaidengs-theme="neon"].dark tbody .sticky-col {
  background-color: #111a25;
}
html[data-kaidengs-theme="neon"].dark tbody tr:hover .sticky-col {
  background-color: #192630;
}
html[data-kaidengs-theme="neon"].dark :is(.dark\:hover\:bg-dark-700, .dark\:hover\:bg-dark-800, .dark\:hover\:bg-gray-800):hover {
  background-color: #192630;
}
html[data-kaidengs-theme="neon"].dark .table-wrapper::-webkit-scrollbar-thumb {
  background-color: #4c645dbf !important;
}
html[data-kaidengs-theme="neon"].dark .table-wrapper::-webkit-scrollbar-thumb:hover {
  background-color: #73917cd9 !important;
}
html[data-kaidengs-theme="neon"].dark .sidebar-nav {
  scrollbar-color: #364a49 transparent;
}

html[data-kaidengs-theme="neon"].dark .modal-overlay {
  background-color: #030810c7;
}
html[data-kaidengs-theme="neon"].dark .modal-content {
  background-color: #121d2a;
  border-color: #3b514f;
  box-shadow: 0 28px 100px #00000080, 0 0 50px #b5f36b04, inset 0 1px #dbeaff06;
}
html[data-kaidengs-theme="neon"].dark :is(.modal-header, .modal-footer) {
  border-color: #2a3a48;
}
html[data-kaidengs-theme="neon"].dark .modal-footer {
  background-color: #0d172233;
}
html[data-kaidengs-theme="neon"].dark .modal-title {
  color: #e2eedf;
}

/* Existing homepage terminal, with purely decorative and inert orbit rings. */
html[data-kaidengs-theme="neon"].dark .terminal-container {
  isolation: isolate;
}
html[data-kaidengs-theme="neon"].dark .terminal-container::before,
html[data-kaidengs-theme="neon"].dark .terminal-container::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
  border-radius: 50%;
}
html[data-kaidengs-theme="neon"].dark .terminal-container::before {
  inset: -24% -10%;
  border: 1px solid #b5f36b22;
  box-shadow: 0 0 0 22px #b5f36b03, 0 0 0 44px #66dedb03;
  transform: rotate(-22deg);
  background: radial-gradient(ellipse, #b5f36b08, transparent 68%);
  animation: kaidengs-neon-orbit 24s ease-in-out infinite alternate;
}
@keyframes kaidengs-neon-orbit {
  from { transform: rotate(-22deg); }
  to { transform: rotate(-4deg); }
}
html[data-kaidengs-theme="neon"].dark .terminal-container::after {
  inset: -12% -6%;
  border: 1px solid #aa8cef1a;
  transform: rotate(20deg);
  background: radial-gradient(ellipse at 85% 20%, #aa8cef10, transparent 60%);
}
html[data-kaidengs-theme="neon"].dark .terminal-window {
  background: linear-gradient(135deg, #14232a, #0b1420 60%);
  box-shadow: 0 24px 60px #00000055, 0 0 0 1px #b5f36b29, 0 0 50px #b5f36b07, inset 0 1px #ffffff0c;
}
html[data-kaidengs-theme="neon"].dark .terminal-header {
  background-color: #17232ddd;
  border-color: #b5f36b14;
}
html[data-kaidengs-theme="neon"].dark .terminal-title {
  color: #92a89f;
}
html[data-kaidengs-theme="neon"].dark :is(.code-prompt, .code-url) {
  color: var(--kd-lime);
}
html[data-kaidengs-theme="neon"].dark .code-cmd {
  color: var(--kd-cyan);
}
html[data-kaidengs-theme="neon"].dark .code-flag {
  color: var(--kd-purple);
}
html[data-kaidengs-theme="neon"].dark .code-comment {
  color: #8ea0b1;
}

@media (max-width: 767px) {
  html[data-kaidengs-theme="neon"].dark main {
    background-size: auto, auto, 36px 36px, 36px 36px;
  }
  html[data-kaidengs-theme="neon"].dark .terminal-container::before,
  html[data-kaidengs-theme="neon"].dark .terminal-container::after {
    content: none;
  }
  html[data-kaidengs-theme="neon"].dark .terminal-window {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-kaidengs-theme="neon"].dark .sidebar-link-active,
  html[data-kaidengs-theme="neon"].dark .terminal-container::before {
    animation: none;
  }
  html[data-kaidengs-theme="neon"].dark .sidebar-link {
    transition-duration: 0ms;
  }
  html[data-kaidengs-theme="neon"].dark .terminal-window,
  html[data-kaidengs-theme="neon"].dark .terminal-window:hover {
    transition: none;
    transform: none;
  }
  html[data-kaidengs-theme="neon"].dark .code-line {
    animation: none;
    opacity: 1;
  }
  html[data-kaidengs-theme="neon"].dark .cursor {
    animation: none;
  }
}

@media print {
  html[data-kaidengs-theme="neon"].dark main {
    background-image: none;
  }
  html[data-kaidengs-theme="neon"].dark .terminal-container::before,
  html[data-kaidengs-theme="neon"].dark .terminal-container::after {
    content: none;
  }
}
