/* =========================================================
   Best AI Tool — Custom Styles (supplements Tailwind CDN)
   Deep Navy + Metallic Silver Theme — Single unified mode
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Exo+2:ital,wght@0,100..900;1,100..900&display=swap');

/* ── Theme Variables ──────────────────────────────────────── */
:root {
  --navy-950:  #0A0A0B;
  --navy-900:  #272729;
  --navy-800:  #303033;
  --navy-700:  #3A3A3E;
  --navy-600:  #3F3F46;
  --navy-500:  #52525B;
  --navy-border: rgba(161, 161, 170, 0.18);
  --metallic-1: #52525B;
  --metallic-2: #71717A;
  --metallic-3: #A1A1AA;
  --metallic-4: #D4D4D8;
  --metallic-5: #E4E4E7;
  --silver-text: #A1A1AA;
  --platinum:    #E4E4E7;
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background-color: var(--navy-900);
}

body, * {
  font-family: 'Exo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Global theme override — force charcoal dark on every page ── */
body {
  background-color: var(--navy-900) !important;
  color: #C0C0C8 !important;
}

/* Page background alternating sections */
.bg-slate-50,
.bg-white,
.bg-gray-50 {
  background-color: var(--navy-900) !important;
}

section.bg-white,
.bg-white.border-b {
  background-color: var(--navy-800) !important;
}

/* Text overrides */
.text-slate-900,
.text-gray-900 { color: var(--platinum) !important; }
.text-slate-800 { color: #D4D4D8 !important; }
.text-slate-700 { color: #C0C0C8 !important; }
.text-slate-600 { color: #A8A8B0 !important; }
.text-slate-500 { color: #909099 !important; }
.text-slate-400 { color: #808089 !important; }
.text-white     { color: #E4E4E7 !important; }

/* Border overrides */
.border-slate-200 { border-color: var(--navy-border) !important; }

/* Navbar — semi-transparent dark */
#navbar,
.bg-white\/90 { background-color: rgba(17, 17, 19, 0.96) !important; }

/* Sticky filter/category bars */
.bg-white\/95,
.bg-slate-100\/95 { background-color: rgba(26, 5, 5, 0.97) !important; }

/* ── Hide dark mode toggle (single theme) ─────────────────── */
/* ── Active Nav Link ─────────────────────────────────── */
#navbar a.nav-active {
  color: var(--platinum) !important;
  font-weight: 700 !important;
  position: relative;
}

#navbar .hidden.md\:flex a.nav-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--metallic-3);
  border-radius: 2px;
}

/* Mobile menu active */
#navbar #mobile-menu a.nav-active {
  background: rgba(161, 161, 170, 0.15) !important;
  color: var(--platinum) !important;
  font-weight: 700 !important;
}
/* ── Gradient Text ────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--metallic-3) 0%, var(--metallic-5) 45%, var(--metallic-3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-warm {
  background: linear-gradient(135deg, #C8A84A 0%, #E8D080 50%, #C8A84A 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Gradient Backgrounds — Metallic Steel ────────────────── */
.gradient-bg {
  background: linear-gradient(135deg, var(--metallic-1) 0%, var(--metallic-2) 45%, var(--metallic-3) 100%);
}

.hero-gradient {
  background: radial-gradient(ellipse at 60% 0%, rgba(113, 113, 122, 0.18) 0%, transparent 60%),
              radial-gradient(ellipse at 10% 80%, rgba(82, 82, 91, 0.13) 0%, transparent 60%);
}

/* ── Card Styles ──────────────────────────────────────────── */
.card {
  background: var(--navy-800);
  border: 1px solid var(--navy-border);
  border-radius: 16px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(161, 161, 170, 0.22);
  border-color: rgba(161, 161, 170, 0.30);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--metallic-1) 0%, var(--metallic-2) 60%, var(--metallic-3) 100%);
  color: #ffffff;
  font-weight: 700;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--metallic-3);
  font-weight: 600;
  border-radius: 10px;
  border: 2px solid var(--metallic-2);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-outline:hover {
  background: var(--metallic-1);
  color: #fff;
  border-color: var(--metallic-1);
}

/* ── Badge ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-blue   { background: rgba(82, 82, 91, 0.30);  color: #D4D4D8; border: 1px solid rgba(161, 161, 170, 0.25); }
.badge-purple { background: rgba(82, 82, 91, 0.25);  color: #D4D4D8; border: 1px solid rgba(161, 161, 170, 0.25); }
.badge-green  { background: rgba(30, 120, 80, 0.25);  color: #7ADAB8; border: 1px solid rgba(50, 160, 110, 0.3); }
.badge-orange { background: rgba(160, 100, 30, 0.25); color: #E8C070; border: 1px solid rgba(200, 140, 50, 0.3); }
.badge-pink   { background: rgba(140, 60, 100, 0.25); color: #E8A0C0; border: 1px solid rgba(180, 90, 140, 0.3); }

/* ── Editor Score Badge ──────────────────────────────────── */
.editor-score-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--navy-800);
  border: 1px solid var(--navy-600);
  border-radius: 14px;
  padding: 0.6rem 1rem;
  min-width: 72px;
}
.editor-score-card .score-num {
  font-size: 1.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #A1A1AA, #E4E4E7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.editor-score-card .score-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--metallic-3);
  margin-top: 2px;
}
.score-bar-wrap { width: 100%; background: var(--navy-700); border-radius: 99px; height: 5px; overflow: hidden; }
.score-bar      { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #52525B, #A1A1AA); }

/* ── Pricing Tag ──────────────────────────────────────────── */
.price-free { color: #5DCFAA; font-weight: 700; }
.price-paid { color: var(--metallic-3); font-weight: 700; }

/* ── Rating Stars ─────────────────────────────────────────── */
.stars { color: #D4B040; letter-spacing: 2px; }

/* ── Pros / Cons lists ────────────────────────────────────── */
.pros-list li::before { content: "✓ "; color: #5DCFAA; font-weight: 700; }
.cons-list li::before { content: "✗ "; color: #E07070; font-weight: 700; }
.pros-list li, .cons-list li { padding: 0.2rem 0; }

/* ── Comparison Table ─────────────────────────────────────── */
.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
}

.comparison-table th {
  background: linear-gradient(135deg, var(--metallic-1), var(--metallic-2));
  color: var(--platinum);
  padding: 1rem;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.comparison-table td {
  padding: 0.875rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--navy-border);
  color: #A1A1AA;
  background: var(--navy-800);
}

.comparison-table tr:nth-child(even) td { background: var(--navy-700); }

.comparison-table .check { color: #5DCFAA; font-size: 1.1rem; }
.comparison-table .cross { color: #E07070; font-size: 1.1rem; }

/* ── Newsletter Input ─────────────────────────────────────── */
.newsletter-input {
  background: rgba(15,15,18,0.50);
  border: 1px solid rgba(200, 200, 210, 0.35);
  color: var(--platinum);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s;
  text-align: center;
}

.newsletter-input::placeholder { color: rgba(200, 200, 210, 0.80); }
.newsletter-input:focus::placeholder { color: transparent; }
.newsletter-input:focus { border-color: var(--metallic-3); }

/* Input placeholder visibility across all pages */
input::placeholder,
textarea::placeholder {
  color: #909099 !important;
  opacity: 1 !important;
}
.active-filter {
  background: linear-gradient(135deg, var(--metallic-1), var(--metallic-2)) !important;
  color: #fff !important;
  border-color: transparent !important;
}

/* ── Comparison Page — Sticky Nav Active Link ─────────────── */
.comp-nav-active {
  background: linear-gradient(135deg, var(--metallic-1) 0%, var(--metallic-3) 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
  transform: translateY(-1px);
}

/* ── Custom Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--navy-950); }
::-webkit-scrollbar-thumb { background: var(--navy-500); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--metallic-2); }

/* ── Scroll Animations ────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* ── Loading skeleton ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--navy-800) 25%, var(--navy-700) 50%, var(--navy-800) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ── Hero blob decoration ─────────────────────────────────── */
.blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(80px);
  opacity: 0.25;
  pointer-events: none;
}

.blob-blue   { background: var(--metallic-2); }
.blob-purple { background: var(--metallic-1); }

/* ── Sticky Nav shadow on scroll ─────────────────────────── */
.nav-scrolled {
  box-shadow: 0 2px 28px rgba(0, 0, 0, 0.6), 0 1px 0 var(--navy-border);
}

/* ── Footer text visibility ───────────────────────────────── */
footer {
  background-color: #0A0A0C !important;
}

footer,
footer * {
  -webkit-text-fill-color: unset !important;
}

footer .text-slate-400,
footer .text-slate-500 {
  color: #9CA3AF !important;
}

footer a {
  color: #9CA3AF !important;
}

footer a:hover {
  color: #F3F4F6 !important;
}

footer p,
footer span:not(.gradient-text) {
  color: #9CA3AF !important;
}

footer .font-bold {
  color: #F3F4F6 !important;
}

/* ── Article prose adjustments ───────────────────────────── */
.prose-article h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--platinum);
}

.prose-article h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  color: #D4D4D8;
}

.prose-article p {
  margin-bottom: 1.25rem;
  line-height: 1.75;
  color: #71717A;
}

.prose-article ul, .prose-article ol {
  margin: 1rem 0 1.25rem 1.5rem;
  color: #71717A;
}

.prose-article li { margin-bottom: 0.4rem; line-height: 1.7; }

.prose-article ul li { list-style-type: disc; }
.prose-article ol li { list-style-type: decimal; }

.prose-article strong { color: var(--platinum); }

.prose-article a {
  color: var(--metallic-3);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose-article a:hover { color: var(--metallic-5); }

.prose-article blockquote {
  border-left: 4px solid var(--metallic-2);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(82, 82, 91, 0.18);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--silver-text);
}

/* ── Metallic shimmer highlight ────────────────────────────────────────── */
#cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: min(90vw, 500px);
  background: #18181B;
  color: #D4D4D8;
  padding: 1rem 1.5rem;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
}
#cookie-banner.is-visible {
  display: flex;
}

/* ── Responsive video embed ───────────────────────────────── */
.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
}

.video-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

/* ── Scroll To Top Button ────────────────────────────────── */
#scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--metallic-1) 0%, var(--metallic-3) 100%);
  border: 1px solid rgba(200, 200, 210, 0.25);
  color: #E4E4E7;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, background 0.2s ease;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.45);
}

#scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#scroll-to-top:hover {
  background: linear-gradient(135deg, var(--metallic-2) 0%, var(--metallic-4) 100%);
  box-shadow: 0 6px 20px rgba(0,0,0,0.55);
}

/* ── Print styles ─────────────────────────────────────────── */
@media print {
  nav, footer, #cookie-banner, .newsletter-section { display: none !important; }
  .prose-article { max-width: 100% !important; }
}

/* ═══════════════════════════════════════════════════════════
   Mobile Responsiveness Enhancements
   ══════════════════════════════════════════════════════════ */

/* ── Base mobile fixes ──────────────────────────────────── */
body { overflow-x: hidden; }

img { max-width: 100%; height: auto; }

h1, h2, h3 {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ── Smooth horizontal scrolling on touch ───────────────── */
.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* ── Mobile menu: scrollable if content is tall ─────────── */
#mobile-menu {
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

/* ── Min 44px touch targets for interactive elements ──────── */
.btn-primary,
.btn-outline,
a.btn-primary,
a.btn-outline,
.category-filter-btn,
.answer-btn,
.choice-btn {
  min-height: 44px;
}

/* ── Touch devices: replace hover with active state ───────── */
@media (hover: none) {
  .card:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: var(--navy-border) !important;
  }
  .card:active {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
    border-color: rgba(161, 161, 170, 0.30) !important;
    transition: transform 0.1s ease, box-shadow 0.1s ease !important;
  }
  .btn-primary:hover,
  .btn-outline:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  .btn-primary:active { transform: translateY(-1px) !important; }
}

/* ── Comparison page: horizontal scroll sticky nav ──────── */
@media (max-width: 767px) {
  #comparison-nav .flex {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    justify-content: flex-start !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  #comparison-nav .flex::-webkit-scrollbar { display: none; }
}

/* ── Tools directory filter bar: left-aligned on mobile ──── */
@media (max-width: 767px) {
  section.sticky .flex.overflow-x-auto {
    justify-content: flex-start !important;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* ── Comparison score cards: stack vertically on mobile ──── */
@media (max-width: 639px) {
  .card:has(> .editor-score-card) {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    width: 100%;
  }
  .card:has(> .editor-score-card) .text-left {
    text-align: center;
    width: 100%;
  }
  .card:has(> .editor-score-card) .space-y-1 > div {
    justify-content: center;
  }
}

/* ── Hero heading: fluid size on very small screens ─────── */
@media (max-width: 479px) {
  h1 {
    font-size: clamp(1.75rem, 9vw, 3rem) !important;
    line-height: 1.2 !important;
  }
  h2 {
    font-size: clamp(1.375rem, 7vw, 2.25rem) !important;
  }
}

/* ── Newsletter gradient section: reduce padding on mobile ── */
@media (max-width: 639px) {
  .gradient-bg.rounded-3xl {
    padding: 2rem 1.25rem !important;
  }
}

/* ── Quiz & Stack Builder cards: tighter padding on mobile ── */
@media (max-width: 479px) {
  .qstep .card,
  .step .card {
    padding: 1.5rem 1rem !important;
  }
  /* Quiz answer buttons: ensure emoji + text don't overflow */
  .answer-btn .w-10 {
    flex-shrink: 0;
    min-width: 2.5rem;
  }
}

/* ── Cookie banner: stack vertically on small screens ──────── */
@media (max-width: 479px) {
  #cookie-banner {
    flex-direction: column !important;
    text-align: center;
    padding: 1rem;
    bottom: 0.75rem;
  }
  #cookie-banner button {
    width: 100%;
    justify-content: center;
  }
}

/* ── Scroll-to-top button: adjust for small screens ─────── */
@media (max-width: 479px) {
  #scroll-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
}

/* ── Comparison table: ensure wrapper scrolls properly ───── */
.overflow-x-auto:has(> .comparison-table) {
  border-radius: 16px;
}

/* ── Footer columns: single column on very small screens ───── */
@media (max-width: 479px) {
  footer .grid {
    row-gap: 1.5rem;
  }
}

/* ── Blog / article images: full width on mobile ─────────── */
@media (max-width: 639px) {
  .prose-article img {
    width: 100% !important;
    height: auto !important;
    border-radius: 8px;
  }
  .prose-article .overflow-x-auto {
    margin-left: -1rem;
    margin-right: -1rem;
    border-radius: 0;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ── Navbar logo text: hide on very small screens if needed ── */
@media (max-width: 359px) {
  #navbar .font-extrabold.text-xl {
    font-size: 1rem;
  }
}

/* ── Hero stats grid: 2 cols on mobile (already set, ensure) ─ */
@media (max-width: 479px) {
  .grid.grid-cols-2.sm\:grid-cols-4 {
    column-gap: 1rem;
  }
}

/* ── Sticky filter bars: prevent content clipping ─────────── */
@media (max-width: 767px) {
  section.sticky.top-16 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}
