/* ============================================================================
   Statistika › Streameriai page — page-scoped styles
   ----------------------------------------------------------------------------
   File layout:
     1. Page shell
     2. Breadcrumb
     3. Filters bar (Rodyti X dienų / Tinklo dropdown / Atnaujinti)
     4. Section subtitle
     5. Streamer cards grid (3 per row on desktop)
     6. Single streamer card (title + chart SVG + grid + axes)
     7. Hover tooltip (white box with date/time + 2 colored values)
     8. Responsive — all @media queries consolidated at the end
   ============================================================================ */


/* ============================ 1. Page shell ============================ */
.app-shell[data-page="statistics-streamers"] .content-shell {
  overflow: hidden;
}

.streamers-page {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  height: 100%;
  min-height: 0;
}

.streamers-scroll {
  min-height: 0;
  padding: 13px 16px 16px;
  overflow: auto;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.68);
  scrollbar-width: none;
}

.streamers-scroll::-webkit-scrollbar {
  display: none;
}


/* ============================ 2. Toolbar (breadcrumb + filter toggle) ============================ */
.streamers-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.streamers-filter-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 60px;
  height: 38px;
  border: 1px solid var(--white);
  border-radius: var(--radius-sm);
  background: var(--button-bg-color);
  cursor: pointer;
}

.streamers-filter-toggle img {
  width: 16px;
  height: 16px;
}

.streamers-filter-toggle .streamers-filter-toggle-chevron {
  width: 12px;
  height: 12px;
  transition: transform 0.18s ease;
}

.streamers-page.is-filter-open .streamers-filter-toggle-chevron {
  transform: rotate(180deg);
}

.streamers-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 20px;
  line-height: 26px;
  color: var(--dark4txt);
  font-weight: 500;
}

.streamers-breadcrumb a {
  text-decoration: none;
  color: inherit;
}

.streamers-breadcrumb-sep {
  color: var(--grey4txt);
}


/* ============================ 3. Filters bar ============================ */
.streamers-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.streamers-filter-text {
  font-size: 14px;
  color: var(--dark4txt);
  white-space: nowrap;
}

/* Stepper — themed to match the dropdown (white shell, soft-grey ± buttons) */
.streamers-stepper {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100px;
  height: 38px;
  padding: 4px 6px;
  border: 1px solid var(--white);
  border-radius: var(--radius-sm);
  background: var(--white);
}

.streamers-stepper button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: var(--button-bg-color);
  color: var(--dark4txt);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.streamers-stepper button:hover {
  background: rgba(0, 0, 0, 0.08);
}

.streamers-stepper-value {
  flex: 1 1 auto;
  text-align: center;
  font: inherit;
  font-weight: 500;
  color: var(--dark4txt);
}

.streamers-dropdown {
  position: relative;
  display: inline-flex;
  width: 200px;
}

.streamers-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--white);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--dark4txt);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.streamers-dropdown-toggle:hover {
  background: rgba(0, 0, 0, 0.03);
}

.streamers-dropdown-toggle strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
}

.streamers-dropdown-toggle img {
  width: 14px;
  height: 14px;
  transition: transform 0.18s ease;
}

.streamers-dropdown.is-open .streamers-dropdown-toggle img {
  transform: rotate(180deg);
}

.streamers-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.streamers-dropdown-menu[hidden] {
  display: none;
}

.streamers-dropdown-menu button {
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--dark4txt);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.streamers-dropdown-menu button:hover {
  background: rgba(123, 85, 203, 0.08);
}

.streamers-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  min-width: 110px;
  padding: 0 18px;
  border: 1px solid var(--white);
  border-radius: var(--radius-sm);
  background: var(--button-bg-color);
  color: var(--dark4txt);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.streamers-refresh-btn:hover {
  background: var(--white);
}


/* ============================ 4. Section subtitle ============================ */
.streamers-subtitle {
  font-size: 14px;
  font-weight: 500;
  color: var(--dark4txt);
  margin: 0 0 8px;
}


/* ============================ 5. Cards grid (parent container) ============================ */
.streamers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}


/* ============================ 6. Streamer card ============================ */
.streamer-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 276px;
  padding: 15px 12px 8px;
  border: 1px solid #b8b8b8;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.58);
  overflow: hidden;
}

.streamer-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 23px;
  line-height: 29px;
  font-weight: 500;
  color: #2f4398;
}

.streamer-subtitle {
  font-size: 12px;
  line-height: 16px;
  color: var(--dark4txt);
}

.streamer-chart {
  position: relative;
  width: 97%;
  margin-top: 10px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  grid-template-rows: 146px 46px;
  column-gap: 4px;
  row-gap: 0;
}

.streamer-chart-yaxis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  height: 146px;
  padding: 0 2px 3px 0;
  font-size: 9px;
  color: var(--grey4txt);
}

.streamer-chart-plot {
  position: relative;
  height: 146px;
  border-left: 1px solid #d2d2d2;
  border-bottom: 1px solid #d2d2d2;
  background-image:
    linear-gradient(to bottom, rgba(3, 5, 34, 0.08) 1px, transparent 1px),
    linear-gradient(to right, rgba(3, 5, 34, 0.08) 1px, transparent 1px);
  background-size: 100% calc(100% / 5), calc(100% / 22) 100%;
  cursor: crosshair;
}

.streamer-chart-plot>svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Path styling */
.streamer-line {
  fill: none;
  stroke-width: 1.55;
  vector-effect: non-scaling-stroke;
}

.streamer-line.is-down {
  stroke: #1524ff;
}

.streamer-line.is-up {
  stroke: #ff263c;
}

.streamer-area.is-down {
  display: none;
}

.streamer-area.is-up {
  fill: rgba(255, 38, 60, 0.18);
}

.streamer-chart-xaxis-spacer {
  /* empty cell under yaxis */
}

.streamer-chart-xaxis {
  position: relative;
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  align-items: flex-start;
  height: 46px;
  padding: 3px 4px 0 0;
  overflow: hidden;
  font-size: 7.5px;
  line-height: 1;
  color: var(--grey4txt);
}

.streamer-chart-xaxis span {
  display: block;
  width: max-content;
  max-width: 72px;
  font-family: var(--font-body), system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: -0.2px;
  line-height: 1;
  justify-self: end;
  transform-origin: top right;
  transform: rotate(-48deg) scale(0.6) translateY(1px);
  white-space: nowrap;
}


/* ============================ 7. Hover tooltip ============================ */
.streamers-tooltip {
  position: fixed;
  z-index: 60;
  display: none;
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  color: var(--dark4txt);
  pointer-events: none;
}

.streamers-tooltip.is-open {
  display: block;
}

.streamers-tooltip-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--dark4txt);
}

.streamers-tooltip-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.streamers-tooltip-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.streamers-tooltip-swatch {
  width: 16px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid currentColor;
}

.streamers-tooltip-swatch.is-down {
  background: rgba(94, 63, 224, 0.14);
  color: #5e3fe0;
}

.streamers-tooltip-swatch.is-up {
  background: rgba(227, 23, 59, 0.16);
  color: #e3173b;
}

.streamers-tooltip-label {
  flex: 1 1 auto;
}

.streamers-tooltip-num {
  font-weight: 600;
}


/* ============================================================================
   8. Responsive — all @media queries consolidated at the end
   Breakpoints (each appears once):
     1280px → 2 cards per row
      768px → 1 card per row
      600px → tighter filters, smaller chart height
   ============================================================================ */

/* ---------------- ≤ 1280px : 2 cards per row ---------------- */
@media (max-width: 1280px) {
  .streamers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------------- ≤ 768px : 1 card per row + filter wraps ---------------- */
@media (max-width: 768px) {
  .streamers-filter-toggle {
    display: inline-flex;
  }

  .streamers-filters {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.68);
  }

  .streamers-page.is-filter-open .streamers-filters {
    display: flex;
  }

  .streamers-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

@media (max-width: 600px) {
  .streamers-filter-text {
    flex: 0 0 auto;
    font-size: 13px;
    color: var(--grey4txt);
  }

  .streamers-stepper,
  .streamers-dropdown {
    width: 100%;
  }

  .streamers-refresh-btn {
    justify-content: center;
  }

  .streamer-chart {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .streamer-chart-yaxis,
  .streamer-chart-plot {
    height: 143px;
  }

  .streamer-title {
    font-size: 18px;
  }

  .streamer-chart-xaxis {
    font-size: 8px;
  }
}