:root {
  /* Core theme palette */
  --theme-color: #6c1e3c;
  --theme-color-hover: color-mix(in srgb, var(--theme-color) 85%, white 15%);
  --theme-color-active: color-mix(in srgb, var(--theme-color) 80%, black 20%);
  --theme-text-color: #ffffff;
  --theme-divider-color: rgba(255,255,255,0.25);
}

/* ---------------- SIDEBAR ---------------- */
/* FIX 1: Target the sidebar for both mobile (offcanvas) and desktop (offcanvas-lg) 
   to set the theme background color. This uses !important for specificity. */
.offcanvas.sidebar,
.offcanvas-lg.sidebar {
  background-color: var(--theme-color) !important;
  color: var(--theme-text-color);
}

/* Custom stripe color for table-striped */
.table-striped > tbody > tr:nth-of-type(odd) {
  --bs-table-striped-bg: #ead1dcff;
  --bs-table-striped-color: inherit; /* keep normal text color */
  background-color: var(--bs-table-striped-bg) !important;
}


/* Ensure text in the offcanvas header/body is white on mobile */
.offcanvas.sidebar .offcanvas-header,
.offcanvas.sidebar .offcanvas-body {
    color: var(--theme-text-color);
}


.sidebar .nav-link {
  color: var(--theme-text-color);
  transition: all 0.2s ease-in-out;
  margin-bottom: .25rem;
}

.sidebar .nav-link:hover {
  background-color: var(--theme-color-hover);
  border-radius: 0.5rem;
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.sidebar .nav-link.active {
  background-color: var(--theme-color-active);
  border-radius: 0.5rem;
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.sidebar hr {
  border-color: var(--theme-divider-color);
}

.sidebar .nav-item {
  color: var(--theme-text-color);
}

/* ---------------- CONTENT AREA ---------------- */
body {
  background-color: var(--bs-body-bg);
}

.content h1, 
.content h2, 
.content h3, 
.content h4, 
.content h5, 
.content h6 {
  color: var(--theme-color);
  font-weight: 600;
}

/* ---------------- BUTTONS ---------------- */
.btn-theme {
  background-color: var(--theme-color);
  color: var(--theme-text-color);
  border: none;
  transition: all 0.2s ease-in-out;
}

.btn-theme:hover {
  background-color: var(--theme-color-hover);
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.btn-theme:active,
.btn-theme.active {
  background-color: var(--theme-color-active) !important;
  transform: translateY(0);
  box-shadow: none;
}

/* ---------------- FORMS ---------------- */
.form-control:focus, 
.form-select:focus {
  border-color: var(--theme-color);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--theme-color) 50%, white 50%);
}

/* ---------------- LINKS ---------------- */
a {
  color: var(--theme-color);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

a:hover {
  color: var(--theme-color-active);
  text-decoration: underline;
}

/* ===== Pagination Theming (Overrides Bootstrap Defaults) ===== */

.pagination .page-item .page-link {
  color: var(--theme-color, #7b2c3f) !important;
  border: 1px solid var(--theme-color, #7b2c3f) !important;
  background-color: #fff !important;
  border-radius: 6px !important;
  margin: 0 3px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.pagination .page-item .page-link:hover {
  background-color: var(--theme-color, #7b2c3f) !important;
  color: #fff !important;
  border-color: var(--theme-color, #7b2c3f) !important;
}

.pagination .page-item.active .page-link {
  background-color: var(--theme-color, #7b2c3f) !important;
  border-color: var(--theme-color, #7b2c3f) !important;
  color: #fff !important;
}

.pagination .page-item.disabled .page-link {
  color: #ccc !important;
  background-color: #f8f9fa !important;
  border-color: #ddd !important;
}

/* Optional: center pagination and make it rounded */
.pagination {
  justify-content: center;
}

.pagination .page-link {
  border-radius: 50px !important;
  padding: 6px 14px;
}

.btn-primary {
  background-color: var(--theme-color) !important;
  border-color: var(--theme-color) !important;
  color: var(--theme-text-color) !important;
}

.btn-primary:hover {
  background-color: var(--theme-color-hover) !important;
  border-color: var(--theme-color-hover) !important;
}

.btn-primary:active,
.btn-primary.active {
  background-color: var(--theme-color-active) !important;
  border-color: var(--theme-color-active) !important;
}
/* ---------------- LOGIN FORM ENHANCEMENTS ---------------- */

/* ---------------- LOGIN CARD THEME TINT ---------------- */
.login-card {
  background-color: color-mix(in srgb, var(--theme-color) 8%, white 92%);
  border-radius: 1rem;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  padding: 1.5rem;
}


/* Inputs */
.login-card .form-control {
  border-radius: 0.6rem;
  border: 1px solid #ddd;
  transition: all 0.2s ease-in-out;
}

.login-card .form-control:focus {
  border-color: var(--theme-color);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--theme-color) 50%, white 50%);
}

/* Button */
.login-card .btn-theme {
  border-radius: 0.6rem;
  padding: 0.6rem;
  font-weight: 500;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
  transition: all 0.2s ease-in-out;
}

.login-card .btn-theme:hover {
  background-color: var(--theme-color-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.login-card .btn-theme:active {
  background-color: var(--theme-color-active);
  transform: translateY(0);
  box-shadow: none;
}


/* Eye icon */
.bi.bi-eye-slash {
  color: var(--theme-color-active);
  opacity: 1;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.bi.bi-eye-slash:hover {
  color: var(--theme-color-hover);
  opacity: 1;
}

/* Theme background and buttons */
.bg-theme {
  background-color: var(--primary-color) !important;
  color: #fff !important;
}

.blink {
    animation: blink-animation 1s infinite;
}

@keyframes blink-animation {
    0% { opacity: 1; }
    50% { opacity: 0.1; }
    100% { opacity: 1; }
}
