/* CyberGordon Dark Theme & Theme Switch */

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: rgba(255, 255, 255, 0.8);
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.25rem;
  cursor: pointer;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.theme-toggle-btn:hover,
.theme-toggle-btn:focus {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
  outline: none;
}

.theme-toggle-btn .theme-icon-auto,
.theme-toggle-btn .theme-icon-light,
.theme-toggle-btn .theme-icon-dark {
  display: none;
}

[data-theme-mode="auto"] .theme-toggle-btn .theme-icon-auto,
:root:not([data-theme-mode]) .theme-toggle-btn .theme-icon-auto {
  display: inline-block;
}

[data-theme-mode="light"] .theme-toggle-btn .theme-icon-light {
  display: inline-block;
}

[data-theme-mode="dark"] .theme-toggle-btn .theme-icon-dark {
  display: inline-block;
}

/* Dark theme palette */
html[data-theme="dark"] {
  color-scheme: dark;
}

[data-theme="dark"] body {
  background-color: #12161c;
  color: #e2e8f0;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] .lead {
  color: #f1f5f9;
}

[data-theme="dark"] a {
  color: #58a6ff;
}

[data-theme="dark"] a:hover {
  color: #79c0ff;
}

[data-theme="dark"] .navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.75);
}

[data-theme="dark"] .navbar-dark .navbar-nav .nav-link:hover,
[data-theme="dark"] .navbar-dark .navbar-nav .nav-link:focus {
  color: #ffffff;
}

[data-theme="dark"] .navbar.bg-dark {
  background-color: #0d1117 !important;
  border-bottom: 1px solid #2d333b;
}

/* Breadcrumb */
[data-theme="dark"] .breadcrumb {
  background-color: #1b212a;
  border-bottom: 1px solid #2d333b;
  border-radius: 0;
}

[data-theme="dark"] .breadcrumb-item.active {
  color: #94a3b8;
}

[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
  color: #64748b;
}

/* Surfaces & Cards */
[data-theme="dark"] .bg-light {
  background-color: #1b212a !important;
  color: #e2e8f0;
}

[data-theme="dark"] .card {
  background-color: #1b212a;
  border-color: #2d333b;
  color: #e2e8f0;
}

[data-theme="dark"] .card-header {
  background-color: #222933;
  border-bottom-color: #2d333b;
  color: #f1f5f9;
}

[data-theme="dark"] .border-success {
  border-color: #2ea043 !important;
}

[data-theme="dark"] .border-secondary {
  border-color: #444c56 !important;
}

[data-theme="dark"] .border-top {
  border-top-color: #2d333b !important;
}

/* Text utilities */
[data-theme="dark"] .text-secondary,
[data-theme="dark"] .text-muted,
[data-theme="dark"] .text-black-50 {
  color: #94a3b8 !important;
}

[data-theme="dark"] .text-success,
[data-theme="dark"] a.text-success {
  color: #3fb950 !important;
}

[data-theme="dark"] a.text-success:hover,
[data-theme="dark"] a.text-success:focus {
  color: #56d364 !important;
}

[data-theme="dark"] code {
  color: #f472b6;
}

/* Forms */
[data-theme="dark"] .form-control,
[data-theme="dark"] .custom-select {
  background-color: #0d1117;
  color: #e2e8f0;
  border-color: #30363d;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .custom-select:focus {
  background-color: #0d1117;
  color: #f1f5f9;
  border-color: #3fb950;
  box-shadow: 0 0 0 0.2rem rgba(63, 185, 80, 0.25);
}

[data-theme="dark"] .form-control::placeholder {
  color: #768390;
}

/* Buttons */
[data-theme="dark"] .btn-outline-secondary {
  color: #c9d1d9;
  border-color: #444c56;
}

[data-theme="dark"] .btn-outline-secondary:hover {
  color: #ffffff;
  background-color: #30363d;
  border-color: #6e7681;
}

[data-theme="dark"] .dt-buttons .btn-secondary {
  background-color: #21262d;
  border-color: #30363d;
  color: #e2e8f0;
}

[data-theme="dark"] .dt-buttons .btn-secondary:hover {
  background-color: #30363d;
  border-color: #6e7681;
  color: #ffffff;
}

/* Tables & DataTables */
[data-theme="dark"] .table {
  color: #e2e8f0;
  background-color: #161b22;
}

[data-theme="dark"] .table th,
[data-theme="dark"] .table td,
[data-theme="dark"] .table-bordered,
[data-theme="dark"] .table-bordered th,
[data-theme="dark"] .table-bordered td {
  border-color: #30363d;
}

[data-theme="dark"] .table thead th {
  background-color: #1f2630;
  color: #f1f5f9;
  border-bottom-color: #444c56;
}

[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .table-danger,
[data-theme="dark"] .table-danger > th,
[data-theme="dark"] .table-danger > td,
[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) td.table-danger {
  background-color: #4a1c22;
  color: #ffd6d9;
  border-color: #7a2c34;
}

[data-theme="dark"] .table-warning,
[data-theme="dark"] .table-warning > th,
[data-theme="dark"] .table-warning > td,
[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) td.table-warning {
  background-color: #473612;
  color: #ffe8a1;
  border-color: #755a1f;
}

[data-theme="dark"] .dataTables_wrapper .dataTables_length,
[data-theme="dark"] .dataTables_wrapper .dataTables_filter,
[data-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-theme="dark"] .dataTables_wrapper .dataTables_processing {
  color: #c9d1d9;
}

[data-theme="dark"] .page-link {
  background-color: #1b212a;
  border-color: #30363d;
  color: #58a6ff;
}

[data-theme="dark"] .page-link:hover {
  background-color: #222933;
  border-color: #444c56;
  color: #79c0ff;
}

[data-theme="dark"] .page-item.active .page-link {
  background-color: #1f6feb;
  border-color: #1f6feb;
  color: #ffffff;
}

[data-theme="dark"] .page-item.disabled .page-link {
  background-color: #161b22;
  border-color: #30363d;
  color: #64748b;
}

/* Alerts */
[data-theme="dark"] .alert-warning {
  background-color: #332701;
  border-color: #664d03;
  color: #ffda6a;
}

[data-theme="dark"] .alert-warning a {
  color: #ffe69c;
  font-weight: 600;
}

[data-theme="dark"] .alert-danger {
  background-color: #2c0b0e;
  border-color: #842029;
  color: #ea868f;
}

[data-theme="dark"] .alert-danger a {
  color: #f1aeb5;
  font-weight: 600;
}

/* Footer social icons */
[data-theme="dark"] footer img[alt="X"] {
  filter: none !important;
}
