/* ═══════════════════════════════════════════════════════════
   COMPONENT IMPROVEMENTS - SHARED CSS
   Used across all 12 improved component pages
   ═══════════════════════════════════════════════════════════ */

:root {
  --navy-deep: #001d3a;
  --navy-mid: #003f73;
  --navy-light: #0056a3;
  --amber: #ffbf00;
  --gain-dark: #16703a;
  --gain-mid: #28a745;
  --loss-dark: #8b1f1f;
  --loss-mid: #c0392b;
  --text-primary: #1d2733;
  --text-muted: #6c757d;
  --border-light: #dee2e6;
  --bg-light: #f7f8fa;
}

/* ═══════════════════════════════════════════════════════════
   COMPONENT CARD
   ═══════════════════════════════════════════════════════════ */

.component-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 15px;
}

.component-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: 24px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.component-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

/* Card Header */
.component-header {
  background: linear-gradient(135deg, var(--navy-mid) 0%, var(--navy-light) 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.component-header.alt-1 {
  background: linear-gradient(135deg, var(--gain-dark) 0%, var(--gain-mid) 100%);
}

.component-header.alt-2 {
  background: linear-gradient(135deg, #2b5096 0%, #4775ea 100%);
}

.component-header.alt-3 {
  background: linear-gradient(135deg, #642900 0%, #884500 100%);
}

.component-header.alt-4 {
  background: linear-gradient(135deg, #d4a000 0%, #ffbf00 100%);
}

.component-header.alt-5 {
  background: linear-gradient(135deg, var(--loss-dark) 0%, var(--loss-mid) 100%);
}

.component-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

.component-title i {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* Card Body */
.component-body {
  padding: 24px 20px;
}

/* ═══════════════════════════════════════════════════════════
   METRICS & SUMMARY CARDS
   ═══════════════════════════════════════════════════════════ */

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 0;
}

.summary-card {
  padding: 16px;
  background: var(--bg-light);
  border-radius: 6px;
  border-left: 4px solid var(--navy-mid);
  text-align: center;
  transition: all 0.2s ease;
}

.summary-card:hover {
  background: #eff3f7;
  transform: translateY(-2px);
}

.summary-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: block;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
  word-break: break-word;
}

.summary-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Color variants */
.summary-card.bullish {
  border-left-color: var(--gain-mid);
  background: rgba(40, 167, 69, 0.05);
}

.summary-card.bearish {
  border-left-color: var(--loss-mid);
  background: rgba(192, 57, 43, 0.05);
}

.summary-card.neutral {
  border-left-color: #6c757d;
  background: #f8f9fa;
}

/* ═══════════════════════════════════════════════════════════
   DETAIL TABLE
   ═══════════════════════════════════════════════════════════ */

.component-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
}

.component-table thead th {
  background: var(--bg-light);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-light);
}

.component-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
}

.component-table tbody tr:hover {
  background-color: var(--bg-light);
}

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

/* Table cell colors */
.positive {
  color: var(--gain-mid);
  font-weight: 600;
}

.negative {
  color: var(--loss-mid);
  font-weight: 600;
}

.neutral {
  color: var(--text-muted);
}

.text-link {
  color: var(--navy-light);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.text-link:hover {
  color: var(--navy-mid);
  border-bottom-color: var(--navy-light);
}

/* ═══════════════════════════════════════════════════════════
   TABS & TOGGLES
   ═══════════════════════════════════════════════════════════ */

.component-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-light);
}

.component-tab-btn {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.component-tab-btn:hover {
  color: var(--navy-mid);
  border-bottom-color: #e0e0e0;
}

.component-tab-btn.active {
  color: var(--navy-light);
  border-bottom-color: var(--navy-light);
}

/* ═══════════════════════════════════════════════════════════
   INFO GRID (for text fields)
   ═══════════════════════════════════════════════════════════ */

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.info-item {
  display: flex;
  flex-direction: column;
}

.info-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.info-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
  word-break: break-word;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   CHART CONTAINER
   ═══════════════════════════════════════════════════════════ */

.component-chart-container {
  position: relative;
  width: 100%;
  height: 300px;
  margin: 20px 0;
}

.component-chart-container canvas {
  max-height: 300px;
}

/* ═══════════════════════════════════════════════════════════
   BADGES & INDICATORS
   ═══════════════════════════════════════════════════════════ */

.indicator-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.indicator-badge.buy {
  background: rgba(40, 167, 69, 0.15);
  color: var(--gain-mid);
}

.indicator-badge.sell {
  background: rgba(192, 57, 43, 0.15);
  color: var(--loss-mid);
}

.indicator-badge.hold {
  background: rgba(255, 191, 0, 0.15);
  color: #d4a000;
}

.indicator-badge.neutral {
  background: rgba(108, 117, 125, 0.15);
  color: #6c757d;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 991px) {
  .summary-cards,
  .info-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
  }

  .component-body {
    padding: 16px 16px;
  }

  .component-header {
    padding: 12px 16px;
  }

  .component-title {
    font-size: 1rem;
  }

  .summary-value {
    font-size: 1.2rem;
  }
}

@media (max-width: 767px) {
  .component-container {
    padding: 0 10px;
  }

  .component-card {
    margin-bottom: 12px;
    border-radius: 6px;
  }

  .component-header {
    padding: 12px 14px;
  }

  .component-title {
    font-size: 0.95rem;
    gap: 8px;
  }

  .component-title i {
    font-size: 1rem;
  }

  .component-body {
    padding: 14px 12px;
  }

  .summary-cards,
  .info-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .summary-card {
    padding: 10px 12px;
  }

  .summary-value {
    font-size: 1.1rem;
  }

  .component-table thead th,
  .component-table tbody td {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .component-chart-container {
    height: 250px;
  }

  .component-tabs {
    gap: 4px;
  }

  .component-tab-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
}

@media (max-width: 479px) {
  .summary-cards,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .component-title {
    font-size: 0.9rem;
  }

  .summary-value {
    font-size: 1rem;
  }

  .info-value {
    font-size: 0.9rem;
  }
}

/* ═══════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════ */

.border-top {
  border-top: 1px solid var(--border-light) !important;
}

.border-bottom {
  border-bottom: 1px solid var(--border-light) !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

.mb-4 {
  margin-bottom: 1.5rem !important;
}

.pt-3 {
  padding-top: 1rem !important;
}

.pb-3 {
  padding-bottom: 1rem !important;
}

/* Print Styles */
@media print {
  .component-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #999;
  }

  .component-header {
    background: #f0f0f0 !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
