/* ============================================================
   Custom Properties
   ============================================================ */
:root {
  --c-dark:      #003844;
  --c-mid:       #006C67;
  --c-light:     #02928b;
  --c-page-bg:   #000d10;
  --c-content:   #FFEBC6;
  --c-text:      #1a1a1a;
  --c-muted:     #555;
  --c-accent:    #da9901;
  --c-link:      #005f5c;
  --c-link-hover:#02928b;
  --c-code-bg:   rgba(0,0,0,0.06);
  --c-code-text: #b87000;
  --c-card:      rgba(255,255,255,0.28);
  --radius:      6px;
  --shadow:      0 6px 32px rgba(0,0,0,0.55);
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 24px 0 48px;
  background: var(--c-page-bg);
  background-image: radial-gradient(ellipse at top, #003844 0%, var(--c-page-bg) 60%);
  background-attachment: fixed;
  font-family: Catamaran, 'Trebuchet MS', Arial, sans-serif;
  font-size: 16px;
  color: var(--c-text);
  line-height: 1.65;
}

/* ============================================================
   Wrapper — wide enough to feel like the original layout
   ============================================================ */
#wrapper {
  width: 92%;
  max-width: 1200px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* ============================================================
   Header
   ============================================================ */
#header {
  background: var(--c-dark);
  text-align: center;
  padding: 10px 0 6px;
}
#header a { display: inline-block; line-height: 0; }
#header img {
  width: 52%;
  max-width: 460px;
  height: auto;
}

/* ============================================================
   Nav
   ============================================================ */
#menu {
  background: var(--c-dark);
  border-top: 1px solid rgba(255,255,255,0.07);
  min-height: 44px;
}
#menu ul, #menu li { margin: 0; padding: 0; list-style: none; }
#menu ul { display: flex; justify-content: center; flex-wrap: wrap; }
#menu li { position: relative; }
#menu a {
  display: block;
  padding: 0 18px;
  line-height: 44px;
  text-decoration: none;
  color: rgba(255,255,255,0.8);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.15s, background 0.15s;
  border-bottom: 3px solid transparent;
}
#menu a:hover { color: #fff; background: rgba(255,255,255,0.06); border-bottom-color: var(--c-light); }
#menu a.activepage { color: #fff; background: rgba(255,255,255,0.06); border-bottom-color: var(--c-light); }

/* Hamburger */
#menu input { display: none; }
#menu label { display: none; }

/* ============================================================
   Content area
   ============================================================ */
#content {
  background: var(--c-content);
  padding: 30px 38px 44px;
}
#content > h4:first-child,
#content > .card:first-child { margin-top: 0; }
#content h4 {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-dark);
  margin: 28px 0 10px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--c-mid);
  display: flex;
  align-items: center;
  gap: 8px;
}
#content h5 {
  font-size: 17px;
  font-weight: 700;
  color: var(--c-dark);
  margin: 20px 0 8px;
}
#content hr {
  border: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(0,0,0,0.18), transparent);
  margin: 24px 0;
}
#content p  { margin: 0 0 14px; }
#content ul { margin: 0 0 14px; padding-left: 22px; }
#content ol { margin: 0 0 14px; padding-left: 22px; }
#content li { margin-bottom: 4px; }
#content code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.88em;
  color: var(--c-code-text);
  background: var(--c-code-bg);
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 600;
}
#content a       { color: var(--c-link); }
#content a:hover { color: var(--c-link-hover); text-decoration: underline; }
#content em      { color: var(--c-muted); }

/* ============================================================
   Cards — all content blocks
   ============================================================ */
.card {
  background: var(--c-card);
  border-radius: var(--radius);
  border-left: 4px solid var(--c-mid);
  padding: 20px 22px 16px;
  margin: 0 0 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
}
.card:first-child { margin-top: 0; }

/* h4 as first child of a card → dark banner, same style as cmd-group-header */
.card > h4:first-child {
  background: var(--c-dark) !important;
  color: #fff !important;
  margin: -20px -22px 16px !important;
  padding: 9px 22px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  border-bottom: none !important;
  display: block !important;
}
/* Non-first h4 inside a card (sub-headings) keep their underline style */
.card h4:not(:first-child) {
  border-bottom: none !important;
  margin-top: 18px !important;
  margin-bottom: 8px !important;
  font-size: 15px !important;
}
.card h5 { margin-top: 16px !important; }
.card p:last-child,
.card ul:last-child { margin-bottom: 0; }

/* ============================================================
   Last Activity table
   ============================================================ */
#content .activity-table {
  width: auto;
  border-collapse: collapse;
  margin: 10px 0 24px;
}
#content .activity-table td {
  padding: 6px 14px 6px 0 !important;
  vertical-align: middle;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  background: none !important;
}
#content .activity-table tr:last-child td { border-bottom: none; }
#content .activity-table .activity-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--c-mid);
  white-space: nowrap;
  padding-right: 20px !important;
}

/* Activity table inside a card — edge-to-edge rows matching cmd-group style */
#content .card .activity-table {
  width: calc(100% + 44px);
  margin: 0 -22px -16px;
  border-collapse: collapse;
}
/* Cancel the h4's 16px bottom margin so no gap appears above the first row */
#content .card > h4:first-child + .activity-table {
  margin-top: -16px !important;
}
#content .card .activity-table td {
  padding: 7px 22px !important;
  vertical-align: middle;
  border-bottom: none !important;
  background: none !important;
}
#content .card .activity-table td:last-child {
  overflow-wrap: break-word;
  word-break: break-word;
}
#content .card .activity-table .activity-label {
  padding-right: 16px !important;
}
#content .card .activity-table tr:nth-child(even) td {
  background: rgba(0,56,68,0.05) !important;
}

/* Chart wrap inside a card — flush with card edges, no double-box */
.card > .chart-wrap {
  background: rgba(0,0,0,0.04) !important;
  box-shadow: none !important;
  border-radius: 0 0 calc(var(--radius) - 4px) calc(var(--radius) - 4px) !important;
  margin: 8px -22px -16px !important;
  padding: 14px 16px !important;
  width: calc(100% + 44px) !important;
}

/* ============================================================
   Generic tables
   ============================================================ */
#content table         { width: 100%; border-collapse: collapse; margin: 10px 0; }
#content td, #content th { padding: 8px 10px; vertical-align: top; }
#content tr:nth-child(even) { background: rgba(0,0,0,0.03); }

/* ============================================================
   DataTables theming
   ============================================================ */
#content table.dataTable thead th,
#content table.dataTable thead td {
  background: var(--c-dark) !important;
  color: #fff !important;
  border-bottom: 2px solid var(--c-mid) !important;
  /* Leave right room for sort arrow; position:relative anchors the pseudo-element */
  padding: 9px 26px 9px 10px !important;
  position: relative !important;
  white-space: nowrap;
}
/* Sort arrows visible on dark background */
#content table.dataTable thead th::before,
#content table.dataTable thead th::after {
  color: rgba(255,255,255,0.45) !important;
  bottom: 50% !important;
  transform: translateY(50%) !important;
}
#content table.dataTable thead th.sorting_asc::after,
#content table.dataTable thead th.sorting_desc::after {
  color: #fff !important;
  opacity: 1 !important;
}

#myDataTable tbody tr.odd  { background: #fff; }
#myDataTable tbody tr.even { background: rgba(0,108,103,0.07); }
#myDataTable tbody tr:hover { background: rgba(0,108,103,0.14) !important; }

#myDataTable td:nth-child(1),
#myDataTable td:nth-child(2),
#myDataTable td:nth-child(3),
#myDataTable td:nth-child(5) { text-align: center; }

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 4px;
  padding: 4px 8px;
  color: var(--c-text);
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  outline: 2px solid var(--c-light);
  outline-offset: 1px;
}
.dataTables_wrapper .dataTables_info { color: var(--c-muted); font-size: 13px; }
/* Space between the Show/Search controls and the table */
.dataTables_wrapper .dataTables_filter { margin-bottom: 10px; }
#content .dataTables_wrapper table.dataTable { margin-top: 12px !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 4px !important;
  padding: 4px 10px !important;
  color: var(--c-link) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--c-mid) !important;
  border-color: var(--c-mid) !important;
  color: #fff !important;
}
/* #content prefix beats DataTables CDN's color:#333 !important at same specificity */
#content .dataTables_wrapper .dataTables_paginate .paginate_button.current,
#content .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--c-dark) !important;
  border-color: var(--c-dark) !important;
  color: #fff !important;
}
#content input  { background: #fff; }
#content select { background: #fff; }

/* ============================================================
   Quotes
   ============================================================ */
.upvote   { color: var(--c-mid); }
.downvote { color: #c0392b; }
.timestamp { text-align: center; font-size: 14px; color: var(--c-muted); }

/* ============================================================
   Chart container
   ============================================================ */
.chart-wrap {
  background: var(--c-card);
  border-radius: var(--radius);
  padding: 18px 16px 14px;
  margin: 16px 0 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: relative;
  height: 320px;
}
.chart-wrap canvas {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

/* ============================================================
   Bot Help — command groups
   ============================================================ */
.cmd-group {
  background: var(--c-card);
  border-radius: var(--radius);
  border-left: 4px solid var(--c-mid);
  margin: 0 0 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
}
.cmd-group-header {
  background: var(--c-dark) !important;
  color: #fff !important;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cmd-group dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0;
  margin: 0;
  padding: 4px 0;
}
.cmd-group dt {
  font-weight: 600;
  padding: 5px 12px 5px 16px;
  margin: 0;
  white-space: nowrap;
}
.cmd-group dd {
  margin: 0;
  padding: 5px 16px 5px 0;
  color: var(--c-muted);
  font-size: 15px;
}
/* Alternating row shading — every 2nd dt/dd pair */
.cmd-group dl > dt:nth-child(4n+3),
.cmd-group dl > dd:nth-child(4n+4) {
  background: rgba(0,56,68,0.05);
}

.cmd-group--ops { border-left-color: var(--c-accent); }
.cmd-group--ops .cmd-group-header { background: #2e1c00 !important; }
.cmd-restricted {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: var(--c-accent);
  color: #1a0e00;
  border-radius: 3px;
  padding: 2px 7px;
  text-transform: uppercase;
}

/* ============================================================
   Footer
   ============================================================ */
#footer {
  background: var(--c-dark);
  color: rgba(255,255,255,0.65);
  padding: 20px 28px;
  text-align: center;
  font-size: 14px;
  font-family: Catamaran, 'Trebuchet MS', Arial, sans-serif;
}
#footer p { margin: 0 0 10px; }
.footer-links { margin-bottom: 14px; }
#footer .footer-links a {
  color: rgba(255,255,255,0.65) !important;
  font-family: Catamaran, 'Trebuchet MS', Arial, sans-serif !important;
  text-decoration: none !important;
  padding: 0 12px;
  font-size: 13px;
  transition: color 0.15s;
  border-right: 1px solid rgba(255,255,255,0.2);
}
#footer .footer-links a:last-child { border-right: none; }
#footer .footer-links a:hover { color: #fff !important; }
#footer img { vertical-align: middle; }

/* ============================================================
   Responsive — hamburger menu at 900px
   ============================================================ */
@media (max-width: 900px) {
  body    { padding: 0; }
  #wrapper { width: 100%; border-radius: 0; }
  #content { padding: 18px 16px 30px; }
  #header img { width: 72%; }
  .chart-wrap { height: 260px; }

  #menu { position: relative; min-height: 44px; }
  #menu ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--c-dark);
    z-index: 100;
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  }
  #menu li { width: 100%; }
  #menu a  { text-align: left; padding-left: 20px; border-bottom: none; border-left: 3px solid transparent; }
  #menu a:hover,
  #menu a.activepage { border-left-color: var(--c-light); border-bottom: none; }
  #menu label {
    display: block;
    position: absolute;
    top: 0; left: 0;
    width: 44px; height: 44px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    color: rgba(255,255,255,0.85);
    font-size: 1.8em;
    user-select: none;
  }
  #menu label::before { content: "\2261"; }
  #menu input {
    display: block;
    position: absolute;
    top: 0; left: 0;
    width: 44px; height: 44px;
    opacity: 0; z-index: 5; cursor: pointer;
    margin: 0;
  }
  #menu input:checked ~ ul { display: flex; }
  #menu input:checked + label::before { content: "\00d7"; }
}

@media (max-width: 480px) {
  .chart-wrap { height: 220px; }
  .cmd-group dl { grid-template-columns: 1fr; }
  .cmd-group dt { padding-bottom: 1px; white-space: normal; }
  .cmd-group dd { padding-top: 1px; padding-bottom: 8px; }
  .cmd-group dl > dt:nth-child(4n+3),
  .cmd-group dl > dd:nth-child(4n+4) { background: none; }
  .cmd-group dl > dt:nth-child(odd) { background: rgba(0,56,68,0.05); }
}
