html { font-size: 14px; }
@media (min-width: 768px) { html { font-size: 16px; } }

html { position: relative; min-height: 100%; }
/* Use flexbox layout from _Layout instead of legacy sticky footer margin hack */
body { margin-bottom: 0; }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem #ffffff66, 0 0 0 0.25rem #6c63ff66;
}

/* Dark theme */
body.theme-dark {
  color: #e9e9ee;
  background-color: #0f1020;
}

.bg-gradient-deep {
  background: radial-gradient(1200px 600px at 50% -10%, #1d1e3a, transparent),
              radial-gradient(1200px 600px at 50% 110%, #2a145a, transparent),
              linear-gradient(180deg, #0f1020 0%, #141432 100%);
}

.bg-nav-glass {
  background: rgba(20,20,50,0.6);
  backdrop-filter: blur(8px);
}

.bg-nav-panel { background: #1c1c38; color: #e9e9ee; }
.bg-nav-panel .dropdown-item { color: #e9e9ee; }
.bg-nav-panel .dropdown-item:hover { background: #2a2a55; color: #fff; }

.navbar .nav-link { color: #c9c9ff; }
.navbar .nav-link:hover { color: #fff; }

.btn-primary { background-color: #6c63ff; border-color: #6c63ff; }
.btn-primary:hover { background-color: #5a52e6; border-color: #5a52e6; }

.btn-discord {
  background-color: #5865F2; border-color: #5865F2; color: #fff;
}
.btn-discord:hover { background-color: #4752c4; border-color: #4752c4; color: #fff; }

.footer { background: transparent; }
.link-light { color: #c9c9ff !important; }
.link-light:hover { color: #ffffff !important; }

/* Higher-contrast helper for dark backgrounds */
.text-high { color: #d8d8ff !important; }
.text-hero-subtle { color: #c3c3ff !important; }

/* Footer border tweak for dark theme */
.footer.border-top { border-top: 1px solid rgba(255,255,255,0.08) !important; }

/* Removed toast-specific styles */

/* Floating save bar */
.save-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  z-index: 1050;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  border-radius: 12px;
}

/* Cards on dark */
.card { background-color: #181832; color: #e9e9ee; border-color: #2a2a55; }
.card .card-title, .card h5 { color: #ffffff; }

/* Inputs */
.form-control, .form-select { background-color: #151530; color: #e9e9ee; border-color: #2a2a55; }
.form-control:focus, .form-select:focus { background-color: #151530; color: #fff; border-color: #6c63ff; }

/* High-contrast placeholder text for dark theme */
input::placeholder, textarea::placeholder, .form-control::placeholder, .form-select::placeholder {
  color: #bcbcf5 !important; /* matches dark theme helper text */
  opacity: 1; /* ensure full opacity in Firefox */
}
input:disabled::placeholder, textarea:disabled::placeholder, .form-control:disabled::placeholder {
  color: #9a9ad6 !important;
}

/* List group tabs */
.list-group-item { background-color: #151530; color: #cfcff6; border-color: #2a2a55; }
.list-group-item.active { background-color: #6c63ff; border-color: #6c63ff; }

/* Dark theme tweaks for Bootstrap components */
body.theme-dark .bg-light { background-color: #181832 !important; color: #e9e9ee !important; }
body.theme-dark .text-muted, body.theme-dark .form-text, body.theme-dark .text-secondary { color: #bcbcf5 !important; }

/* Tables on dark */
body.theme-dark .table {
  color: #e9e9ee;
  border-color: #2a2a55;
  /* Ensure Bootstrap table variables render light text in dark mode */
  --bs-table-color: #e9e9ee;
  --bs-table-striped-color: #e9e9ee;
  --bs-table-hover-color: #e9e9ee;
  --bs-table-border-color: #2a2a55;
  --bs-table-bg: #151530;
  --bs-table-striped-bg: rgba(255,255,255,0.03);
  --bs-table-hover-bg: rgba(108, 99, 255, 0.08);
}
body.theme-dark .table > :not(caption) > * > * { background-color: #151530; border-color: #2a2a55; }
body.theme-dark .table thead th { background-color: #1c1c38; color: #ffffff; }
body.theme-dark .table-striped > tbody > tr:nth-of-type(odd) > * { background-color: rgba(255,255,255,0.03); }
body.theme-dark .table-hover > tbody > tr:hover > * { background-color: rgba(108, 99, 255, 0.08); }

/* Alerts on dark */
body.theme-dark .alert-info { background-color: #14283a; color: #d0e7ff; border-color: #2a4a66; }
body.theme-dark .alert-secondary { background-color: #22224a; color: #e9e9ee; border-color: #2a2a55; }