/* Light-mode overrides that still depend on attribute selectors, !important, or one-off rules.
   Most page chrome uses css/theme-variables.css (body.light-mode sets --theme-*). */

/* ---------------------------------------------------
   FIX WHITE-ON-WHITE: Explore, Analysis, Profile, Charts
--------------------------------------------------- */
body.light-mode #ecRoiLabel,
body.light-mode #ecReason,
body.light-mode #ecVerdict,
body.light-mode #exploreConclusionBox select,
body.light-mode .review-meta span {
  color: #1f2937 !important;
}

body.light-mode #exploreConclusionBox select {
  background: #f9fafb !important;
  border-color: #e5e7eb !important;
}

body.light-mode #exploreReviewsSection .review-item p,
body.light-mode #exploreReviewsSection .review-item span {
  color: #111827;
}

body.light-mode #exploreProductName {
  color: #1f2937 !important;
}

body.light-mode #ecRoiVal,
body.light-mode #exploreConclusionBox [style*="color:#ffd700"] {
  color: #b45309 !important;
}

body.light-mode #exploreReviewsSection p[style*="color:#ccc"],
body.light-mode #exploreReviewsSection p[style*="color: #ccc"] {
  color: #111827 !important;
}

body.light-mode #profile,
body.light-mode .profile-panel,
body.light-mode .profile-field-display,
body.light-mode .profile-review-item {
  color: #1f2937;
}

body.light-mode .profile-banner-card {
  background: #fff;
  border-color: #e5e7eb;
}

body.light-mode .profile-field-input {
  background: #f9fafb;
  color: #1f2937;
  border-color: #e5e7eb;
}

body.light-mode .profile-field-label {
  color: #111827;
}

body.light-mode .profile-save-btn {
  color: #fff;
  background: linear-gradient(180deg, var(--theme-accent-muted), var(--theme-accent-primary));
}

body.light-mode .profile-password-btn {
  color: #334155;
  border-color: #cbd5e1;
}

body.light-mode .profile-password-btn:hover {
  background: #f1f5f9;
  border-color: var(--theme-accent-primary);
  color: #0f172a;
}

body.light-mode .profile-password-soon-msg {
  color: #111827;
}

body.light-mode .profile-review-item {
  background: #f9fafb;
  border-color: #e5e7eb;
}

body.light-mode .profile-eng-stat {
  color: #1f2937;
}

body.light-mode .profile-eng-stat-label {
  color: #111827;
}

body.light-mode .p-review-product {
  color: #1f2937;
}

body.light-mode .p-review-rating {
  color: #b45309;
}

body.light-mode .p-review-comment {
  color: #111827;
}

body.light-mode .pinned-market-chip {
  background: #e5e7eb;
  color: #1f2937;
  border-color: #d1d5db;
}

body.light-mode .pinned-market-chip:hover {
  background: #d1d5db;
}

/* Profile cover themes: main-stack panels use dark gradients; undo light-mode grays there */
body.light-mode
  #profileContent[data-profile-cover]:not([data-profile-cover="default"])
  .profile-main-stack
  .profile-panel {
  color: rgba(255, 255, 255, 0.92);
}

body.light-mode
  #profileContent[data-profile-cover]:not([data-profile-cover="default"])
  .profile-main-stack
  .profile-review-item {
  background: rgba(0, 0, 0, 0.26);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
}

body.light-mode
  #profileContent[data-profile-cover]:not([data-profile-cover="default"])
  .profile-main-stack
  .profile-eng-stat,
body.light-mode
  #profileContent[data-profile-cover]:not([data-profile-cover="default"])
  .profile-main-stack
  .profile-eng-stat-label {
  color: rgba(255, 255, 255, 0.88);
}

body.light-mode
  #profileContent[data-profile-cover]:not([data-profile-cover="default"])
  .profile-main-stack
  .profile-eng-stat
  i {
  color: rgba(255, 255, 255, 0.72);
}

body.light-mode
  #profileContent[data-profile-cover]:not([data-profile-cover="default"])
  .profile-main-stack
  .p-review-product {
  color: rgba(255, 255, 255, 0.95);
}

body.light-mode
  #profileContent[data-profile-cover]:not([data-profile-cover="default"])
  .profile-main-stack
  .p-review-meta {
  color: rgba(255, 255, 255, 0.65);
}

body.light-mode
  #profileContent[data-profile-cover]:not([data-profile-cover="default"])
  .profile-main-stack
  .p-review-comment {
  color: rgba(255, 255, 255, 0.82);
}

body.light-mode
  #profileContent[data-profile-cover]:not([data-profile-cover="default"])
  .profile-main-stack
  .p-review-rating {
  color: #fcd34d;
}

body.light-mode
  #profileContent[data-profile-cover]:not([data-profile-cover="default"])
  .profile-main-stack
  .pinned-market-chip {
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.2);
}

body.light-mode
  #profileContent[data-profile-cover]:not([data-profile-cover="default"])
  .profile-main-stack
  .pinned-market-chip:hover {
  background: rgba(0, 0, 0, 0.34);
  border-color: rgba(255, 255, 255, 0.28);
}

/* Change indicators in tables/cards */
body.light-mode .change.up,
body.light-mode .metric-value-cell .change.up {
  color: var(--theme-success) !important;
}

body.light-mode .change.down,
body.light-mode .metric-value-cell .change.down {
  color: var(--theme-danger) !important;
}

/* Data quality panel (header layout) */
body.light-mode .data-quality-panel {
  background: rgba(0, 0, 0, 0.04);
  border-color: #e5e7eb;
}

body.light-mode .data-quality-panel-header {
  color: #111827;
  background: rgba(0, 0, 0, 0.02);
  border-bottom-color: #e5e7eb;
}

body.light-mode .data-quality-header-range {
  color: #111827;
}

body.light-mode .trends-chart-data-quality .data-quality-panel {
  background: transparent !important;
  border: none !important;
}

body.light-mode .trends-chart-data-quality .data-quality-panel-header {
  background: transparent !important;
  border-bottom: none !important;
  border-right-color: var(--theme-trends-chart-header-border);
}

body.light-mode .data-quality-row:not(:last-child) {
  border-bottom-color: #e5e7eb;
}

body.light-mode .data-quality-label {
  color: #111827;
}

body.light-mode .data-quality-value.fallback { color: #b45309; }
body.light-mode .data-quality-value.confidence-high { color: var(--theme-success); }
body.light-mode .data-quality-value.confidence-mid { color: #b45309; }
body.light-mode .data-quality-value.confidence-low { color: var(--theme-danger); }
body.light-mode .data-quality-value.context { color: var(--theme-accent-primary); }
body.light-mode .data-quality-value.sector { color: #6366f1; }
body.light-mode .data-quality-value.quantity { color: #111827; }

/* Auth modal */
body.light-mode #authModal .modal-content {
  background: #fff;
}

body.light-mode #authModal .modal-body input {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #1f2937;
}

body.light-mode .spinner {
  border-color: rgba(0, 0, 0, 0.1);
  border-left-color: var(--theme-accent-primary);
}

body.light-mode .trends-chart-legend .legend-text {
  color: #1f2937 !important;
}

body.light-mode .trends-legend-item {
  color: #1f2937;
}

/* Hot Markets (actual class is .hot-markets-table; legacy .home-market-feed-table never applied) */
body.light-mode .home-market-feed-table,
body.light-mode .hot-markets-table {
  background: #fff;
}

body.light-mode .home-market-feed-table th,
body.light-mode .home-market-feed-table td,
body.light-mode .hot-markets-table th,
body.light-mode .hot-markets-table td {
  border-color: #e5e7eb;
  color: #111827;
}

body.light-mode .home-market-feed-table th,
body.light-mode .hot-markets-table th {
  background: #f9fafb;
  color: #111827;
}

body.light-mode .hot-markets-table th.sortable:hover {
  color: var(--theme-accent-primary);
}

body.light-mode .hot-markets-table tr.market-row:hover {
  background-color: #f9fafb;
}

body.light-mode #home .dashboard-section h2,
body.light-mode #homeMarketHeader h2 {
  color: #111827;
  text-shadow: none;
}

body.light-mode .trend-header-home {
  border-bottom-color: #e5e7eb;
}

body.light-mode .market-name {
  color: #111827;
}

body.light-mode .hot-markets-table td.col-price,
body.light-mode .hot-markets-table .col-price {
  color: #111827;
}

body.light-mode .hot-markets-table td.col-sellthrough,
body.light-mode .hot-markets-table .col-sellthrough {
  color: #111827;
}

body.light-mode .hot-markets-table td.col-volume,
body.light-mode .hot-markets-table .col-volume {
  color: #111827;
}

body.light-mode .hot-markets-table td.col-change-1m.positive {
  color: var(--theme-success);
}

body.light-mode .hot-markets-table td.col-change-1m.negative {
  color: var(--theme-danger);
}

body.light-mode .custom-dropdown-btn {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #1f2937;
}

body.light-mode .custom-dropdown-list {
  background: #fff;
  border-color: #e5e7eb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.light-mode .custom-dropdown-list .filter-option {
  color: #1f2937;
}

body.light-mode .custom-dropdown-list .filter-option:hover {
  background: #f9fafb;
}

/* Pin icon outline: dark grey → readable on light backgrounds */
body.light-mode .pin-icon.outline,
body.light-mode .pin-icon.outline i {
  color: #111827 !important;
}

/* Trends comparison table: JS-injected metric row (trends.js #trends-dynamic-styles) */
body.light-mode .metric-card:hover {
  background: rgba(0, 0, 0, 0.04) !important;
}

body.light-mode .metric-card .metric-details {
  border-top-color: #e5e7eb !important;
}
