:root {
  --bg1: #0b1020;
  --bg2: #121a33;
  --card: rgba(255, 255, 255, .07);
  --stroke: rgba(255, 255, 255, .14);
  --text: rgba(255, 255, 255, .92);
  --muted: rgba(255, 255, 255, .95);
  --glow: rgba(255, 210, 102, .28);
  --glow2: rgba(122, 197, 255, .22);
  --accent2: #7ac5ff;
}

body {
  background: radial-gradient(1200px 800px at 15% 10%, var(--glow2), transparent 55%),
    radial-gradient(900px 600px at 85% 20%, var(--glow), transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  min-height: 100vh;
}

.navbar {
  background: rgba(0, 0, 0, .18);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(10px);
}

.brand-script {
  font-family: Satisfy, cursive;
  font-size: 1.35rem;
  letter-spacing: .5px;
}

.brand-strong {
  font-weight: 800;
  letter-spacing: .2px;
  opacity: .95;
}

.bg-glow {
  position: fixed;
  inset: -40px;
  pointer-events: none;
  background: radial-gradient(700px 500px at 30% 20%, rgba(255, 210, 102, .10), transparent 60%),
    radial-gradient(900px 700px at 75% 65%, rgba(122, 197, 255, .08), transparent 62%);
  filter: blur(10px);
  z-index: -1;
}

.glass {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  backdrop-filter: blur(10px);
}

/* Align Bootstrap cards with dark theme */
.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  color: var(--text);
}

.card-header,
.card-footer {
  background: rgba(255, 255, 255, .06);
  border-color: var(--stroke);
  color: var(--text);
}


/* Ensure all text in glass cards uses theme colors */
.glass,
.glass * {
  color: var(--text);
}

/* Make links in glass containers visible */
.glass a {
  color: var(--accent2) !important;
  text-decoration: none;
}

.glass a:hover {
  color: #fff !important;
  text-decoration: underline;
}

/* Specific fix for tier section readability */
.glass .h5,
.glass .fw-700,
.glass .tier-bubble {
  color: var(--text) !important;
}

/* Make small muted text in tier rows more readable */
.tier-row .small.text-muted {
  color: rgba(255, 255, 255, .98) !important;
  opacity: 1 !important;
}

/* Make footer text in glass cards more readable */
.glass .mt-3.small.text-muted,
.glass .text-muted.small {
  color: rgba(255, 255, 255, 1) !important;
  opacity: 1 !important;
  font-weight: 500;
}

/* Fix all muted text on admin pages for better readability */
.text-muted {
  color: rgba(255, 255, 255, .7) !important;
}

/* Make small text more readable everywhere */
small,
.form-label,
.stat {
  color: rgba(255, 255, 255, .7) !important;
}

/* Enforce dark mode tables globally */
.table {
  --bs-table-color: var(--text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--stroke);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.05);
  --bs-table-striped-color: var(--text);
  --bs-table-active-bg: rgba(255, 255, 255, 0.1);
  --bs-table-active-color: var(--text);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.075);
  --bs-table-hover-color: var(--text);
  color: var(--text);
  border-color: var(--stroke);
}

.hero {
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 210, 102, .10), rgba(122, 197, 255, .09));
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 22px 55px rgba(0, 0, 0, .38);
  position: relative;
  overflow: hidden;
}

.hero:before {
  content: "";
  position: absolute;
  inset: -2px;
  background: radial-gradient(500px 300px at 10% 10%, rgba(255, 255, 255, .14), transparent 55%),
    radial-gradient(600px 380px at 90% 40%, rgba(255, 255, 255, .10), transparent 55%);
  opacity: .6;
  pointer-events: none;
}

.pill {
  display: inline-block;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .12);
  padding: .35rem .65rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .85rem;
}

.fw-800 {
  font-weight: 800;
}

.fw-700 {
  font-weight: 700;
}

.verse-ref {
  font-size: 1.05rem;
  color: var(--muted);
  font-weight: 600;
}

.support-callout {
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .10);
  padding: 1rem 1rem;
  border-radius: 18px;
}

.support-title {
  font-weight: 800;
}

.support-body {
  color: var(--muted);
}

.support-body a {
  color: var(--accent2);
  text-decoration: none;
}

.support-body a:hover {
  text-decoration: underline;
}

.btn-glow {
  background: linear-gradient(135deg, rgba(255, 210, 102, .98), rgba(122, 197, 255, .92));
  border: none;
  color: rgba(0, 0, 0, .88);
  font-weight: 800;
  border-radius: 14px;
  padding: .65rem 1rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
}

.btn-glow:hover {
  transform: translateY(-1px);
}

.project-card .accordion-button {
  background: rgba(255, 255, 255, .04);
  color: var(--text);
}

.accordion-item {
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: .5rem;
}

.accordion-button:focus {
  box-shadow: none;
}

.accordion-button:not(.collapsed) {
  background: rgba(255, 255, 255, .08);
  color: var(--text);
}

.icon-badge {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .14);
}

.tier-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .6rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(0, 0, 0, .18);
  margin-top: .55rem;
}

.tier-bubble {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 210, 102, .18), rgba(122, 197, 255, .15));
  border: 1px solid rgba(255, 255, 255, .16);
  font-weight: 900;
}

.footer-card {
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 20px;
  padding: 1.2rem 1.2rem;
}

.footer-title {
  font-weight: 800;
}

.footer-sub {
  color: var(--muted);
}

.shadow-soft {
  box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}

.tier-edit,
.project-admin,
.supporter-card {
  background: rgba(0, 0, 0, .18);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 18px;
  padding: 1rem;
}

.stat {
  color: var(--muted);
}

code {
  color: rgba(255, 255, 255, .88);
  background: rgba(0, 0, 0, .26);
  padding: .05rem .35rem;
  border-radius: 8px;
}

.form-control,
textarea,
input:not([type="checkbox"]),
select {
  background: rgba(0, 0, 0, .22) !important;
  border: 1px solid rgba(255, 255, 255, .14) !important;
  color: var(--text) !important;
  border-radius: 14px;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, .45);
}

.form-select,
select {
  background: rgba(0, 0, 0, .22) !important;
  border: 1px solid rgba(255, 255, 255, .14) !important;
  color: var(--text) !important;
  border-radius: 14px;
}

.form-select option {
  background-color: rgba(0, 0, 0, .8);
  color: var(--text);
}

/* Modal styling for dark theme */
.modal-content {
  background-color: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  color: var(--text);
}

.modal-header {
  border-bottom: 1px solid var(--stroke);
}

.modal-footer {
  border-top: 1px solid var(--stroke);
}

.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.7);
}

/* Opaque backgrounds for chart modals */
.chart-modal .modal-content,
.chart-modal .modal-header,
.chart-modal .modal-body,
.chart-modal .modal-footer {
  background-color: #0b1020;
}

/* Ensure form controls in modals get dark styling */
.modal .form-control,
.modal .form-select,
.modal input[type="text"],
.modal input[type="email"],
.modal input[type="password"],
.modal select,
.modal textarea,
.modal-body .form-control,
.modal-body .form-select,
.modal-body input,
.modal-body select,
.modal-body textarea,
#createUserModal .form-control,
#createUserModal .form-select,
#createUserModal input,
#createUserModal select,
#createUserModal textarea {
  background: rgba(0, 0, 0, .8) !important;
  border: 1px solid rgba(255, 255, 255, .3) !important;
  color: var(--text) !important;
}

/* Alert styling for dark theme */
.alert {
  border-radius: 14px;
  border: 1px solid;
}

.alert-primary {
  background-color: rgba(0, 123, 255, 0.1);
  border-color: rgba(0, 123, 255, 0.3);
  color: #cce7ff;
}

.alert-secondary {
  background-color: rgba(108, 117, 125, 0.1);
  border-color: rgba(108, 117, 125, 0.3);
  color: #d1ecf1;
}

.alert-success {
  background-color: rgba(40, 167, 69, 0.1);
  border-color: rgba(40, 167, 69, 0.3);
  color: #d4edda;
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.3);
  color: #f8d7da;
}

.alert-warning {
  background-color: rgba(255, 193, 7, 0.1);
  border-color: rgba(255, 193, 7, 0.3);
  color: #fff3cd;
}

.alert-info {
  background-color: rgba(23, 162, 184, 0.1);
  border-color: rgba(23, 162, 184, 0.3);
  color: #d1ecf1;
}

.alert-light {
  background-color: rgba(248, 249, 250, 0.1);
  border-color: rgba(248, 249, 250, 0.3);
  color: #fefefe;
}

.alert-dark {
  background-color: rgba(52, 58, 64, 0.1);
  border-color: rgba(52, 58, 64, 0.3);
  color: #d6d8db;
}

/* Pagination styling for dark theme */
.page-link {
  color: var(--accent2);
  background-color: var(--card);
  border-color: var(--stroke);
  padding: 0.375rem 0.75rem;
}

.page-link:hover {
  color: #fff;
  background-color: var(--accent2);
  border-color: var(--accent2);
}

.page-item.active .page-link {
  background-color: var(--accent2);
  border-color: var(--accent2);
  color: #fff;
}

.page-item.disabled .page-link {
  color: rgba(255, 255, 255, 0.5);
  background-color: var(--card);
  border-color: var(--stroke);
}

/* Dropdown styling for dark theme */
.dropdown-menu {
  background-color: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.dropdown-item {
  color: var(--text);
  padding: 0.375rem 1rem;
}

.dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.dropdown-item:active {
  background-color: var(--accent2);
  color: #fff;
}

/* Button groups for dark theme */
.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.btn-group .btn:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

.btn-group .btn:not(:first-child) {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* Scrollable containers for admin lists */
.scrollable-container {
  max-height: 400px;
  /* Show approximately 10 items */
  overflow-y: auto;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--card);
}

/* Style the scrollbar for webkit browsers */
.scrollable-container::-webkit-scrollbar {
  width: 8px;
}

.scrollable-container::-webkit-scrollbar-track {
  background: var(--card);
  border-radius: 4px;
}

.scrollable-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.scrollable-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Table row tilt colors for bill party leanings */
.tilt-red {
  background: rgba(255, 0, 0, 0.08);
}

.tilt-blue {
  background: rgba(0, 0, 255, 0.08);
}


/* Bootstrap Button Overrides for Dark Theme */
.btn-primary {
  background-color: #007bff;
  border-color: #007bff;
  color: #fff;
}

.btn-primary:hover {
  background-color: #0056b3;
  border-color: #004085;
  color: #fff;
}

.btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
  color: #fff;
}

.btn-secondary:hover {
  background-color: #545b62;
  border-color: #4e555b;
  color: #fff;
}

.btn-success {
  background-color: #28a745;
  border-color: #28a745;
  color: #fff;
}

.btn-success:hover {
  background-color: #1e7e34;
  border-color: #1c7430;
  color: #fff;
}

.btn-danger {
  background-color: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

.btn-danger:hover {
  background-color: #bd2130;
  border-color: #b21f2d;
  color: #fff;
}

.btn-warning {
  background-color: #ffc107;
  border-color: #ffc107;
  color: #212529;
}

.btn-warning:hover {
  background-color: #e0a800;
  border-color: #d39e00;
  color: #212529;
}

.btn-info {
  background-color: #17a2b8;
  border-color: #17a2b8;
  color: #fff;
}

.btn-info:hover {
  background-color: #117a8b;
  border-color: #10707f;
  color: #fff;
}

.btn-light {
  background-color: #f8f9fa;
  border-color: #f8f9fa;
  color: #212529;
}

.btn-light:hover {
  background-color: #e2e6ea;
  border-color: #dae0e5;
  color: #212529;
}

.btn-dark {
  background-color: #343a40;
  border-color: #343a40;
  color: #fff;
}

.btn-dark:hover {
  background-color: #23272b;
  border-color: #1d2124;
  color: #fff;
}

/* Outline Button Variants - enhanced for dark theme */
.btn-outline-primary {
  color: #4dabf7;
  border-color: #4dabf7;
  background-color: transparent;
  border-width: 2px;
}

.btn-outline-primary:hover {
  color: #fff;
  background-color: #4dabf7;
  border-color: #4dabf7;
}

.btn-outline-secondary {
  color: #ffffff;
  border-color: #cccccc;
  background-color: transparent;
  border-width: 2px;
}

.btn-outline-secondary:hover {
  color: #000;
  background-color: #cccccc;
  border-color: #cccccc;
}

.btn-outline-success {
  color: #28a745;
  border-color: #28a745;
  background-color: transparent;
}

.btn-outline-success:hover {
  color: #fff;
  background-color: #28a745;
  border-color: #28a745;
}

.btn-outline-danger {
  color: #ff6b7a;
  border-color: #ff6b7a;
  background-color: transparent;
}

.btn-outline-danger:hover {
  color: #fff;
  background-color: #ff6b7a;
  border-color: #ff6b7a;
}

.btn-outline-warning {
  color: #ffeb3b;
  border-color: #ffeb3b;
  background-color: transparent;
}

.btn-outline-warning:hover {
  color: #212529;
  background-color: #ffeb3b;
  border-color: #ffeb3b;
}

.btn-outline-info {
  color: #4fc3f7;
  border-color: #4fc3f7;
  background-color: transparent;
}

.btn-outline-info:hover {
  color: #fff;
  background-color: #4fc3f7;
  border-color: #4fc3f7;
}

.btn-outline-light {
  color: rgba(255, 255, 255, .9);
  border-color: rgba(255, 255, 255, .5);
  background-color: transparent;
}

.btn-outline-light:hover {
  color: #212529;
  background-color: rgba(255, 255, 255, .9);
  border-color: rgba(255, 255, 255, .9);
}

.btn-outline-dark {
  color: rgba(255, 255, 255, .7);
  border-color: rgba(255, 255, 255, .3);
  background-color: transparent;
}

.btn-outline-dark:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .5);
}

/* Active button states for dark theme */
.btn-outline-primary.active {
  color: #fff;
  background-color: var(--accent2);
  border-color: var(--accent2);
}

.btn-outline-secondary.active {
  color: #fff;
  background-color: rgba(255, 255, 255, .2);
  border-color: rgba(255, 255, 255, .5);
}

/* Make SVG icons in buttons visible */
.btn-outline-secondary svg,
.btn-outline-secondary svg * {
  color: rgba(255, 255, 255, .9) !important;
  /* Light color for contrast on dark theme */
  fill: rgba(255, 255, 255, .9) !important;
  stroke: rgba(255, 255, 255, .9) !important;
}

.btn-outline-secondary:hover svg,
.btn-outline-secondary:hover svg * {
  color: #fff !important;
  /* Brighter on hover */
  fill: #fff !important;
  stroke: #fff !important;
}

/* Specific targeting for the graph button */
#withPartyYearBtn svg,
#withPartyYearBtn svg * {
  color: rgba(255, 255, 255, .9) !important;
  fill: rgba(255, 255, 255, .9) !important;
  stroke: rgba(255, 255, 255, .9) !important;
}

/* Button Size Variants */
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.25rem;
}

.btn-lg {
  padding: 0.5rem 1rem;
  font-size: 1.25rem;
  border-radius: 0.3rem;
}

/* Button Close (X) for modals */
.btn-close {
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
  border: 0;
  opacity: 0.8;
}

.btn-close:hover {
  opacity: 1;
}
