/* --- Ultra-Enhanced WBS Table: Modern, Interactive, Hierarchical, Feature-Rich, Accessible, Print-Ready --- */

/* Outer container */
.wbs-table-container {
  margin: 2.5em 0 1.5em 0;
  background: linear-gradient(120deg, #f6fafd 64%, #e0f6ff 100%);
  border-radius: 28px;
  padding: 2em 2em 1.4em 2em;
  box-shadow: 0 4px 32px rgba(44,62,80,0.15), 0 0 0 1.5px #eaf4ff;
  overflow-x: auto;
  position: relative;
  transition: box-shadow 0.22s, border-color 0.16s;
  border: 2.5px solid #eaf4ff;
}
.wbs-table-container:before {
  content: "🗂️ WBS Table";
  position: absolute;
  left: 1.4em;
  top: -2em;
  font-size: 1.21em;
  color: #3173c2;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 0.3em 1.2em;
  background: #eaf4ff;
  border-radius: 13px 13px 0 0;
  box-shadow: 0 2px 10px #c3dafc33;
}
.wbs-table-container:hover {
  box-shadow: 0 16px 48px rgba(44,62,80,0.24);
  border-color: #b0c4e9;
}

/* Print-friendly adjustments */
@media print {
  .wbs-table-container {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
  .wbs-table-container:before { display: none !important; }
  .wbs-table { box-shadow: none !important; border-radius: 0px !important; }
}

/* WBS Table */
.wbs-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 1.17em;
  background: transparent;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 0.5px 10px rgba(120,156,210,0.11);
  table-layout: fixed;
  animation: fadeIn .9s;
  caption-side: top;
}
.wbs-table caption {
  font-size: 1.22em;
  font-weight: 800;
  color: #3173c2;
  padding: 0.3em 0 0.8em 0;
  letter-spacing: 0.03em;
}

/* Table fade-in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(24px);}
  to { opacity: 1; transform: translateY(0);}
}

/* Sticky header with drop shadow and filter */
.wbs-table th {
  background: linear-gradient(90deg, #e2ecfa 70%, #e7f7ff 100%);
  color: #29487d;
  font-weight: 800;
  letter-spacing: 0.04em;
  border-bottom: 3px solid #b0c4e9;
  padding: 1em 1.5em 0.9em 1.5em;
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 2px 8px #b0c4e9;
  font-size: 1.13em;
  user-select: none;
  cursor: pointer;
  filter: brightness(1.03) saturate(1.04);
  background-repeat: no-repeat;
  background-position: 97% center;
  background-size: 1.2em;
  transition: background 0.15s, color 0.13s;
}
.wbs-table th.sortable:hover {
  background: linear-gradient(90deg, #dbeafe 80%, #fff 100%);
  color: #2d4063;
  cursor: pointer;
  filter: brightness(1.1) saturate(1.1);
}
.wbs-table th.sorted-asc:after {
  content: "▲";
  font-size: 0.9em;
  margin-left: 0.25em;
  vertical-align: middle;
  color: #4a90e2;
}
.wbs-table th.sorted-desc:after {
  content: "▼";
  font-size: 0.9em;
  margin-left: 0.25em;
  vertical-align: middle;
  color: #4a90e2;
}
.wbs-table th.filter-active {
  background: linear-gradient(90deg, #e2ecfa 70%, #c1e5ff 100%);
  color: #2d4063;
  box-shadow: 0 2px 10px #4a90e233;
}

/* Cell styling */
.wbs-table td {
  background: #fff;
  border: none;
  border-bottom: 1.7px solid #e7eaf4;
  padding: 0.78em 1.38em;
  color: #2b435e;
  transition: background 0.15s, color 0.17s, font-weight 0.14s, box-shadow 0.13s;
  vertical-align: middle;
  font-size: 1em;
  position: relative;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 70px;
  max-width: 350px;
  outline: none;
}

/* Zebra striping with subtle gradient */
.wbs-table tr:nth-child(even) td {
  background: linear-gradient(90deg, #f4f8fc 82%, #f8fbff 100%);
}

/* Hierarchical indentation and vertical lines */
.wbs-table td.indent-2 { padding-left: 2.4em; border-left: 4px solid #e2edfa; }
.wbs-table td.indent-3 { padding-left: 3.4em; border-left: 4px solid #d4e5fa; }
.wbs-table td.indent-4 { padding-left: 4.4em; border-left: 4px solid #c3dafc; }
.wbs-table td.indent-5 { padding-left: 5.4em; border-left: 4px solid #b0c4e9; }

/* Objective and Task color highlights */
.wbs-table td.objective {
  color: #f59e42;
  font-weight: 700;
  background: linear-gradient(90deg, #fff7e7 83%, #ffe9ce 100%);
  border-left: 4px solid #f59e42;
  box-shadow: 0 1px 6px #ffe9ce33;
  position: relative;
}
.wbs-table td.objective .tag {
  background: #f59e42;
  color: #fff;
  border-radius: 7px;
  font-size: 0.96em;
  padding: 0.14em 0.6em;
  margin-right: 0.6em;
  font-weight: 700;
}
.wbs-table td.task {
  color: #3173c2;
  font-weight: 700;
  background: linear-gradient(90deg, #e9f3ff 85%, #d1e7ff 100%);
  border-left: 4px solid #3173c2;
  box-shadow: 0 1px 6px #d1e7ff44;
  position: relative;
}
.wbs-table td.task .tag {
  background: #3173c2;
  color: #fff;
  border-radius: 7px;
  font-size: 0.96em;
  padding: 0.14em 0.6em;
  margin-right: 0.6em;
  font-weight: 700;
}

/* Parent column subtle badge */
.wbs-table td.parent {
  font-size: 0.99em;
  color: #7a94b1;
  background: #f5fafd;
  border-radius: 8px;
  padding: 0.7em 1.15em;
  font-style: italic;
  border-left: 2.5px solid #eaf4ff;
  box-shadow: 0 1px 4px #eaf4ff44;
}
.wbs-table td.parent .parent-link {
  color: #3173c2;
  text-decoration: underline;
  font-weight: 700;
  cursor: pointer;
}

/* Duration column badge & progress bar */
.wbs-table td.duration {
  background: #eaf4ff;
  color: #4a90e2;
  font-weight: 700;
  border-radius: 15px;
  font-size: 1em;
  text-align: center;
  padding: 0.64em 1.18em;
  border-left: 2.5px solid #b0c4e9;
  box-shadow: 0 1px 4px #eaf4ff44;
}
.wbs-table td.duration .progress-bar {
  display: block;
  height: 6px;
  background: linear-gradient(90deg,#4a90e2,#43aa8b);
  border-radius: 6px;
  margin: 0.3em 0 0 0;
  transition: width 0.18s;
}

/* Hover/active/focus effect */
.wbs-table tr:hover td, .wbs-table tr.selected td {
  background: #e6f4ff !important;
  color: #29487d !important;
  font-weight: 800;
  box-shadow: 0 2px 18px #d5e6fa;
  z-index: 1;
}
.wbs-table td:focus {
  background: #fffbe7 !important;
  outline: 2.5px solid #f59e42;
  box-shadow: 0 1.5px 8px #ffe9ce44;
}

/* Row numbers / WBS Level badge */
.wbs-table td.level {
  font-weight: 800;
  color: #6f90c7;
  background: linear-gradient(90deg, #eaf4ff 74%, #f6fbff 100%);
  border-radius: 10px;
  text-align: center;
  font-size: 1.04em;
  padding: 0.7em 0.95em;
  border-right: 2px solid #dbeafe;
  letter-spacing: 0.04em;
  box-shadow: 0 1px 4px #eaf4ff44;
}

/* Collapsible/expandable rows for subtasks (JS required for toggling) */
.wbs-table td.collapse-toggle {
  cursor: pointer;
  color: #3173c2;
  font-weight: 800;
  font-size: 1.06em;
}
.wbs-table td.collapse-toggle:before {
  content: "▶";
  font-size: 1.01em;
  margin-right: 0.4em;
  transition: transform 0.16s;
}
.wbs-table tr.collapsed td.collapse-toggle:before {
  transform: rotate(90deg);
}

/* Inline edit style (JS required for activation) */
.wbs-table td.editing {
  background: #fffbe7 !important;
  box-shadow: 0 1.5px 8px #ffe9ce44;
  border: 1.5px solid #ffe9ce;
}
.wbs-table td input, .wbs-table td textarea {
  font-size: 1em;
  border-radius: 7px;
  border: 1.5px solid #b0c4e9;
  padding: 0.38em 0.8em;
  background: #f8fafc;
  color: #29487d;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

/* Highlight critical path or flagged rows */
.wbs-table tr.critical td {
  background: #fff1f3 !important;
  color: #c0392b !important;
  font-weight: 800;
  border-left: 5px solid #f44336;
  box-shadow: 0 2px 12px #f4433633;
}
.wbs-table tr.flagged td {
  background: #fffbea !important;
  color: #ff9800 !important;
  font-weight: 800;
  border-left: 5px solid #ffc107;
  box-shadow: 0 2px 12px #ffc10733;
}

/* Status badges */
.wbs-table td .status-badge {
  display: inline-block;
  font-size: 0.90em;
  font-weight: 800;
  border-radius: 7px;
  padding: 0.13em 0.7em;
  margin-left: 0.4em;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.wbs-table td .status-badge.done { background: #43aa8b; color: #fff; }
.wbs-table td .status-badge.in-progress { background: #4a90e2; color: #fff; }
.wbs-table td .status-badge.late { background: #f44336; color: #fff; }
.wbs-table td .status-badge.not-started { background: #b0c4e9; color: #29487d; }
.wbs-table td .status-badge.blocked { background: #ef476f; color: #fff; }

/* Tooltip on hover for extra info (JS required for content) */
.wbs-table td[title]:hover {
  position: relative;
}
.wbs-table td[title]:hover:after {
  content: attr(title);
  position: absolute;
  left: 22px;
  top: -2.5em;
  background: #29487d;
  color: #fff;
  padding: 0.42em 1em;
  border-radius: 9px;
  font-size: 0.98em;
  white-space: pre-line;
  z-index: 5;
  box-shadow: 0 2px 14px #29487d33;
  pointer-events: none;
}

/* Row action buttons (edit/delete/add) */
.wbs-table td .row-actions {
  display: inline-flex;
  gap: 0.3em;
  margin-left: 0.8em;
  vertical-align: middle;
}
.wbs-table td .row-actions button {
  background: #eaf4ff;
  border: 1.5px solid #b0c4e9;
  color: #3173c2;
  border-radius: 7px;
  font-size: 0.98em;
  padding: 0.13em 0.5em;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.wbs-table td .row-actions button:hover {
  background: #3173c2;
  color: #fff;
  border-color: #29487d;
}

/* Filter chips for header */
.wbs-table th .filter-chip {
  display: inline-block;
  background: #43aa8b;
  color: #fff;
  border-radius: 9px;
  font-size: 0.85em;
  font-weight: 700;
  padding: 0.12em 0.7em;
  margin-left: 0.5em;
  vertical-align: middle;
  box-shadow: 0 1px 4px #43aa8b44;
}

/* Responsive tweaks */
@media (max-width: 1100px) {
  .wbs-table th, .wbs-table td { font-size: 1em; }
  .wbs-table-container { padding: 1em 0.3em; }
}
@media (max-width: 700px) {
  .wbs-table th, .wbs-table td {
    padding: 0.38em 0.38em;
    font-size: 0.93em;
    min-width: 50px;
    max-width: 200px;
  }
  .wbs-table-container {
    padding: 0.4em 0.05em;
  }
  .wbs-table td .tag, .wbs-table td .status-badge { font-size: 0.81em; }
  .wbs-table td .row-actions button { font-size: 0.88em; }
  .wbs-table caption, .wbs-table-container:before { font-size: 1em; padding: 0.13em 0.5em; }
}

/* Mobile badges for Objective/Task/Duration */
@media (max-width: 480px) {
  .wbs-table td.objective:before {
    content: "🎯 ";
    font-size: 1.16em;
    margin-right: 0.13em;
  }
  .wbs-table td.task:before {
    content: "📝 ";
    font-size: 1.11em;
    margin-right: 0.13em;
  }
  .wbs-table td.duration:before {
    content: "⏳ ";
    font-size: 1.08em;
    margin-right: 0.13em;
  }
}