/* === Changelog Table Styling === */

/* Row type colors */
.changelog-table .col-Addition { background: rgba(69,186,2,0.8); }
.changelog-table .col-Change   { background: rgba(80,70,193,0.8); }
.changelog-table .col-Fix      { background: rgba(100,149,237,0.8); }
.changelog-table .col-Removal  { background: rgba(183,37,37,0.8); }

/* Main table styling */
.changelog-table {
    border-left: none !important;
    border-right: none !important;
    border-collapse: collapse;
    width: 100%;
    max-width: 100%;
}

.changelog-table th,
.changelog-table td {
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: 1px solid #444;
    color: white;
    padding: 8px 12px;
    text-align: center;
    word-break: break-word;
}

.changelog-table .thead {
    font-weight: bold;
    background-color: #CC5500;
    color: white;
    text-align: center;
}

/* Hover effect */
.changelog-table tbody tr {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.changelog-table tbody tr:hover { 
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1;
    opacity: 0.85;
}

/* Exclude header row from hover */
.changelog-table tr.tcat:hover {
    transform: none;
    box-shadow: none;
    opacity: 1;
}

/* === Legend Styling === */
.d3islegend {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
    color: white;
    justify-content: center; /* center the legend horizontally */
}

.d3islegend li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.d3islegend li span {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.d3islegend li span.addition { background: rgba(69,186,2,0.8); }
.d3islegend li span.change   { background: rgba(80,70,193,0.8); }
.d3islegend li span.fix      { background: rgba(100,149,237,0.8); }
.d3islegend li span.removal  { background: rgba(183,37,37,0.8); }

/* === Mobile & Tablet Responsive Styling === */
@media (max-width: 768px) {
  /* Table reset for small screens */
  .changelog-table,
  .changelog-table thead,
  .changelog-table tbody,
  .changelog-table tr,
  .changelog-table th,
  .changelog-table td {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .changelog-table thead { display: none; }             /* hide header */
  .changelog-table tr:first-child { display: none !important; } /* hide placeholder row */
  .changelog-table tr td:nth-child(1) { display: none; }       /* hide ID column */
  .changelog-table td:before { content: none !important; display: none !important; } /* remove pseudo-labels */

  .changelog-table tr {
    margin-bottom: 10px;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 6px;
    background: #1a1a1a;
    box-sizing: border-box;
  }

  .changelog-table td {
    display: block;
    width: 100%;
    padding: 4px 6px;
    font-size: 13px;
    line-height: 1.25;
    color: white;
    word-break: break-word;
    overflow-wrap: anywhere;
    box-sizing: border-box;
    text-align: center; /* center all text */
  }

  .changelog-table tr td:nth-child(3) { text-align: left; } /* Update column left-aligned */

  /* 2-column layout for tablets (≥500px) */
  @media (min-width: 500px) and (max-width: 768px) {
    .changelog-table tr {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 5px;
    }

    .changelog-table td {
      padding: 4px 6px;
      font-size: 13px;
      min-width: 0;
    }

    .changelog-table tr td:nth-child(3) { grid-column: span 2; } /* Update full width */
    .changelog-table tr td:nth-child(5) { text-align: right; }   /* Date right-aligned */
  }

  /* Legend adjustments for mobile */
  .d3islegend {
    gap: 10px;
    font-size: 13px;
  }
  .d3islegend li span {
    width: 16px;
    height: 16px;
  }

  /* Prevent overflow from images/forms in table */
  .changelog-table td img,
  .changelog-table td a,
  .changelog-table td button,
  .changelog-table td input,
  .changelog-table td select,
  .changelog-table td pre,
  .changelog-table td code {
    max-width: 100% !important;
    height: auto !important;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
}

		