
/* ==========================================================
   JUPITER ASTRO — DETAILED DASHA OVERVIEW
   Five-column glass table; fully theme-adaptive.
========================================================== */

.ddo-section {
  margin-top: 16px;
  min-width: 0;
  color: var(--ink, #17202a);
}

.ddo-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.ddo-heading h3 {
  margin: 0;
  color: var(--ink, #17202a);
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.ddo-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.ddo-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

/* ================= TABLE CONTAINER ================= */

.ddo-table-wrap {
  min-width: 0;
  overflow: hidden;
  border: none !important;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.ddo-table-scroll {
  width: 100%;
  max-width: 100%;
  height: calc(42px + 11 * 46px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color:
    color-mix(in srgb, var(--muted) 42%, transparent)
    transparent;
}

.ddo-table-scroll::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.ddo-table-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.ddo-table-scroll::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 20px;
  background: color-mix(
    in srgb,
    var(--muted) 42%,
    transparent
  );
  background-clip: padding-box;
}

.ddo-table-scroll::-webkit-scrollbar-thumb:hover {
  background: color-mix(
    in srgb,
    var(--saffron) 62%,
    var(--muted)
  );
  background-clip: padding-box;
}

/* ================= FIVE-COLUMN GRID ================= */

.ddo-table-minwidth {
  width: 100%;
  min-width: 0;
}

.ddo-header,
.ddo-row {
  display: grid;
  grid-template-columns: 23% 23% 13% 26% 15%;
  column-gap: 0;
  align-items: center;
}


/* ================= HEADER ================= */

.ddo-header {
  position: sticky;
  top: 0;
  z-index: 20;
  isolation: isolate;

  width: 100%;
  height: 42px;
  min-height: 42px;

  /* Fully opaque, theme-adaptive background */
  background: var(--paper, #ffffff) !important;
  background-image: none !important;

  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);

  /* No transparency or backdrop blending */
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.ddo-header > div {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 8px 4px;
  color: var(--ink, #17202a) !important;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ================= VIRTUAL SCROLLING ================= */

.ddo-virtual {
  position: relative;
  width: 100%;
  min-width: 0;
}

.ddo-virtual-content {
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  will-change: transform;
}

/* ================= DATA ROWS ================= */

.ddo-row {
  width: 100%;
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  margin-inline: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background-color 150ms ease;
}

.ddo-row:last-child {
  border-bottom: 0;
}

.ddo-row:hover {
  background: color-mix(
    in srgb,
    var(--saffron-soft) 38%,
    transparent
  );
}

/* Running MD-AD-PD highlight: no dark vertical stripe */
.ddo-row.is-selected {
  background: color-mix(
    in srgb,
    var(--saffron-soft) 78%,
    var(--surface)
  );
  box-shadow: none !important;
}

/* ================= CELL TYPOGRAPHY ================= */

.ddo-cell {
  min-width: 0;
  padding: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-data, "IBM Plex Mono", monospace);
  font-size: 13px;
  line-height: 1.3;
  font-weight: 400;
  color: var(--ink, #17202a);
  font-variant-numeric: tabular-nums;
}

/* ================= DASHA SEQUENCE ================= */

/* Example: Moon-Moon-Moon (1-1-1) */
.ddo-sequence {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-family: var(--font-data, "IBM Plex Mono", monospace);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink, #17202a);
  white-space: nowrap;
}

.ddo-planet-sequence {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font: inherit;
  font-weight: 400;
  color: var(--ink, #17202a);
  white-space: nowrap;
}

.ddo-sequence-counts {
  flex: 0 0 auto;
  font: inherit;
  font-weight: 400;
  color: var(--ink, #17202a);
  white-space: nowrap;
}

/* ================= PERIOD COLUMN ================= */

.ddo-period {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  line-height: 1.2;
}

.ddo-period-date {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink, #17202a);
  font-family: var(--font-data, "IBM Plex Mono", monospace);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

/* Duration is redundant */
.ddo-duration {
  display: none !important;
}

/* ================= PLACEMENT & LORDSHIP ================= */

/* D1 Placement and D1 Lordships */
.ddo-row .ddo-detail:nth-child(3),
.ddo-row .ddo-detail:nth-child(4) {
  color: var(--ink, #17202a);
  font-family: var(--font-data, "IBM Plex Mono", monospace);
  font-size: 12.5px;
  font-weight: 400;
  white-space: nowrap;
}

/* D1 Lordships: additional space */
.ddo-row .ddo-detail:nth-child(4) {
  font-size: 11.5px;
  letter-spacing: -0.035em;
  overflow: visible;
  text-overflow: clip;
}

/* D9 Placement: muted */
.ddo-row .ddo-detail:nth-child(5) {
  color: var(--muted);
  font-family: var(--font-data, "IBM Plex Mono", monospace);
  font-size: 12.5px;
  font-weight: 400;
  white-space: nowrap;
}

/* Prevent inherited bold styling */
.ddo-period .ddo-primary,
.ddo-detail .ddo-primary {
  font-weight: 400;
}

/* Ensure selected row text adapts to theme */
.ddo-row.is-selected .ddo-cell {
  color: var(--ink, #17202a);
}

.ddo-row.is-selected .ddo-detail:nth-child(5) {
  color: var(--muted);
}

/* ================= LOADING STATE ================= */

.ddo-loading {
  min-height: 142px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink, #17202a);
  text-align: center;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.ddo-loading strong {
  font-size: 0.84rem;
  font-weight: 650;
}

.ddo-loading > span:last-child {
  color: var(--muted);
  font-size: 0.73rem;
}

.ddo-spinner {
  width: 25px;
  height: 25px;
  border: 2.5px solid color-mix(
    in srgb,
    var(--saffron) 18%,
    transparent
  );
  border-top-color: var(--saffron);
  border-right-color: var(--saffron);
  border-radius: 50%;
  animation: ddo-spin 0.78s linear infinite;
}

@keyframes ddo-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ================= ERROR STATE ================= */

.ddo-error {
  padding: 14px;
  border: 1px solid color-mix(
    in srgb,
    var(--bad) 35%,
    var(--line)
  );
  border-radius: 12px;
  color: var(--bad);
  background: var(--surface);
  font-size: 0.8rem;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 1100px) {
  .ddo-table-minwidth,
  .ddo-header,
  .ddo-row,
  .ddo-virtual {
    min-width: 900px;
  }
}

@media (max-width: 700px) {
  .ddo-heading h3 {
    font-size: 0.94rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ddo-spinner {
    animation-duration: 1.8s;
  }

  .ddo-row {
    transition: none;
  }
}
