/* =========================================================
  AI CONSENSUS PAGE STYLES
  ========================================================= */

/*
  CONTENTS
    1. SECTION & BASE TYPOGRAPHY (AI Consensus Section)
    2. BANNER COMPONENT
    3. CARD & SNAPSHOT TABLE STYLES (Right Column)
    4. PROCESS FLOW BAR
    5. RANKING SECTION TOOLBAR (Tabs, Search & Actions)
    6. MAIN RANKING TABLE STYLES
    7. UTILITY & BADGE STYLES
    8. PAGINATION & DISCLAIMER
    9. MEDIA QUERIES (RESPONSIVE)
*/

/* ==========================================================================
   1. SECTION & BASE TYPOGRAPHY (AI Consensus Section)
   ========================================================================== */

.ai-consensus-section {
  padding: 80px 0px;
}

/* Typography for Left Column */
.ai-title {
  font-size: 42px;
  font-weight: 800;
  color: var(--theme-text-100); /* Dark Navy */
  margin-bottom: 12px;
  letter-spacing: -1px;
}

.ai-subtitle {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-blue); /* Bright Blue */
  margin-bottom: 20px;
}

.ai-description {
  font-size: 16px;
  color: var(--theme-text-70); /* Grey text */
  line-height: 1.6;
  max-width: 90%;
  margin: 0;
}


/* ==========================================================================
   2. BANNER COMPONENT
   ========================================================================== */

/* Container styling */
.ai-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 0px;
}

/* Rounded blue icon wrapper */
.banner-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--theme-color-a10); /* Soft blue tint */
  color: #3b5bdb;            /* Deep vibrant blue */
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;            /* Prevents the circle from squishing */
}

/* Icon size adjustment */
.banner-icon svg {
  width: 24px;
  height: 24px;
  --defined-color: var(--theme-color); /* Ensure icon uses the theme's blue color */
}

/* Text alignment & spacing */
.banner-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Typography styles */
.banner-title {
  color: var(--theme-text-100); /* Dark Navy */
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
}

.banner-description {
  color: var(--theme-text-70); /* Grey text */
  font-size: 14px;
  font-weight: 400;
  margin: 0;
  line-height: 1.5;
}


/* ==========================================================================
   3. CARD & SNAPSHOT TABLE STYLES (Right Column)
   ========================================================================== */

/* Card Styling for Right Column */
.ai-card {
  background: var(--theme-bg-450); /* White */
  border: 1px solid var(--theme-text-10); /* Light Grey */
  border-radius: 12px;
  overflow: hidden; /* Keeps the footer neatly inside the rounded corners */
}

.ai-card .sps-table {
  min-width: 467px;
  border-collapse: separate;
  border-spacing: 0;
}

.ai-card .sps-table th,
.ai-card .sps-table td {
  text-align: center;
}

.ai-card .sps-table th:first-child,
.ai-card .sps-table td:first-child {
  text-align: left;
}

.AIConsensusSnapshot {
  min-width: 215px;
}

.table-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--theme-text-100);
  line-height: 1.3;
}

/* AI Brand Headers */
.ai-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ai-brand img { 
  width: 24px;
  height: 24px;
}

.ai-brand span {
  font-size: 10px;
  font-weight: 600;
  color: var(--theme-text-70);
}

.col-consensus, 
.col-agreement {
  font-size: 11px;
  font-weight: 700;
  color: var(--theme-text-100);
}

/* Icon Colors for AI Models */
.icon-openai { color: #374151; font-size: 16px; }
.icon-claude { color: #f97316; font-size: 16px; }
.icon-gemini { color: #6366f1; font-size: 16px; }
.icon-grok   { color: #0f172a; font-size: 14px; line-height: 1; font-weight: 900; }

/* Stock Info (First Column in Rows) */
.ai-table td:first-child {
  text-align: left;
}

.stock-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stock-profile.size {
  --sp-logo-size: clamp(28px, 7cqw, 36px);
  --sp-title-size: clamp(0.70rem, 2.2cqw, 0.80rem);
  --sp-meta-size: clamp(0.55rem, 1.5cqw, 0.62rem);
}

.stock-icon {
  font-size: 20px;
  color: #111827; /* Default Apple dark */
}

.icon-msft  { color: #00a4ef; }
.icon-googl { color: #ea4335; }

.stock-text {
  display: flex;
  flex-direction: column;
}

.stock-text strong {
  font-size: 14px;
  color: var(--theme-text-100);
  font-weight: 700;
}

.stock-text span {
  font-size: 11px;
  color: var(--theme-text-70);
}

/* Scores & Badges */
.ai-table td {
  font-size: 14px;
  color: var(--theme-text-100);
  font-weight: 500;
}

.score-bold {
  font-weight: 800 !important;
  color: var(--theme-text-100) !important;
}

/* Card Footer */
.ai-card-footer {
  padding: 12px 16px;
  font-size: 11px;
  color: var(--theme-text-70);
  border-top: 1px solid var(--theme-text-10);
  background-color: var(--theme-bg-450);
}


/* ==========================================================================
   4. PROCESS FLOW BAR
   ========================================================================== */

.process-flow-card {
  background: var(--theme-bg-450, #ffffff);
  border: 1px solid var(--theme-text-10, #e2e8f0);
  border-radius: 12px;
  padding: 16px 24px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow-x: auto;
  white-space: nowrap;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.brand-container img { 
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--theme-text-10, #e2e8f0);
}

.process-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-blue, #2563eb);
}

.process-step .step-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-blue, #2563eb);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.process-step .step-icon i { 
  color: #fff;
}

.step-divider {
  color: var(--theme-text-70, #94a3b8);
  font-size: 12px;
  margin: 0 16px;
}


/* ==========================================================================
   5. RANKING SECTION TOOLBAR (Tabs, Search & Actions)
   ========================================================================== */

.ranking-section {
  background: var(--theme-bg-450, #ffffff);
  border: 1px solid var(--theme-text-10, #e2e8f0);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 40px;
}

.ranking-header {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--theme-text-10);
}

.ranking-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--theme-text-100, #0f172a);
  margin-bottom: 16px;
}

.ranking-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--theme-text-10, #e2e8f0);
  padding-bottom: 12px;
  flex-wrap: wrap;
  gap: 16px;
}

.ranking-tabs {
  display: flex;
  gap: 24px;
}

.tab-btn {
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--theme-text-70, #64748b);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

.tab-btn.active {
  color: var(--color-blue, #2563eb);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -13px; /* Aligns with the border bottom of toolbar */
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-blue, #2563eb);
}

.ranking-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--theme-text-70, #94a3b8);
  font-size: 14px;
}

.search-input-wrap input {
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--theme-text-10, #e2e8f0);
  border-radius: 6px;
  background: transparent;
  color: var(--theme-text-100, #0f172a);
  font-size: 13px;
  width: 220px;
}

.btn-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--theme-text-10, #e2e8f0);
  border-radius: 6px;
  background: transparent;
  color: var(--theme-text-100, #0f172a);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}


/* ==========================================================================
   6. MAIN RANKING TABLE STYLES
   ========================================================================== */

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px; /* For horizontal scroll on small screens */
}

.ranking-table th, 
.ranking-table td {
  padding: 16px 12px;
  vertical-align: middle;
  text-align: center;
  border-bottom: 1px solid var(--theme-text-10, #f1f5f9);
}

.ranking-table th {
  font-size: 12px;
  font-weight: 700;
  color: var(--theme-text-100, #0f172a);
  white-space: nowrap;
}

.ranking-table td.text-left, 
.ranking-table th.text-left {
  text-align: left;
}

.ranking-table .rank-num {
  font-weight: 600;
  color: var(--theme-text-100, #0f172a);
}

.model-toggle-header,
.model-toggle-cell {
  cursor: pointer;
}

.ranking-table th i.fa-sort {
  color: var(--theme-text-70, #cbd5e1);
  margin-left: 4px;
  font-size: 10px;
  cursor: pointer;
}

/* --- Active AI Model Highlights (Default / OpenAI) --- */

.ranking-table th.is-active-ranking-model,
.ranking-table td.is-active-ranking-model {
  position: relative;
  background: rgba(32, 33, 35, 0.07);
  border-left: 1px solid rgba(16, 163, 127, 0.42);
  border-right: 1px solid rgba(16, 163, 127, 0.42);
}

.ranking-table th.is-active-ranking-model {
  color: #0b8065;
  box-shadow: inset 0 3px 0 #10a37f;
}

.ranking-table th.is-active-ranking-model::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  vertical-align: middle;
  border-radius: 50%;
  background: #10a37f;
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.14), 0 0 10px rgba(16, 163, 127, 0.55);
}

.ranking-table td.is-active-ranking-model {
  color: #087f63;
  font-weight: 700;
}

.ranking-table td.rank-num.active-theme-openai {
  background: rgba(32, 33, 35, 0.1) !important;
  color: #087f63;
  box-shadow: inset 3px 0 0 #10a37f;
}

/* --- Active AI Model Highlights (Gemini Theme) --- */

.ranking-table th.is-active-ranking-model.active-theme-gemini,
.ranking-table td.is-active-ranking-model.active-theme-gemini {
  background: rgba(99, 102, 241, 0.09);
  border-left-color: rgba(99, 102, 241, 0.45);
  border-right-color: rgba(139, 92, 246, 0.45);
}

.ranking-table th.is-active-ranking-model.active-theme-gemini {
  color: #6352d8;
  box-shadow: inset 0 3px 0 #6366f1;
}

.ranking-table th.is-active-ranking-model.active-theme-gemini::after {
  background: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14), 0 0 10px rgba(139, 92, 246, 0.6);
}

.ranking-table td.is-active-ranking-model.active-theme-gemini {
  color: #6352d8;
}

.ranking-table td.rank-num.active-theme-gemini {
  background: rgba(99, 102, 241, 0.12) !important;
  color: #6352d8;
  box-shadow: inset 3px 0 0 #6366f1;
}

/* --- Column Grouping Tint Highlights --- */

.col-group-consensus {
  background-color: var(--theme-color-a5, rgba(59, 91, 219, 0.05)) !important;
  border-left: 1px solid var(--theme-text-10, #e2e8f0);
  border-right: 1px solid var(--theme-text-10, #e2e8f0);
}

.col-group-models {
  background-color: rgba(241, 245, 249, 0.3) !important; /* Subtle grouping background */
}


/* ==========================================================================
   7. UTILITY & BADGE STYLES
   ========================================================================== */

.ai-access-lock {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 28px 20px;
  text-align: center;
  color: var(--theme-text-70-solid, #64748b);
}

.ai-access-lock > .sps-lock-icon {
  color: var(--theme-color, #2563eb);
  font-size: 20px;
}

.ai-access-lock strong {
  color: var(--theme-text-100, #0f172a);
}

.ai-access-lock > span:not(.sps-lock-icon) {
  max-width: 420px;
}

/* Custom Badge & Text Colors */
.badge--warning {
  background-color: #fef3c7;
  color: #d97706;
}

.text-success { 
  color: #16a34a !important; 
  font-weight: 600; 
}

.text-warning { 
  color: #d97706 !important; 
  font-weight: 600; 
}


/* ==========================================================================
   8. PAGINATION & DISCLAIMER
   ========================================================================== */

.table-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  font-size: 13px;
  color: var(--theme-text-70, #64748b);
}

.table-pagination select {
  border: 1px solid var(--theme-text-10, #e2e8f0);
  border-radius: 4px;
  padding: 4px 8px;
  background: transparent;
  color: var(--theme-text-100, #0f172a);
}

.table-pagination .btn-next {
  background: none;
  border: none;
  color: var(--theme-text-100, #0f172a);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ranking-disclaimer {
  font-size: 11px;
  color: var(--theme-text-70, #94a3b8);
  border-top: 1px solid var(--theme-text-10, #e2e8f0);
  padding-top: 16px;
  margin-top: 8px;
  text-align: center;
}

.pagination-wrapper {
  margin-top: 10px;
  background: var(--theme-bg-500);
}

/* ==========================================================================
   9. MEDIA QUERIES (RESPONSIVE)
   ========================================================================== */

@media (max-width: 991px) {
  .ai-title { 
    font-size: 32px; 
  }
  .ai-description { 
    max-width: 100%; 
  }
}

/* ==========================================================================\n+   MOBILE RESPONSIVE FIXES (Max-width: 768px)\n+   ========================================================================== */

@media (max-width: 768px) {
  .process-flow-card {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: stretch;
    padding: 14px;
    margin-bottom: 20px;
    gap: 10px;
    background: var(--theme-bg-450, #ffffff);
    border: 1px solid var(--theme-text-10, #e2e8f0);
    border-radius: 14px;
    overflow-x: visible;
    white-space: normal;
  }

  .process-step {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--theme-bg-200, rgba(37, 99, 235, 0.05));
    border: 1px solid var(--theme-text-10, rgba(226, 232, 240, 0.6));
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--theme-text-100, #0f172a);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    white-space: normal;
  }

  .process-step:nth-child(9) {
    grid-column: span 2;
    justify-content: center;
  }

  .process-step .step-icon {
    width: 24px;
    height: 24px;
    font-size: 10px;
    border-radius: 6px;
    flex-shrink: 0;
  }

  .step-divider,
  .process-step::after {
    display: none !important;
  }

  .ranking-section {
    padding: 16px 12px;
  }

  .ranking-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 16px;
  }

  .ranking-title {
    width: 100%;
    font-size: 18px;
    margin-bottom: 0;
    text-align: left;
    white-space: normal;
    line-height: 1.3;
  }

  .ranking-toolbar,
  .ranking-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
  }

  .search-input-wrap {
    width: 100%;
  }

  .search-input-wrap input {
    width: 100% !important;
    box-sizing: border-box;
  }

  .btn-filter,
  .ranking-actions .button {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }
}