/* results.css — דף תוצאות */

.results-header {
  gap: 10px;
}

.back-btn {
  font-size: 20px;
  flex-shrink: 0;
}

.stock-title-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.res-symbol {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}


.res-name {
  font-size: 11px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.results-content {
  padding: 0 0 32px;
}

/* ===== RESULTS LAYOUT WRAPPERS ===== */
.results-layout {
  display: block;
}
.results-left, .results-right {
  display: block;
}

/* ===== GAUGE ===== */
.gauge-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}

.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#gauge-canvas {
  display: block;
}

.gauge-score-wrap {
  margin-top: 8px;
  text-align: center;
  white-space: nowrap;
}

.gauge-score {
  display: block;
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  letter-spacing: -2px;
}

.gauge-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-top: 4px;
  padding: 3px 12px;
  border-radius: 20px;
}

.badge-buy.gauge-label   { background: var(--green-bg); }
.badge-wait.gauge-label  { background: var(--yellow-bg); }
.badge-sell.gauge-label  { background: var(--red-bg); }

.partial-warning {
  font-size: 11px;
  color: var(--yellow);
  margin-top: 8px;
  font-weight: 500;
}

/* ===== INFO CARDS ===== */
.info-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.info-card {
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-inline-end: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.info-card:nth-child(3n) { border-inline-end: none; }
.info-card:nth-last-child(-n+3) { border-bottom: none; }

.info-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.info-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.info-change {
  font-size: 12px;
  font-weight: 600;
}

.info-change.positive { color: var(--green); }
.info-change.negative { color: var(--red); }

.info-sub {
  font-size: 11px;
  color: var(--text-3);
}

/* ===== CHART ===== */
.chart-section {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.chart-ranges {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.range-btn {
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-3);
  font-family: inherit;
  transition: all var(--transition);
}

.range-btn:hover { color: var(--text-2); background: var(--bg-3); }

.range-btn.active {
  background: var(--green);
  color: #fff;
  box-shadow: 0 1px 4px rgba(22,163,74,0.3);
}

#chart-container {
  height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
}

/* ===== CRITERIA TABLE ===== */
.criteria-section {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.criteria-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.criteria-row {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.criteria-row:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-sm);
}

.criteria-row-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.criteria-icon { font-size: 18px; flex-shrink: 0; }

.criteria-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.criteria-weight {
  font-size: 10px;
  color: var(--text-3);
  flex-shrink: 0;
  font-weight: 600;
}

.criteria-score-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 10px;
  flex-shrink: 0;
  min-width: 36px;
  text-align: center;
}

.score-high { background: var(--green-bg); color: var(--green); }
.score-mid  { background: var(--yellow-bg); color: var(--yellow); }
.score-low  { background: var(--red-bg); color: var(--red); }
.score-none { background: var(--bg-3); color: var(--text-3); }

.criteria-bar-wrap {
  margin-top: 8px;
  height: 3px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
}

.criteria-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}

.criteria-desc {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: none;
}

.criteria-row.expanded .criteria-desc { display: block; }

.criteria-data {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.criteria-data-item {
  background: var(--bg-3);
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-2);
  font-weight: 500;
}

/* ===== NEWS ===== */
.news-section {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.news-item:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-sm);
}

.news-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-3);
}

.news-body { flex: 1; min-width: 0; }

.news-headline {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.news-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 5px;
}

/* ===== COMPARE BAR ===== */
.compare-bar {
  padding: 16px;
  text-align: center;
}

/* ===== DISCLAIMER ===== */
.disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  padding: 0 20px 8px;
  line-height: 1.6;
}

/* ===== MOBILE ADJUSTMENTS ===== */
@media (max-width: 380px) {
  .info-cards { grid-template-columns: repeat(2, 1fr); }
  .info-card:nth-child(3n) { border-inline-end: 1px solid var(--border); }
  .info-card:nth-child(2n) { border-inline-end: none; }
}

/* ===================================================================
   DESKTOP LAYOUT (900px+)
   ================================================================ */
@media (min-width: 900px) {

  .results-content {
    max-width: var(--content-max);
    margin: 0 auto;
  }

  /* 2-column main layout */
  .results-layout {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
    min-height: 560px;
  }

  .results-left {
    display: flex;
    flex-direction: column;
    flex: 0 0 360px;
    border-inline-end: 1px solid var(--border);
  }

  .results-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  /* Gauge */
  .results-left .gauge-section {
    flex: 1;
    border-bottom: 1px solid var(--border);
    padding: 36px 24px 24px;
  }

  #gauge-canvas { width: 280px !important; height: 160px !important; }
  .gauge-score  { font-size: 52px; }

  /* Info cards: 2-col grid on left */
  .results-left .info-cards {
    grid-template-columns: repeat(2, 1fr);
    border-bottom: none;
  }
  .results-left .info-card:nth-child(2n) { border-inline-end: none; }
  .results-left .info-card:nth-child(3n) { border-inline-end: 1px solid var(--border); }
  .results-left .info-card { padding: 16px 18px; }
  .results-left .info-label { font-size: 10px; }
  .results-left .info-value { font-size: 16px; }

  /* Chart fills right panel */
  .results-right .chart-section {
    flex: 1;
    border-bottom: none;
    display: flex;
    flex-direction: column;
    padding: 20px;
  }

  .results-right #chart-container {
    flex: 1;
    height: auto;
    min-height: 440px;
  }

  /* Below the main 2-col: criteria + news in wider layout */
  .criteria-section,
  .news-section {
    padding: 24px 32px;
  }

  /* Criteria: 2-column grid */
  .criteria-table {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  /* News: 2-column grid */
  .news-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  /* Header */
  .res-symbol { font-size: 22px; }
  .res-name   { font-size: 13px; }

  .compare-bar { padding: 20px 32px; }
  .disclaimer  { padding: 0 32px 16px; }
}

@media (min-width: 1200px) {
  .results-left { flex: 0 0 400px; }

  .criteria-table { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1400px) {
  .results-left { flex: 0 0 440px; }
}
