/* Modern Marketing Table Styles */
.table-container {
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  background-color: white;
}

#marketingTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
  font-size: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

/* Header styling */
#marketingTable thead {
  background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
}

#marketingTable th {
  padding: 16px 12px;
  text-align: left;
  font-weight: 600;
  color: #334155;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
  z-index: 10;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.05em;
  border-right: 1px solid #e2e8f0;
}

#marketingTable th:last-child {
  border-right: none;
}

/* Body styling */
#marketingTable tbody tr {
  transition: background-color 0.2s ease;
  cursor: pointer;
  border-bottom: 1px solid #e2e8f0;
}

#marketingTable tbody tr:hover {
  background-color: rgba(241, 245, 249, 0.7);
}

#marketingTable td {
  padding: 12px;
  color: #475569;
  border-right: 1px solid #e2e8f0;
}

#marketingTable td:last-child {
  border-right: none;
}

/* Hierarchical styling for group headers */
#marketingTable .level-1 {
  background-color: #f8fafc;
  font-weight: 600;
  border-left: 4px solid #3b82f6;
}

#marketingTable .level-1 td {
  color: #1e293b;
}

#marketingTable .level-2 {
  background-color: #f9fafb;
  border-left: 3px solid #93c5fd;
}

#marketingTable .level-2 td:first-child {
  padding-left: 24px;
}

#marketingTable .level-3 {
  background-color: #ffffff;
  border-left: 2px solid #dbeafe;
}

#marketingTable .level-3 td:first-child {
  padding-left: 36px;
}

/* Indentation for hierarchical levels */
#marketingTable .level-2 td:first-child::before {
  content: "└";
  display: inline-block;
  margin-right: 8px;
  color: #94a3b8;
}

#marketingTable .level-3 td:first-child::before {
  content: "├";
  display: inline-block;
  margin-right: 8px;
  color: #cbd5e1;
}

/* Footer styling */
#marketingTable tfoot {
  background-color: #f1f5f9;
}

#marketingTable tfoot tr {
  border-top: 2px solid #cbd5e1;
}

#marketingTable tfoot td {
  padding: 14px 12px;
  color: #0f172a;
  font-weight: 700;
  border-right: 1px solid #e2e8f0;
}

#marketingTable tfoot td:last-child {
  border-right: none;
}

/* Numeric value alignment */
#marketingTable td:nth-child(n+2),
#marketingTable th:nth-child(n+2) {
  text-align: right;
}

/* Alternating row colors for better readability */
#marketingTable tbody tr.level-1:nth-child(odd) {
  background-color: #f8fafc;
}

#marketingTable tbody tr.level-1:nth-child(even) {
  background-color: #f1f5f9;
}

#marketingTable tbody tr.level-2:nth-child(odd) {
  background-color: #f9fafb;
}

#marketingTable tbody tr.level-2:nth-child(even) {
  background-color: #f3f4f6;
}

#marketingTable tbody tr.level-3:nth-child(odd) {
  background-color: #ffffff;
}

#marketingTable tbody tr.level-3:nth-child(even) {
  background-color: #f9fafb;
}

/* Expandable/collapsible functionality */
#marketingTable .group-header {
  position: relative;
}

#marketingTable .group-header td:first-child {
  position: relative;
}

#marketingTable .group-header.expanded td:first-child::after {
  content: "▼";
  position: absolute;
  right: 12px;
  color: #94a3b8;
  font-size: 10px;
}

#marketingTable .group-header:not(.expanded) td:first-child::after {
  content: "▶";
  position: absolute;
  right: 12px;
  color: #94a3b8;
  font-size: 10px;
}

/* Hidden rows */
#marketingTable .hidden {
  display: none;
}

/* Responsive design */
@media (max-width: 1200px) {
  .table-container {
    overflow-x: auto;
    max-width: 100%;
  }
  
  #marketingTable {
    min-width: 1000px;
  }
}

/* Add subtle hover effect for cells */
#marketingTable td:hover {
  background-color: rgba(219, 234, 254, 0.3);
}

/* Special styling for important metrics */
#marketingTable td:nth-child(2) {
  font-weight: 600;
  color: #1e40af;
}

#marketingTable td:nth-child(9):not(:empty):not([data-value="0"]):not(:contains("-")) {
  color: #047857;
  font-weight: 500;
}

#marketingTable td:nth-child(11):not(:empty):not([data-value="0"]):not(:contains("-")) {
  color: #6d28d9;
  font-weight: 500;
}

/* Empty or dash values styling */
#marketingTable td:empty,
#marketingTable td:contains("-") {
  color: #cbd5e1;
  font-style: italic;
}