/* ═══════════════════════════════════════════════════════
   RewardTalks Component Styles
   ═══════════════════════════════════════════════════════ */

/* ── Container ── */
.container { width: 100%; max-width: var(--container-xl); margin: 0 auto; padding: 0 var(--space-6); }
.container-lg { max-width: var(--container-2xl); }
.container-sm { max-width: var(--container-lg); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 10px 20px; font-size: var(--text-base); font-weight: 600; line-height: 1.4;
  border-radius: var(--radius-md); transition: all var(--transition-fast);
  white-space: nowrap; cursor: pointer; position: relative; overflow: hidden;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brand-500); color: white; }
.btn-primary:hover { background: var(--brand-600); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border-primary); }
.btn-secondary:hover { background: var(--bg-secondary); border-color: var(--border-secondary); }
.btn-gold { background: linear-gradient(135deg, var(--gold-300), var(--gold-400)); color: var(--gray-900); }
.btn-gold:hover { background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); box-shadow: 0 4px 12px rgba(212,168,83,0.3); }
.btn-ghost { color: var(--text-brand); padding: 10px 16px; }
.btn-ghost:hover { background: var(--bg-brand-subtle); }
.btn-danger { background: var(--red-500); color: white; }
.btn-danger:hover { background: #B91C1C; }
.btn-sm { padding: 6px 14px; font-size: var(--text-sm); }
.btn-lg { padding: 14px 28px; font-size: var(--text-md); }
.btn-icon { padding: 8px; border-radius: var(--radius-md); }
.btn-icon:hover { background: var(--bg-tertiary); }
.btn-apply {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: white; font-weight: 700; padding: 12px 24px; border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0,48,135,0.25);
}
.btn-apply:hover { box-shadow: 0 4px 16px rgba(0,48,135,0.35); transform: translateY(-1px); }

/* ── Cards ── */
.card {
  background: var(--bg-primary); border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl); padding: var(--space-6);
  transition: all var(--transition-base);
}
.card-hover:hover { border-color: var(--border-brand); box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.card-featured { border-color: var(--gold-300); background: linear-gradient(to bottom, var(--bg-gold-subtle), var(--bg-primary)); }
.card-compact { padding: var(--space-4); border-radius: var(--radius-lg); }

/* ── Credit Card Tile ── */
.cc-tile {
  background: var(--bg-primary); border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl); padding: var(--space-6); display: flex;
  gap: var(--space-6); transition: all var(--transition-base); position: relative;
}
.cc-tile:hover { border-color: var(--border-brand); box-shadow: var(--shadow-card-hover); }
.cc-tile-img { width: 200px; flex-shrink: 0; display: flex; align-items: flex-start; justify-content: center; }
.cc-tile-img img { width: 100%; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.cc-tile-body { flex: 1; min-width: 0; }
.cc-tile-issuer { font-size: var(--text-sm); color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin-bottom: var(--space-1); }
.cc-tile-name { font-size: var(--text-xl); font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-2); }
.cc-tile-bonus { font-size: var(--text-base); color: var(--brand-500); font-weight: 600; margin-bottom: var(--space-3); }
.cc-tile-meta { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4); }
.cc-tile-meta-item { font-size: var(--text-sm); color: var(--text-secondary); }
.cc-tile-meta-item strong { color: var(--text-primary); font-weight: 600; }
.cc-tile-actions { display: flex; gap: var(--space-3); align-items: center; }
.cc-tile-rating { display: flex; align-items: center; gap: var(--space-1); }
.cc-tile-rating .stars { color: var(--gold-400); font-size: var(--text-lg); }
.cc-tile-rating .score { font-weight: 700; color: var(--text-primary); }
.cc-tile-badge { position: absolute; top: var(--space-4); right: var(--space-4); }

@media (max-width: 768px) {
  .cc-tile { flex-direction: column; }
  .cc-tile-img { width: 140px; margin: 0 auto; }
}

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; font-size: var(--text-xs); font-weight: 600;
  border-radius: var(--radius-full); letter-spacing: 0.02em;
}
.badge-primary { background: var(--bg-brand-subtle); color: var(--brand-500); }
.badge-gold { background: var(--bg-gold-subtle); color: var(--gold-500); }
.badge-green { background: var(--green-50); color: var(--green-500); }
.badge-red { background: var(--red-100); color: var(--red-500); }
.badge-orange { background: var(--orange-100); color: var(--orange-500); }
.badge-neutral { background: var(--bg-tertiary); color: var(--text-secondary); }
.badge-live { background: #22C55E; color: white; animation: pulse-badge 2s infinite; }
.badge-dead { background: var(--gray-400); color: white; text-decoration: line-through; }

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ── Pills / Tags ── */
.pill {
  display: inline-flex; align-items: center; padding: 6px 14px;
  font-size: var(--text-sm); font-weight: 500; border-radius: var(--radius-full);
  border: 1px solid var(--border-primary); color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition-fast);
  background: var(--bg-primary);
}
.pill:hover { border-color: var(--brand-400); color: var(--text-brand); }
.pill.active { background: var(--brand-500); color: white; border-color: var(--brand-500); }

/* ── Rating Stars ── */
.rating { display: flex; align-items: center; gap: var(--space-1); }
.rating-stars { display: flex; gap: 2px; }
.rating-star { width: 16px; height: 16px; fill: var(--gray-300); }
.rating-star.filled { fill: var(--gold-400); }
.rating-star.half { fill: url(#star-gradient); }
.rating-value { font-size: var(--text-base); font-weight: 700; color: var(--text-primary); margin-left: var(--space-1); }
.rating-count { font-size: var(--text-sm); color: var(--text-tertiary); }

/* ── Filter Panel ── */
.filter-panel {
  background: var(--bg-primary); border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl); padding: var(--space-6); width: var(--sidebar-width);
  flex-shrink: 0; position: sticky; top: calc(var(--header-height) + var(--space-4));
  max-height: calc(100vh - var(--header-height) - var(--space-8));
  overflow-y: auto;
}
.filter-section { margin-bottom: var(--space-6); }
.filter-section:last-child { margin-bottom: 0; }
.filter-section-title {
  font-size: var(--text-base); font-weight: 700; color: var(--text-primary);
  margin-bottom: var(--space-3); display: flex; align-items: center; justify-content: space-between;
}
.filter-checkbox { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-1) 0; cursor: pointer; }
.filter-checkbox input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--brand-500); border-radius: 4px; cursor: pointer;
}
.filter-checkbox label { font-size: var(--text-sm); color: var(--text-secondary); cursor: pointer; }
.filter-checkbox:hover label { color: var(--text-primary); }
.filter-count { font-size: var(--text-xs); color: var(--text-tertiary); margin-left: auto; }
.filter-range { margin-top: var(--space-2); }
.filter-range input[type="range"] { width: 100%; accent-color: var(--brand-500); }
.filter-range-labels { display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--text-tertiary); margin-top: var(--space-1); }
.filter-reset { font-size: var(--text-sm); color: var(--text-brand); cursor: pointer; font-weight: 500; }
.filter-reset:hover { text-decoration: underline; }

@media (max-width: 1024px) {
  .filter-panel { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; max-height: 100vh; border-radius: 0; z-index: 1000; padding: var(--space-8) var(--space-6); }
  .filter-panel.open { display: block; }
}

/* ── Tabs ── */
.tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--border-primary);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: var(--space-3) var(--space-5); font-size: var(--text-base); font-weight: 500;
  color: var(--text-tertiary); white-space: nowrap; border-bottom: 2px solid transparent;
  margin-bottom: -2px; cursor: pointer; transition: all var(--transition-fast);
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--brand-500); border-bottom-color: var(--brand-500); font-weight: 600; }

/* ── Deal Tile ── */
.deal-tile {
  background: var(--bg-primary); border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl); padding: var(--space-5); transition: all var(--transition-base);
}
.deal-tile:hover { border-color: var(--border-brand); box-shadow: var(--shadow-md); }
.deal-tile-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--space-3); }
.deal-tile-title { font-size: var(--text-md); font-weight: 700; color: var(--text-primary); }
.deal-tile-desc { font-size: var(--text-base); color: var(--text-secondary); margin-bottom: var(--space-3); line-height: 1.5; }
.deal-tile-meta { display: flex; gap: var(--space-3); font-size: var(--text-sm); color: var(--text-tertiary); flex-wrap: wrap; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-primary); }
.table { width: 100%; }
.table th {
  text-align: left; padding: var(--space-3) var(--space-4); font-size: var(--text-sm);
  font-weight: 600; color: var(--text-secondary); background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary); white-space: nowrap;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.table td {
  padding: var(--space-3) var(--space-4); font-size: var(--text-base);
  color: var(--text-primary); border-bottom: 1px solid var(--border-primary);
  vertical-align: top;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-secondary); }

/* ── Compare Table ── */
.compare-table { width: 100%; }
.compare-table th { position: sticky; top: var(--header-height); z-index: 10; background: var(--bg-primary); padding: var(--space-4); text-align: center; border-bottom: 2px solid var(--border-primary); }
.compare-table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-primary); text-align: center; font-size: var(--text-base); }
.compare-table .feature-label { text-align: left; font-weight: 600; color: var(--text-primary); background: var(--bg-secondary); }
.compare-highlight { background: var(--bg-brand-subtle); font-weight: 600; color: var(--brand-500); }

/* ── Forum Thread ── */
.thread-card {
  display: flex; gap: var(--space-4); padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-primary); transition: background var(--transition-fast);
}
.thread-card:hover { background: var(--bg-secondary); }
.thread-avatar { width: 40px; height: 40px; border-radius: var(--radius-full); flex-shrink: 0; background: var(--bg-tertiary); }
.thread-body { flex: 1; min-width: 0; }
.thread-title { font-size: var(--text-md); font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-1); }
.thread-title:hover { color: var(--text-brand); }
.thread-meta { font-size: var(--text-sm); color: var(--text-tertiary); display: flex; gap: var(--space-3); flex-wrap: wrap; }
.thread-stats { display: flex; gap: var(--space-4); margin-left: auto; text-align: center; flex-shrink: 0; }
.thread-stat { font-size: var(--text-sm); color: var(--text-tertiary); }
.thread-stat-value { display: block; font-size: var(--text-md); font-weight: 700; color: var(--text-primary); }

/* ── Blog Article Card ── */
.article-card {
  background: var(--bg-primary); border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl); overflow: hidden; transition: all var(--transition-base);
}
.article-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.article-card-img { width: 100%; height: 200px; background: var(--bg-tertiary); object-fit: cover; }
.article-card-body { padding: var(--space-5); }
.article-card-cat { font-size: var(--text-xs); font-weight: 600; color: var(--brand-500); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--space-2); }
.article-card-title { font-size: var(--text-lg); font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-2); line-height: 1.3; }
.article-card-excerpt { font-size: var(--text-base); color: var(--text-secondary); line-height: 1.6; margin-bottom: var(--space-3); }
.article-card-footer { display: flex; justify-content: space-between; align-items: center; font-size: var(--text-sm); color: var(--text-tertiary); }

/* ── Disclosure Bar ── */
.disclosure-bar {
  background: var(--bg-secondary); border: 1px solid var(--border-primary);
  border-radius: var(--radius-md); padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm); color: var(--text-tertiary); line-height: 1.5;
}
.disclosure-bar a { color: var(--text-brand); text-decoration: underline; }

/* ── Hero Section ── */
.hero {
  padding: var(--space-20) 0 var(--space-16);
  position: relative; overflow: hidden;
}
.hero-gradient {
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-700) 50%, var(--brand-900) 100%);
  color: white;
}
.hero-gradient h1, .hero-gradient h2, .hero-gradient p { color: white; }
.hero-gradient p { opacity: 0.85; }
.hero-pattern::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 25% 25%, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 32px 32px; pointer-events: none;
}

/* ── Section Divider ── */
.section { padding: var(--space-16) 0; }
.section-header { margin-bottom: var(--space-8); }
.section-title { font-size: var(--text-2xl); font-weight: 800; color: var(--text-primary); margin-bottom: var(--space-2); }
.section-subtitle { font-size: var(--text-md); color: var(--text-secondary); max-width: 600px; }
.section-header-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: var(--space-8); }

/* ── Breadcrumbs ── */
.breadcrumbs { display: flex; gap: var(--space-2); align-items: center; font-size: var(--text-sm); color: var(--text-tertiary); padding: var(--space-4) 0; }
.breadcrumbs a { color: var(--text-brand); }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { opacity: 0.4; }

/* ── Search ── */
.search-input-wrap {
  position: relative; max-width: 480px; width: 100%;
}
.search-input {
  width: 100%; padding: 12px 16px 12px 44px; font-size: var(--text-md);
  background: var(--bg-primary); border: 2px solid var(--border-primary);
  border-radius: var(--radius-lg); outline: none; color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.search-input:focus { border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(0,48,135,0.1); }
.search-input::placeholder { color: var(--text-tertiary); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); pointer-events: none; }

/* ── Newsletter CTA ── */
.newsletter-cta {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  border-radius: var(--radius-2xl); padding: var(--space-12) var(--space-8);
  text-align: center; color: white; position: relative; overflow: hidden;
}
.newsletter-cta::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.newsletter-cta h3 { font-size: var(--text-2xl); color: white; margin-bottom: var(--space-2); }
.newsletter-cta p { opacity: 0.8; margin-bottom: var(--space-6); color: white; }
.newsletter-form { display: flex; gap: var(--space-3); max-width: 440px; margin: 0 auto; }
.newsletter-form input { flex: 1; padding: 12px 16px; border-radius: var(--radius-md); border: 2px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.1); color: white; font-size: var(--text-md); }
.newsletter-form input::placeholder { color: rgba(255,255,255,0.6); }
.newsletter-form input:focus { outline: none; border-color: rgba(255,255,255,0.5); }
.newsletter-form button { background: white; color: var(--brand-700); font-weight: 700; padding: 12px 24px; border-radius: var(--radius-md); white-space: nowrap; }

/* ── Trust Bar ── */
.trust-bar { display: flex; gap: var(--space-8); align-items: center; justify-content: center; flex-wrap: wrap; padding: var(--space-6) 0; }
.trust-item { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-base); color: var(--text-secondary); }
.trust-number { font-size: var(--text-xl); font-weight: 800; color: var(--text-primary); }

/* ── Skeleton Loading ── */
.skeleton { background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%); background-size: 200% 100%; animation: skeleton-shimmer 1.5s infinite; border-radius: var(--radius-md); }
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 16px; width: 80%; margin-bottom: var(--space-2); }
.skeleton-title { height: 24px; width: 60%; margin-bottom: var(--space-3); }
.skeleton-card { height: 200px; }

/* ── Modal/Dialog ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: var(--space-6); backdrop-filter: blur(4px); }
.modal { background: var(--bg-primary); border-radius: var(--radius-2xl); max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; padding: var(--space-8); box-shadow: var(--shadow-xl); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-6); }
.modal-title { font-size: var(--text-xl); font-weight: 700; }

/* ── Tooltip ── */
.tooltip { position: relative; }
.tooltip-text {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  padding: 6px 12px; background: var(--gray-900); color: white; font-size: var(--text-xs);
  border-radius: var(--radius-sm); white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity var(--transition-fast);
}
.tooltip:hover .tooltip-text { opacity: 1; }
