/* ============================================================================
 * PAGE STYLES: Rankings Page (css/pages/rankings.css)
 *
 * Content:
 *  1. Heading Typography & Layout Fixes
 *  2. Rankings Table Overrides & Layout
 *  3. Pagination Component Specifics
 * ============================================================================ */

/* --- Heading Typography Overrides --- */
/* Top Header Title (H1 replacement for old H4 size) */
.breadcrumb .header .title h1 {
  font-size: var(--fs-h4, 1.25rem) !important; /* Purana H4 size maintain rakhne ke liye */
  font-weight: 600 !important;
  margin: 0;
  line-height: 1.2;
}

/* Table Card Header (H2 replacement for old H4 size) */
.ranking .table-header-left h2 {
  font-size: var(--fs-h4, 1.125rem) !important; /* Purana H4 size maintain rakhne ke liye */
  font-weight: 600 !important;
  margin: 0;
  line-height: 1.2;
}

/* Keep long ranking labels from changing the trigger height. */
.ranking .custom-select,
.custom-select-trigger,
.ranking-select-box {
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 16px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}

.ranking .custom-select .select-display,
.custom-select-trigger .selected-text,
.ranking-select-box .selected-option {
  min-width: 0;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.ranking .custom-select .select-display {
  width: 100%;
  height: 100%;
  padding: 0 !important;
}

.ranking .custom-select .select-text,
.custom-select-trigger .selected-text,
.ranking-select-box .selected-option {
  max-width: calc(100% - 24px) !important;
}

.ranking .custom-select .toggle-icon {
  flex: 0 0 auto;
}

/* --- Rankings Table Overrides & Layout --- */
.ranking .sps-table-responsive {
  width: 100%;
  overflow-x: auto;
}

.ranking .sps-table {
  min-width: 875px;
  width: 100%;
}

/* Cell Sizing & Typography */
.ranking .sps-table th {
  padding: 1.2rem 1.5rem;
  font-size: var(--fs-body-sm) !important;
}

.ranking .sps-table td {
  padding: 0.95rem 1.5rem;
  font-size: var(--fs-body-sm) !important;
}

/* Specialized Table Elements */
.ranking .sps-table td .chart {
  width: 80px;
  aspect-ratio: 1.2;
}

.ranking .sps-table td .badge {
  min-width: 90px;
  white-space: nowrap;
}

/* Column Alignment Rules */
/* Left-aligned columns: Stock Profile, SPS Score, and Target Price */
.ranking .sps-table th:nth-child(2),
.ranking .sps-table td:nth-child(2),
.ranking .sps-table th:nth-child(3),
.ranking .sps-table td:nth-child(3),
.ranking .sps-table th:nth-child(7),
.ranking .sps-table td:nth-child(7) {
  text-align: left;
}

/* Center-aligned columns: Rank #, Global Ranking, Consensus, Factor Analysis, Actions */
.ranking .sps-table th:nth-child(1),
.ranking .sps-table td:nth-child(1),
.ranking .sps-table th:nth-child(4),
.ranking .sps-table td:nth-child(4),
.ranking .sps-table th:nth-child(5),
.ranking .sps-table td:nth-child(5),
.ranking .sps-table th:nth-child(6),
.ranking .sps-table td:nth-child(6),
.ranking .sps-table th:nth-child(8),
.ranking .sps-table td:nth-child(8) {
  text-align: center;
}

/* --- Pagination Component Specifics --- */
.pagination-wrapper {
  background: var(--theme-bg-500);
}

.watchlist-modal-select {
  --padding: 0.95rem;
  --font-size: 0.75rem;
  --border-radius: 0.4rem;
  width: -webkit-fill-available;
  --text-primary: var(--theme-text-100);
  --surface-bg: var(--theme-color-a5);
  --surface-bg-active: var(--theme-bg-750);
  --menu-bg: var(--theme-bg-650);
  --menu-item-text: var(--theme-text-100);
  --menu-item-hover-bg: var(--theme-bg-600);
  --menu-item-active-bg: var(--theme-bg-500);
}