/* ============================================================
   CENTER ALL THE DATA IN TASKS TABLE
   ============================================================ */

/* Center text for all table headers and cells */
#taskTable th,
#taskTable td {
  text-align: center;
  vertical-align: middle;
}

/* Optional: ensure header labels look balanced */
#taskTable th {
  font-weight: 600;
}


/* ============================================================
   STATUS COLORS — SAFE WITH BOOTSTRAP
   ============================================================ */

/* Row & button background/text colors */
.status-Planned {
  background: #e3f2fd !important;
  color: #1976d2 !important;
}

.status-InProgress {
  background: #ffe0b2 !important; /* improved contrast */
  color: #e65100 !important;      /* stronger text color */
}

.status-Delayed {
  background: #ffebee !important;
  color: #c62828 !important;
}

.status-Issues {
  background: #ffecb3 !important; /* improved contrast */
  color: #e65100 !important;      /* stronger text color */
}

.status-Completed {
  background: #e8f5e8 !important;
  color: #2e7d32 !important;
}

/* Selected item (the button) */
.status-selected {
  font-weight: bold;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  border: 1px solid #bbb !important;
  padding: 6px 10px !important;
  border-radius: 4px !important;
  background: #fff !important;
}

/* Emoji icons (requires <span class="icon"> in HTML) */
.status-selected .icon,
.dropdown-item .icon {
  font-size: 1.2em;
}

/* ============================================================
   DROPDOWN HOVER COLORS
   (These do NOT interfere with Bootstrap behavior)
   ============================================================ */

.dropdown-item.status-Planned:hover {
  background: #bbdefb !important;
  color: #0d47a1 !important;
}

.dropdown-item.status-InProgress:hover {
  background: #ffe0b2 !important;
  color: #e65100 !important;
}

.dropdown-item.status-Delayed:hover {
  background: #ffcdd2 !important;
  color: #b71c1c !important;
}

.dropdown-item.status-Issues:hover {
  background: #ffecb3 !important;
  color: #e65100 !important;
}

.dropdown-item.status-Completed:hover {
  background: #c8e6c9 !important;
  color: #1b5e20 !important;
}

.dropdown-item {
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* ============================================================
   TABLE DROPDOWN FIXES
   Ensure Bootstrap dropdowns can overflow table cells
   ============================================================ */

/* Scoped only to task table */
#taskTable td,
#taskTable th {
  overflow: visible !important;
  position: relative; /* ensures correct dropdown positioning */
}

/* Force dropdown menu above table rows */
.dropdown-menu {
  position: absolute !important;
  z-index: 5000 !important;
  transform: translate3d(0, 0, 0) !important;
}

/* Ensure dropdown container is not clipped */
.status-dropdown {
  overflow: visible !important;
}

/* Table wrapper must allow overflow */
.table-responsive {
  overflow: visible !important;
}

/* Page wrapper must allow overflow as well */
.page-content {
  overflow: visible !important;
}

/* ============================================================
   MOBILE MENU BACKDROP
   Ensures hamburger overlay works correctly
   ============================================================ */

#navBackdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);

  display: none;
  pointer-events: none;   /* hidden by default */
  z-index: 900;           /* sits below nav */
}

#navBackdrop.show {
  display: block !important;
  pointer-events: auto !important;
}


/* ===========================================================
   TOP NAV (Blue theme, Bootstrap-safe)
   =========================================================== */

.top-nav {
  background: linear-gradient(90deg, #0d6efd 0%, #007bff 100%);
  color: #fff;
  padding: 0.5rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.top-nav .nav-toggle {
  background: transparent;
  color: #fff;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  display: none; /* shown on small screens below */
}

.top-nav .nav-links {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

.top-nav .nav-links li {
  margin-left: 1.5rem;
}

.top-nav .nav-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: background 0.3s, color 0.3s;
}

.top-nav .nav-links a:hover,
.top-nav .nav-links a:focus,
.top-nav .nav-links .active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  text-decoration: none;
}

/* --- Mobile: collapsible menu --- */
@media (max-width: 768px) {
  .top-nav {
    flex-wrap: wrap;
  }

  .top-nav .nav-toggle {
    display: inline-block;
  }

  .top-nav .nav-links {
    width: 100%;
    flex-direction: column;
    background: linear-gradient(180deg, #0d6efd 0%, #007bff 100%);
    display: none;
    margin-top: 0.5rem;
    border-radius: 0.25rem;
  }

  .top-nav .nav-links.open {
    display: flex;
  }

  .top-nav .nav-links li {
    margin: 0;
  }

  .top-nav .nav-links a {
    padding: 0.75rem 1rem;
    width: 100%;
  }
}

/* --- Optional: slight glow indicator under current link --- */
.top-nav .nav-links .active {
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.6);
}

/* --- Subtle transition for dropdown menus --- */
/* (Bootstrap dropdowns still work unchanged) */
.dropdown-menu {
  border-color: #0d6efd;
}
.dropdown-menu .dropdown-item:hover {
  background-color: #0d6efd;
  color: #fff;
}

/* ===========================================================
   TABLE SORTING STYLES
   =========================================================== */
th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
}

th.sortable::after {
  content: "⇅";
  font-size: 0.8em;
  color: #ccc;
  margin-left: 6px;
}

th.sortable.sorted.asc::after {
  content: "▲";
  color: #0d6efd;
}

th.sortable.sorted.desc::after {
  content: "▼";
  color: #0d6efd;
}

/* Highlight sorted column */
td.sorted,
th.sorted {
  background-color: rgba(13, 110, 253, 0.1);
}

/* ===========================================================
   COLUMN RESIZE
   =========================================================== */

/* Style visible resize grips between columns */
.JColResizer .grip {
  width: 6px;                  /* a bigger clickable area */
  cursor: col-resize;
  background-color: rgba(0, 0, 0, 0.1);  /* light dividing line */
  border-right: 1px solid rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
  transition: background-color 0.15s ease;
}

/* When hovering near a column edge */
.JColResizer .grip:hover {
  background-color: rgba(0, 0, 0, 0.25);
}

/* While dragging, make it bold so users can see position */
.dragging .grip {
  background-color: #007bff;   /* Bootstrap blue */
  border-right-color: #007bff;
}

/* Add consistent vertical lines between table columns */
#taskTable th + th,
#taskTable td + td {
  border-left: 1px solid rgba(0, 0, 0, 0.1);
}

/* Optional: make header separators slightly darker */
#taskTable thead th + th {
  border-left: 1px solid rgba(0, 0, 0, 0.2);
}

