/* ============================================================
   Country Detector — Premium playlist-organization layer
   Location: assets/css/country-detector.css

   Loaded LAST so it refines the shared tool.css / classic hero
   without edits. Scoped to `.cd-shell` (in-page) and
   `.cd-seo-wrap` (below-tool SEO blocks). Purely presentational —
   every ID the detector JS uses (#opt*, #cdDetectBtn, #cdRes*,
   #cdCountryChips, #cdTableBody, #cdDl*, captcha) is intact.
   ============================================================ */

.cd-shell {
  --cd-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --cd-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   HERO
   ============================================================ */
.cd-shell .splitter-classic-hero { max-width: 760px; margin: 0 auto 26px; }
.cd-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(99, 102, 241, 0.26);
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 700;
}
[data-theme="dark"] .cd-eyebrow {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(139, 92, 246, 0.40);
}
.cd-eyebrow__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success, #10b981);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: cd-pulse 2.4s var(--cd-ease) infinite;
}
@keyframes cd-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.cd-shell .splitter-classic-hero h1 {
  font-size: clamp(1.6rem, 3.4vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin: 0 0 12px;
}
.cd-shell .splitter-classic-hero .tool-header-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  margin-bottom: 16px;
  box-shadow: 0 14px 30px -10px rgba(99, 102, 241, 0.5);
}
.cd-shell .splitter-classic-sub { max-width: 640px; margin-left: auto; margin-right: auto; }

/* Capability pills */
.cd-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 8px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}
.cd-pills li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.20);
  font-size: 12px;
  font-weight: 650;
  color: var(--primary);
}
[data-theme="dark"] .cd-pills li {
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(139, 92, 246, 0.30);
  color: var(--primary-light, #a5b4fc);
}

/* Trust badges */
.cd-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}
.cd-trust li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.cd-trust li span { font-size: 14px; line-height: 1; }
[data-theme="dark"] .cd-trust li { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }

/* ============================================================
   STEP CARDS + STATS depth
   ============================================================ */
.cd-shell .tool-card {
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 40px -24px rgba(15, 23, 42, 0.16);
}
[data-theme="dark"] .cd-shell .tool-card {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 16px 40px -24px rgba(0, 0, 0, 0.7);
}
.cd-shell .tool-card-step {
  width: 34px;
  height: 34px;
  font-size: 15px;
  box-shadow: 0 6px 16px -6px rgba(99, 102, 241, 0.5);
}
.cd-shell .tool-card-step.is-pending { box-shadow: none; }
.cd-shell .tool-card-title { font-size: 17px; letter-spacing: -0.01em; }
.cd-shell .stat-box {
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s ease, transform 0.18s var(--cd-ease);
}
.cd-shell .stat-box:hover { transform: translateY(-2px); }
[data-theme="dark"] .cd-shell .stat-box { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
/* Result stats read as the tool's payoff — gradient values */
.cd-shell #cdResultStats .stat-box-value {
  background: var(--cd-grad);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
}

/* ============================================================
   DETECTION — option cards (output actions)
   ============================================================ */
.cd-optgroup-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 2px 0 8px;
}
.cd-shell .options-grid { gap: 12px; }
.cd-shell .option-card {
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s ease, background 0.2s var(--cd-ease),
              box-shadow 0.2s var(--cd-ease), transform 0.16s var(--cd-ease);
}
[data-theme="dark"] .cd-shell .option-card { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.cd-shell .option-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -16px rgba(99, 102, 241, 0.45);
}
.cd-shell .option-card:has(input:checked),
.cd-shell .option-card.is-checked {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(139, 92, 246, 0.05));
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.12), 0 10px 26px -18px rgba(99, 102, 241, 0.4);
}
[data-theme="dark"] .cd-shell .option-card:has(input:checked),
[data-theme="dark"] .cd-shell .option-card.is-checked {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(99, 102, 241, 0.08));
}
.cd-opt__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  font-size: 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.10));
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.12);
}
.cd-shell .option-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cd-shell .option-card-desc { font-size: 12px; }
.cd-opt__rec {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: 999px;
  padding: 2px 8px;
}
[data-theme="dark"] .cd-opt__rec {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.32);
  color: var(--primary-light, #a5b4fc);
}

/* ============================================================
   RESULTS — country chips, table, export
   ============================================================ */
.cd-shell #cdResultStats { gap: 10px; }
.cd-shell #cdCountryChips:not(:empty) {
  padding: 12px;
  border-radius: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}
.cd-shell #cdCountryChips .cd-chip,
.cd-shell #cdCountryChips > span {
  border-radius: 999px;
}
.cd-shell .table-wrap {
  border-radius: 14px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
[data-theme="dark"] .cd-shell .table-wrap { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.cd-shell .table-wrap thead th {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 12px;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.cd-shell .table-wrap tbody td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.cd-shell .table-wrap tbody tr:hover { background: rgba(99, 102, 241, 0.04); }
[data-theme="dark"] .cd-shell .table-wrap tbody tr:hover { background: rgba(139, 92, 246, 0.08); }
/* Export card emphasis */
.cd-shell #step3 .btn-primary { box-shadow: 0 10px 24px -10px rgba(99, 102, 241, 0.5); }

/* ============================================================
   FEATURES — SaaS feature cards
   ============================================================ */
.cd-features { max-width: 1080px; margin: 8px auto 0; padding: 0 4px; }
.cd-features__head { text-align: center; margin-bottom: 22px; }
.cd-features__head h2 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 8px;
}
.cd-features__head p { font-size: 14.5px; color: var(--text-secondary); line-height: 1.6; max-width: 620px; margin: 0 auto; }
.cd-features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.cd-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 26px -20px rgba(15, 23, 42, 0.16);
  transition: border-color 0.18s ease, box-shadow 0.2s var(--cd-ease), transform 0.18s var(--cd-ease);
}
.cd-feature:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 18px 38px -20px rgba(99, 102, 241, 0.35); }
[data-theme="dark"] .cd-feature { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 10px 26px -20px rgba(0, 0, 0, 0.6); }
.cd-feature__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 22px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.10));
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.12);
}
.cd-feature__body { min-width: 0; }
.cd-feature h3 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); margin: 2px 0 5px; }
.cd-feature p { font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); margin: 0; }

/* ============================================================
   RELATED TOOLS — workflow recommendations
   ============================================================ */
.cd-shell .related-tools { max-width: 1080px; margin-left: auto; margin-right: auto; }
.cd-shell .related-tools h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.015em; }
.cd-shell .related-tools-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.cd-shell .related-tool-card {
  position: relative;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px -16px rgba(15, 23, 42, 0.16);
  transition: border-color 0.18s ease, box-shadow 0.2s var(--cd-ease), transform 0.18s var(--cd-ease);
}
.cd-shell .related-tool-card:hover { transform: translateY(-3px); box-shadow: 0 18px 38px -18px rgba(99, 102, 241, 0.35); }
[data-theme="dark"] .cd-shell .related-tool-card { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 8px 20px -16px rgba(0, 0, 0, 0.6); }
.cd-shell .related-tool-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 22px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.10));
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.12);
}
.cd-shell .related-tool-name { font-size: 15px; font-weight: 700; color: var(--text); }
.cd-shell .related-tool-desc { font-size: 12.5px; line-height: 1.45; color: var(--text-muted); }
.cd-shell .related-tool-card::after {
  content: '→';
  position: absolute;
  top: 16px;
  right: 16px;
  font-weight: 700;
  color: var(--primary);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.cd-shell .related-tool-card:hover::after { opacity: 1; transform: translateX(0); }

/* ============================================================
   SEO CONTENT BLOCKS (.cd-seo-wrap)
   ============================================================ */
.cd-seo-wrap .seo-block__title { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; letter-spacing: -0.02em; }
.cd-seo-wrap .seo-usecases__item {
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px -16px rgba(15, 23, 42, 0.14);
  transition: border-color 0.18s ease, box-shadow 0.2s var(--cd-ease), transform 0.18s var(--cd-ease);
}
.cd-seo-wrap .seo-usecases__item:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 16px 34px -18px rgba(99, 102, 241, 0.3); }
[data-theme="dark"] .cd-seo-wrap .seo-usecases__item { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 8px 20px -16px rgba(0, 0, 0, 0.6); }
.cd-seo-wrap .seo-usecases__item h3 { font-weight: 700; letter-spacing: -0.01em; }
.cd-seo-wrap .seo-faq__item { transition: border-color 0.18s ease, box-shadow 0.18s ease; }
.cd-seo-wrap .seo-faq__item:hover { border-color: var(--primary); }
.cd-seo-wrap .seo-faq__item summary { position: relative; padding-right: 2.75rem; transition: color 0.18s ease; }
.cd-seo-wrap .seo-faq__item summary::after {
  content: '';
  position: absolute;
  right: 1.2rem;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translateY(-65%) rotate(45deg);
  transition: transform 0.22s var(--cd-ease), border-color 0.18s ease;
}
.cd-seo-wrap .seo-faq__item[open] summary { color: var(--primary); }
.cd-seo-wrap .seo-faq__item[open] summary::after { transform: translateY(-35%) rotate(-135deg); border-color: var(--primary); }
.cd-seo-wrap .seo-faq__item summary:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 12px; }
.cd-seo-wrap .seo-related__card strong { font-size: 0.97rem; }

@media (prefers-reduced-motion: reduce) {
  .cd-eyebrow__dot { animation: none !important; }
  .cd-shell .option-card,
  .cd-shell .stat-box,
  .cd-feature,
  .cd-shell .related-tool-card,
  .cd-seo-wrap .seo-usecases__item { transition: none !important; }
}
