/* ==========================================================================
   Wepsol Weekly Report Canvas - Table & Split Layout
   Landing Page Breakdown Table, Side-by-Side vs Stacked, Zero-Scroll Rules
   ========================================================================== */

/* Split Layout Container */
.analytics-split-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  width: 100%;
  align-items: start;
}

.analytics-split-layout.side-by-side {
  grid-template-columns: 1.08fr 0.92fr;
  align-items: stretch; /* Cards are strictly equal in height */
}

@media(max-width: 1180px) {
  .analytics-split-layout.side-by-side {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

/* Landing Pages Performance Table Card */
.table-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.table-top {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--surface2);
}

.table-top h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-top .badge-count {
  background: rgba(20, 22, 31, .07);
  color: var(--ink2);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 9999px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

table.report-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

table.report-table th {
  padding: 12px 18px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.report-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink2);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

table.report-table tr:last-child td {
  border-bottom: none;
}

table.report-table tr:hover td {
  background: rgba(246, 243, 237, .45);
}

.td-page {
  font-weight: 500;
  color: var(--ink);
}

.td-page .code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--brand);
}

.td-page .page-name {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.share-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-track {
  flex: 1;
  height: 5px;
  background: rgba(20, 22, 31, .08);
  border-radius: 9999px;
  overflow: hidden;
  min-width: 50px;
}

.share-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 9999px;
}

/* ==========================================================================
   Zero Horizontal Scrolling & Internal Scroll Rules in Side-by-Side Mode
   ========================================================================== */

.analytics-split-layout.side-by-side .chart-container-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.analytics-split-layout.side-by-side .chart-container-card {
  height: 515px;
  max-height: 515px;
  min-height: 515px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  justify-content: space-between;
  overflow: visible;
  position: relative;
  z-index: 20;
}

.analytics-split-layout.side-by-side .table-card {
  height: 515px;
  max-height: 515px;
  min-height: 515px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  justify-content: flex-start;
  overflow: hidden;
  position: relative;
  z-index: 10;
}

.analytics-split-layout.side-by-side .table-top {
  flex-shrink: 0;
}

.analytics-split-layout.side-by-side .table-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 0;
  min-height: 0;
}

/* Custom sleek scrollbar for internal table scrolling */
.analytics-split-layout.side-by-side .table-scroll::-webkit-scrollbar {
  width: 6px;
}
.analytics-split-layout.side-by-side .table-scroll::-webkit-scrollbar-track {
  background: rgba(20, 22, 31, .03);
  border-radius: 9999px;
}
.analytics-split-layout.side-by-side .table-scroll::-webkit-scrollbar-thumb {
  background: rgba(20, 22, 31, .16);
  border-radius: 9999px;
}
.analytics-split-layout.side-by-side .table-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(20, 22, 31, .30);
}

.analytics-split-layout.side-by-side table.report-table {
  table-layout: fixed;
}

/* Sticky Header so columns stay pinned during scroll */
.analytics-split-layout.side-by-side table.report-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface2);
  box-shadow: 0 1px 0 var(--line);
}

/* Hide secondary columns in side-by-side mode to guarantee zero horizontal scroll */
.analytics-split-layout.side-by-side .col-prev,
.analytics-split-layout.side-by-side .col-users,
.analytics-split-layout.side-by-side .col-duration {
  display: none;
}

.analytics-split-layout.side-by-side .col-page {
  width: 44%;
}

.analytics-split-layout.side-by-side .col-sessions {
  width: 22%;
}

.analytics-split-layout.side-by-side .col-growth {
  width: 18%;
}

.analytics-split-layout.side-by-side .col-share {
  width: 16%;
}

.analytics-split-layout.side-by-side table.report-table th,
.analytics-split-layout.side-by-side table.report-table td {
  padding: 11px 12px;
}

/* Subtitle for prev sessions under Sessions cell in side-by-side mode */
.sub-prev-count {
  display: none;
}

.analytics-split-layout.side-by-side .sub-prev-count {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}
