/* =============================================================
   EarnHub — Custom CSS
   Philosophy: Bootstrap-first. Only add what Bootstrap can't do.
   ============================================================= */

/* --- Design Tokens ------------------------------------------ */
:root {
  --eh-font: 'Open Sans', 'Inter', system-ui, sans-serif;
  --eh-radius: 12px;
  --eh-radius-sm: 8px;
  --eh-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.10);
  --eh-border: 1px solid rgba(0, 0, 0, 0.08);
  --eh-transition: all 0.2s ease;
  --eh-hero-bg: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f4c81 100%);
  --eh-card-hover-translate: -4px;
}

/* --- Global -------------------------------------------------- */
body {
  font-family: var(--eh-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.fw-600 {
  font-weight: 600 !important;
}

.fw-700 {
  font-weight: 700 !important;
}

.fw-800 {
  font-weight: 800 !important;
}

/* --- Links --------------------------------------------------- */
a {
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

/* --- Navbar -------------------------------------------------- */
.navbar.sticky-top {
  z-index: 1040;
}

.navbar-earnhub {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--eh-border);
  transition: var(--eh-transition);
}

/* --- Hero ---------------------------------------------------- */
.eh-hero {
  background: var(--eh-hero-bg);
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.eh-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.eh-hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.10) 0%, transparent 70%);
  pointer-events: none;
}

/* --- App Cards ---------------------------------------------- */
.app-card {
  border: var(--eh-border);
  border-radius: var(--eh-radius);
  transition: var(--eh-transition);
  background: #fff;
  overflow: hidden;
}

.app-card:hover {
  transform: translateY(var(--eh-card-hover-translate));
  box-shadow: var(--eh-shadow-hover);
  border-color: rgba(var(--bs-primary-rgb), 0.25);
}

.app-card .app-card-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--eh-radius-sm);
  object-fit: contain;
  border: var(--eh-border);
  background: #f8f9fa;
  padding: 6px;
  flex-shrink: 0;
}

.app-card .app-card-logo-placeholder {
  width: 56px;
  height: 56px;
  border-radius: var(--eh-radius-sm);
  border: var(--eh-border);
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.5rem;
}

/* --- Star Rating -------------------------------------------- */
.star-rating {
  color: #f59e0b;
  font-size: 0.85rem;
  letter-spacing: -1px;
}

.star-rating-lg {
  font-size: 1.2rem;
}

/* --- Badges ------------------------------------------------- */
.badge-verified {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-featured {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 0.7rem;
  font-weight: 600;
}

/* --- Category Cards ----------------------------------------- */
.category-card {
  border: var(--eh-border);
  border-radius: var(--eh-radius);
  transition: var(--eh-transition);
  text-align: center;
  padding: 1.5rem 1rem;
  background: #fff;
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--eh-shadow-hover);
  border-color: rgba(var(--bs-primary-rgb), 0.3);
  background: rgba(var(--bs-primary-rgb), 0.02);
}

.category-card .category-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
  line-height: 1;
}

/* --- Section Headings --------------------------------------- */
.section-heading {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.section-heading-sm {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* --- Trust Score Bar ---------------------------------------- */
.trust-bar {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg,
      #ef4444 0%,
      #f59e0b 40%,
      #10b981 80%,
      #059669 100%);
}

.trust-bar-track {
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  overflow: hidden;
}

/* --- Platform Badges ---------------------------------------- */
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: var(--eh-border);
  background: #f8fafc;
  color: #475569;
}

/* --- Newsletter Strip --------------------------------------- */
.newsletter-strip {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  padding: 3.5rem 0;
}

/* --- Pros & Cons ------------------------------------------- */
.pros-cons-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.pros-cons-item .icon-pro {
  color: #10b981;
  margin-top: 2px;
  flex-shrink: 0;
}

.pros-cons-item .icon-con {
  color: #ef4444;
  margin-top: 2px;
  flex-shrink: 0;
}

/* --- Compare Table ----------------------------------------- */
.compare-header {
  font-weight: 700;
  font-size: 1rem;
}

/* --- Scroll Snap Carousel ---------------------------------- */
.snap-scroll-x {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.5rem;
}

.snap-scroll-x::-webkit-scrollbar {
  display: none;
}

.snap-scroll-x>* {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* --- Search Bar -------------------------------------------- */
.search-input-group .form-control {
  border-radius: 50px 0 0 50px !important;
  padding-left: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1rem;
}

.search-input-group .form-control::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.search-input-group .form-control:focus {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: none;
  color: #fff;
}

.search-input-group .btn {
  border-radius: 0 50px 50px 0 !important;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
}

/* --- Footer ------------------------------------------------- */
.eh-footer {
  background: #0f172a;
  color: rgba(255, 255, 255, 0.7);
  padding: 3rem 0 1.5rem;
}

.eh-footer a {
  color: rgba(255, 255, 255, 0.6);
  transition: var(--eh-transition);
}

.eh-footer a:hover {
  color: #fff;
}

.eh-footer .footer-brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
}

/* --- App Detail -------------------------------------------- */
.app-logo-lg {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 20px;
  border: var(--eh-border);
  background: #f8fafc;
  padding: 10px;
}

.app-logo-placeholder-lg {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  border: var(--eh-border);
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.screenshot-thumb {
  border-radius: 10px;
  border: var(--eh-border);
  transition: var(--eh-transition);
  cursor: pointer;
}

.screenshot-thumb:hover {
  transform: scale(1.03);
}

/* --- Country Cards ----------------------------------------- */
.country-card {
  border: var(--eh-border);
  border-radius: var(--eh-radius);
  transition: var(--eh-transition);
  background: #fff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.country-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--eh-shadow-hover);
}

.country-flag {
  font-size: 1.75rem;
  line-height: 1;
}

/* --- Blog Cards -------------------------------------------- */
.blog-card {
  border: var(--eh-border);
  border-radius: var(--eh-radius);
  transition: var(--eh-transition);
  overflow: hidden;
  background: #fff;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--eh-shadow-hover);
}

.blog-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.blog-card-title,
.blog-card h2,
.blog-card h3 {
  font-family: 'Open Sans', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* --- Blog Post & Typography -------------------------------- */
.blog-post-title {
  font-family: 'Open Sans', system-ui, -apple-system, sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--bs-heading-color, #0f172a);
  margin-bottom: 1.25rem;
}

.blog-tag-badge {
  display: inline-flex;
  align-items: center;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 50rem;
  background-color: var(--bs-light, #f8f9fa);
  color: var(--bs-secondary-color, #6c757d);
  border: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.125));
  text-decoration: none;
  transition: all 0.15s ease;
}

.blog-tag-badge:hover {
  background-color: var(--bs-secondary-bg, #e9ecef);
  color: var(--bs-body-color, #212529);
  border-color: var(--bs-secondary-color, #6c757d);
}

.blog-body {
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  font-size: 1.1875rem;
  line-height: 1.85;
  color: #262626;
  word-wrap: break-word;
}

.blog-body p {
  margin-bottom: 1.65rem;
}

.blog-body p:last-child {
  margin-bottom: 0;
}

.blog-body h2,
.blog-body h3,
.blog-body h4 {
  font-family: 'Open Sans', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  color: #0f172a;
}

.blog-body h2,
.blog-body h3 {
  font-size: 20px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-top: 2.25rem;
  margin-bottom: 0.85rem;
}

.blog-body h4 {
  font-size: 18px;
  line-height: 1.4;
  color: #334155;
  margin-top: 1.75rem;
  margin-bottom: 0.65rem;
}

.blog-body strong,
.blog-body b {
  font-weight: 600;
  color: #0f172a;
}

.blog-body a {
  color: var(--bs-primary);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(var(--bs-primary-rgb), 0.35);
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.blog-body a:hover {
  color: #0b5ed7;
  text-decoration-color: var(--bs-primary);
}

/* Bullets / Unordered Lists */
.blog-body ul {
  list-style: none;
  padding-left: 0;
  margin-top: 1.25rem;
  margin-bottom: 1.75rem;
}

.blog-body ul>li {
  position: relative;
  padding-left: 1.85rem;
  margin-bottom: 0.85rem;
  line-height: 1.75;
}

.blog-body ul>li:last-child {
  margin-bottom: 0;
}

.blog-body ul>li::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0.78rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #1e293b;
  box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.10);
}

/* Numbered / Ordered Lists */
.blog-body ol {
  list-style: none;
  counter-reset: blog-ol-counter;
  padding-left: 0;
  margin-top: 1.25rem;
  margin-bottom: 1.75rem;
}

.blog-body ol>li {
  counter-increment: blog-ol-counter;
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.75;
}

.blog-body ol>li:last-child {
  margin-bottom: 0;
}

.blog-body ol>li::before {
  content: counter(blog-ol-counter);
  position: absolute;
  left: 0;
  top: 0.2rem;
  width: 1.65rem;
  height: 1.65rem;
  line-height: 1.65rem;
  text-align: center;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: 6px;
  background-color: #f1f5f9;
  color: #1e293b;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Nested lists */
.blog-body ul ul,
.blog-body ol ol,
.blog-body ul ol,
.blog-body ol ul {
  margin-top: 0.65rem;
  margin-bottom: 0.65rem;
  padding-left: 1rem;
}

/* Blockquotes */
.blog-body blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.75rem;
  border-left: 4px solid var(--bs-primary);
  background: #f8fafc;
  border-radius: 0 10px 10px 0;
  color: #334155;
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.7;
}

.blog-body blockquote p:last-child {
  margin-bottom: 0;
}

/* Code & Pre */
.blog-body code {
  font-size: 0.875em;
  padding: 0.2em 0.45em;
  background-color: #f1f5f9;
  border-radius: 6px;
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.blog-body pre {
  margin: 1.75rem 0;
  padding: 1.25rem;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 10px;
  overflow-x: auto;
}

.blog-body pre code {
  background: transparent;
  color: inherit;
  border: none;
  padding: 0;
}

/* Images inside body */
.blog-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 1.75rem 0;
}

.blog-body hr {
  margin: 3rem 0;
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* --- Filters sidebar --------------------------------------- */
.filters-card {
  border: var(--eh-border);
  border-radius: var(--eh-radius);
  background: #fff;
  padding: 1.5rem;
  position: sticky;
  top: 80px;
}

/* --- Pagination -------------------------------------------- */
.pagination .page-link {
  border-radius: 8px;
  margin: 0 2px;
  border: var(--eh-border);
  color: inherit;
  font-size: 0.875rem;
}

.pagination .page-item.active .page-link {
  font-weight: 600;
}

/* --- Responsive adjustments -------------------------------- */
@media (max-width: 768px) {
  .eh-hero {
    padding: 3rem 0 2.5rem;
  }

  .section-heading {
    font-size: 1.4rem;
  }
}

.category-link {
  transition: border-color .15s ease, box-shadow .15s ease;
}

.category-link:hover {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 1px var(--bs-primary);
}

.breadcrumb-item+.breadcrumb-item::before {
  content: "›";
  color: var(--bs-secondary-color);
}

.breadcrumb-item-current {
  max-width: 180px;
}

@media (min-width: 576px) {
  .breadcrumb-item-current {
    max-width: 320px;
  }
}

@media (min-width: 992px) {
  .breadcrumb-item-current {
    max-width: 500px;
  }
}