/* Kanban Board Styling Adaptation for CoreUI */
html {
  font-size: 90%;
}

body {
  font-family: "Inter", sans-serif;
}

/* CoreUI Primary Color Override - Green */
:root {
  --cui-primary: #198754;
  --cui-primary-rgb: 25, 135, 84;
  --cui-link-color: #198754;
  --cui-link-color-rgb: 25, 135, 84;
  --cui-link-hover-color: #146c43;
  --cui-link-hover-color-rgb: 20, 108, 67;
}

.btn-primary {
  --cui-btn-color: #fff;
  --cui-btn-bg: #198754;
  --cui-btn-border-color: #198754;
  --cui-btn-hover-color: #fff;
  --cui-btn-hover-bg: #146c43;
  --cui-btn-hover-border-color: #13653f;
  --cui-btn-focus-shadow-rgb: 60, 153, 110;
  --cui-btn-active-color: #fff;
  --cui-btn-active-bg: #13653f;
  --cui-btn-active-border-color: #115c39;
  --cui-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
  --cui-btn-disabled-color: #fff;
  --cui-btn-disabled-bg: #198754;
  --cui-btn-disabled-border-color: #198754;
}

.kanban-board {
  display: flex;
  overflow-x: auto;
  padding-bottom: 1rem;
  gap: 1.5rem;
  height: calc(100vh - 200px);
  /* Adjust based on header/footer */
}

.kanban-column {
  min-width: 150px;
  width: 300px;
  background-color: #ebedef;
  /* CoreUI light gray matches */
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.kanban-column-header {
  padding: 1rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 0.5rem 0.5rem 0 0;
}

.kanban-cards {
  padding: 1rem;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Custom Scrollbar for Kanban */
.kanban-cards::-webkit-scrollbar {
  width: 6px;
}

.kanban-cards::-webkit-scrollbar-track {
  background: transparent;
}

.kanban-cards::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

/* Card Improvements */
.ticket-card {
  background: white;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
  /* Subtle shadow like CoreUI cards */
  border: none;
  border-radius: 0.375rem;
  /* CoreUI default radius */
  cursor: grab;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ticket-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.ticket-card:active {
  cursor: grabbing;
  background-color: #f8f9fa;
}

/* Sidebar Fix for Overlap REMOVED - Causing toggle issues */
/* CoreUI handles this natively via adjacent sibling selectors */
@media (min-width: 992px) {
  /*
  body.app-body {
    padding-left: 256px;
  }
  .sidebar.sidebar-fixed {
    left: 0;
  }
  */

  .sidebar-narrow-unfoldable:not(:hover),
  .sidebar-narrow {
    width: 4rem;
  }

  /* Dynamic spacer for fixed sidebar states */
  /* If sidebar has 'hide' class, wrapper padding should be 0 (default) */
  /* If sidebar is visible (no 'hide'), apply padding to body or wrapper */

  /* We target the wrapper based on the preceding sidebar state */
  /* Since sidebar is typically a direct child of body alongside wrapper */

  /* Default open sidebar */
  body.app-body > .sidebar.sidebar-fixed:not(.hide):not(.sidebar-narrow):not(.sidebar-narrow-unfoldable) ~ .wrapper {
      padding-left: 16rem;
      transition: padding-left 0.3s;
  }

  /* Narrow sidebar */
  body.app-body > .sidebar.sidebar-fixed.sidebar-narrow ~ .wrapper,
  body.app-body > .sidebar.sidebar-fixed.sidebar-narrow-unfoldable:not(:hover) ~ .wrapper {
      padding-left: 4rem;
      transition: padding-left 0.3s;
  }

  /* Hidden sidebar - ensures padding removal */
  body.app-body > .sidebar.sidebar-fixed.hide ~ .wrapper {
      padding-left: 0;
      transition: padding-left 0.3s;
  }
}

/* Fix Dropdown Clipped in Responsive Tables */
.table-responsive {
  overflow-x: visible;
  overflow-y: visible;
}

/* Ensure the table itself can still scroll if forced, but default to visible for dropdowns */
@media (max-width: 768px) {
  .table-responsive {
    overflow-x: auto;
  }
}

/* Search input fix for missing right border radius */
.input-group > .form-control:not(:last-child) {
  border-top-right-radius: var(--cui-border-radius) !important;
  border-bottom-right-radius: var(--cui-border-radius) !important;
}
/* When the reset button is visible (it becomes the last child), we want the input (not last child) to NOT have radius on right */
.input-group > .form-control:not(:last-child).border-end-0 {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

/* Search reset button border fix */
#btnResetSearch {
  border-top-right-radius: var(--cui-border-radius) !important;
  border-bottom-right-radius: var(--cui-border-radius) !important;
  z-index: 5;
}

/* Ticket list action dropdown button - minimum width for easier clicking */
.btn-actions {
  min-width: 24px !important;
  width: 24px !important;
  text-align: center !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.btn-actions i {
  font-size: 1rem !important;
}