/* Brand Colors Overrides */
:root {
  --bs-primary: #35aeaa;
  --bs-primary-rgb: 53, 174, 170;
  --bs-primary-active: #2f9c99;
  /* Darker shade for hover */
  --bs-primary-light: #e0f6f5;

  --kt-primary: #35aeaa;
  --kt-primary-rgb: 53, 174, 170;
  --kt-primary-active: #2f9c99;
  --kt-primary-light: #e0f6f5;

  --bs-warning: #ffd60a;
  --bs-warning-rgb: 255, 214, 10;

  --kt-warning: #ffd60a;
  --kt-warning-rgb: 255, 214, 10;
}

.btn-primary {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary.active,
.btn-primary.show {
  background-color: var(--bs-primary-active) !important;
  border-color: var(--bs-primary-active) !important;
}

.text-primary {
  color: var(--bs-primary) !important;
}

.bg-primary {
  background-color: var(--bs-primary) !important;
}

/* Button Focus Rings */
.btn-check:focus+.btn-primary,
.btn-primary:focus {
  color: #fff;
  background-color: var(--bs-primary-active);
  border-color: var(--bs-primary-active);
  box-shadow: 0 0 0 0.25rem rgba(53, 174, 170, 0.5);
}

/* Links */
a {
  color: var(--bs-primary);
  text-decoration: none;
}

a:hover {
  color: var(--bs-primary-active);
}

/* Active Menu Items (Metronic specific often uses text-primary) */
.menu-item .menu-link.active .menu-title {
  color: var(--bs-primary) !important;
}

.menu-item .menu-link.active .menu-icon i {
  color: var(--bs-primary) !important;
}

/* Landing Header Language Selector - Override white text on active state */
.landing-header .menu .menu-link.active {
  color: var(--bs-primary) !important;
  background-color: var(--bs-primary-light) !important;
}

.menu-state-bg .menu-item .menu-link.active {
  color: var(--bs-gray-800) !important;
  background-color: var(--bs-gray-100) !important;
}

/* Ensure language dropdown menu items are always visible */
.menu-sub-dropdown .menu-link {
  color: var(--bs-gray-800) !important;
}

.menu-sub-dropdown .menu-link.active {
  color: var(--bs-primary) !important;
  background-color: var(--bs-primary-light) !important;
}

/* =============================================
   PROJECT COLOR THEMING
   CSS custom properties set dynamically per-project.
   Defaults to brand primary when no project color set.
   ============================================= */

:root {
  --project-color: var(--bs-primary);
  --project-contrast: #ffffff;
  --sidebar-bg: var(--project-color);
  --sidebar-text: var(--project-contrast);
  --sidebar-active-accent: var(--project-contrast);
  --sidebar-active-bg: rgba(255, 255, 255, 0.15);
  --sidebar-hover-bg: rgba(255, 255, 255, 0.08);
  --header-bg: color-mix(in srgb, var(--project-color) 8%, white);
  --accent-color: var(--project-color);
}

/* ---- Sidebar Background & Text ---- */
/* Override sidebar background to use project color */
[data-kt-app-sidebar-fixed="true"] .app-sidebar {
  background-color: var(--sidebar-bg) !important;
}

/* All sidebar menu titles use contrast color */
.app-sidebar .menu-title {
  color: var(--sidebar-text) !important;
  opacity: 0.85;
}

/* All sidebar menu icons use contrast color */
.app-sidebar .menu-icon i,
.app-sidebar .menu-icon .ki-duotone span {
  color: var(--sidebar-text) !important;
  opacity: 0.7;
}

/* Menu bullets use contrast color */
.app-sidebar .menu-bullet .bullet {
  background-color: var(--sidebar-text) !important;
  opacity: 0.5;
}

/* Menu section headings */
.app-sidebar .menu-heading {
  color: var(--sidebar-text) !important;
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Menu arrows (for expandable items) */
.app-sidebar .menu-arrow::after {
  color: var(--sidebar-text) !important;
  opacity: 0.5;
}

/* ---- Active Menu Item ---- */
.app-sidebar .menu-link.active {
  position: relative;
  background-color: var(--sidebar-active-bg) !important;
  border-radius: 6px;
}

/* Active: full opacity for title, icon, bullet */
.app-sidebar .menu-link.active .menu-title {
  color: var(--sidebar-active-accent) !important;
  opacity: 1;
  font-weight: 600;
}

.app-sidebar .menu-link.active .menu-icon i,
.app-sidebar .menu-link.active .menu-icon .ki-duotone span {
  color: var(--sidebar-active-accent) !important;
  opacity: 1;
}

.app-sidebar .menu-link.active .menu-bullet .bullet {
  background-color: var(--sidebar-active-accent) !important;
  opacity: 1;
}

/* Active indicator - left accent bar (bright white) */
.app-sidebar .menu-link.active::before {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background-color: var(--sidebar-active-accent);
}

/* RTL: flip the accent bar to the right side */
[dir="rtl"] .app-sidebar .menu-link.active::before {
  left: auto;
  right: 0;
  border-radius: 3px 0 0 3px;
}

/* ---- Hover States ---- */
.app-sidebar .menu-link:hover:not(.active) {
  background-color: var(--sidebar-hover-bg) !important;
  border-radius: 6px;
}

.app-sidebar .menu-link:hover:not(.active) .menu-title {
  opacity: 1;
}

.app-sidebar .menu-link:hover:not(.active) .menu-icon i,
.app-sidebar .menu-link:hover:not(.active) .menu-icon .ki-duotone span {
  opacity: 1;
}

/* ---- Sidebar Logo / Brand area ---- */
.app-sidebar .app-sidebar-logo {
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

/* Sidebar toggle button */
.app-sidebar-toggle {
  background-color: var(--sidebar-bg) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.app-sidebar-toggle i {
  color: var(--sidebar-text) !important;
}

/* ---- Header - Light Tint of Project Color ---- */
/* Uses color-mix to create a very subtle tint */
[data-kt-app-header-fixed="true"] .app-header {
  background-color: var(--header-bg) !important;
  border-bottom: 1px solid color-mix(in srgb, var(--header-bg) 95%, black) !important;
}

/* Header in dark mode should blend more */
[data-kt-app-layout="dark-sidebar"] .app-header {
  background-color: var(--header-bg) !important;
  border-bottom: 1px solid color-mix(in srgb, var(--header-bg) 95%, black) !important;
}

/* ---- Scrollbar in sidebar ---- */
.app-sidebar ::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.app-sidebar ::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.35);
}

.app-sidebar ::-webkit-scrollbar-track {
  background-color: transparent;
}

/* ---- Back-to-project link in settings sidebar ---- */
.app-sidebar .btn-light {
  background-color: var(--sidebar-active-bg) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: var(--sidebar-text) !important;
}

.app-sidebar .btn-light:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
}