/* =========================================================
   websiterank.ch – Main Stylesheet
   Modern 2026 · Bootstrap 5.3 base
   ========================================================= */

:root {
  --brand-1: #2563eb;
  --brand-2: #7c3aed;
  --brand-grad: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --surface-1: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e2e8f0;
  --text-1: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg: 0 20px 60px rgba(37,99,235,.12), 0 8px 24px rgba(0,0,0,.06);
  --score-good: #22c55e;
  --score-ok: #f59e0b;
  --score-bad: #ef4444;
  --transition: all .22s cubic-bezier(.4,0,.2,1);
}

/* Reset / Base */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-1);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
}

/* =========================================================
   HERO / HEADER
   ========================================================= */
.hero {
  background: var(--brand-grad);
  padding: 64px 0 80px;
  position: relative;
  overflow: hidden;
  transition: padding .4s ease;
}

.hero.compact {
  padding: 28px 0 36px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(255,255,255,.07) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 80% 20%, rgba(255,255,255,.05) 0%, transparent 70%);
}

.hero-inner { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.hero h1 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -.02em;
}

.hero h1 span {
  background: linear-gradient(90deg, #bfdbfe, #ddd6fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p.lead {
  color: rgba(255,255,255,.78);
  font-size: clamp(15px, 2.2vw, 18px);
  max-width: 560px;
  margin: 0 auto 36px;
}

.hero.compact h1 { font-size: clamp(18px, 3vw, 28px); margin-bottom: 6px; }
.hero.compact p.lead { display: none; }
.hero.compact .hero-badge { display: none; }

/* =========================================================
   URL INPUT BAR
   ========================================================= */
.search-bar {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius-lg);
  padding: 6px 6px 6px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(12px);
  max-width: 700px;
  margin: 0 auto;
  transition: var(--transition);
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
}

.search-bar:focus-within {
  border-color: rgba(255,255,255,.5);
  box-shadow: 0 8px 32px rgba(0,0,0,.18), 0 0 0 3px rgba(255,255,255,.1);
}

.search-bar .url-icon {
  color: rgba(255,255,255,.6);
  flex-shrink: 0;
  font-size: 18px;
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 16px;
  color: #fff;
  padding: 8px 0;
  min-width: 0;
}

.search-bar input::placeholder { color: rgba(255,255,255,.5); }

.btn-analyze {
  background: #fff;
  color: var(--brand-1);
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-analyze:hover:not(:disabled) {
  background: #f0f9ff;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  transform: translateY(-1px);
}

.btn-analyze:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: none;
}

.btn-analyze .spinner-border {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

/* =========================================================
   MAIN CONTENT AREA
   ========================================================= */
.content-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 16px 80px;
}

/* =========================================================
   EMPTY STATE
   ========================================================= */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-state .icon-wrap {
  width: 80px;
  height: 80px;
  background: var(--surface-3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 36px;
}

.empty-state h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 10px;
}

.empty-state p {
  color: var(--text-2);
  max-width: 420px;
  margin: 0 auto 28px;
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 28px;
}

.feature-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
}

/* ── Recent URLs ─────────────────────────────────────── */
.recent-urls {
  max-width: 680px;
  margin: 0 auto 48px;
  padding: 0 16px;
}

.recent-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
  text-align: center;
}

.recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.recent-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  transition: border-color .15s, color .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}

.recent-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

.recent-domain { font-weight: 500; }

.recent-score {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
}

.recent-score.score-great { background: #dcfce7; color: #16a34a; }
.recent-score.score-ok    { background: #fef9c3; color: #a16207; }
.recent-score.score-bad   { background: #fee2e2; color: #dc2626; }

.feature-pill i { color: var(--brand-1); font-size: 15px; }

/* =========================================================
   SCORE CARDS
   ========================================================= */
.results-section { display: none; }
.results-section.visible { display: block; }

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: 16px;
}

/* Score circle */
.score-circle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.score-circle {
  position: relative;
  width: 90px;
  height: 90px;
}

.score-circle svg {
  width: 90px;
  height: 90px;
  transform: rotate(-90deg);
}

.score-circle .track {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 8;
}

.score-circle .fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 226;
  stroke-dashoffset: 226;
  transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1);
}

.score-circle .fill.good   { stroke: var(--score-good); }
.score-circle .fill.ok     { stroke: var(--score-ok); }
.score-circle .fill.bad    { stroke: var(--score-bad); }
.score-circle .fill.neutral{ stroke: var(--brand-1); }

.score-circle .score-val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-1);
}

.score-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
}

/* Cards */
.card-wr {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.card-wr.highlighted {
  border-color: rgba(37,99,235,.2);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(37,99,235,.1);
}

/* Metric row */
.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.metric-row:last-child { border-bottom: none; }

.metric-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-2);
  flex: 1;
  min-width: 0;
}

.metric-label i { color: var(--text-3); font-size: 16px; flex-shrink: 0; }

.metric-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  text-align: right;
  flex-shrink: 0;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 100px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}

.badge-good { background: #dcfce7; color: #166534; }
.badge-ok   { background: #fef9c3; color: #854d0e; }
.badge-bad  { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* Strategy Toggle */
.strategy-toggle {
  display: flex;
  background: var(--surface-3);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
  width: fit-content;
  margin-bottom: 20px;
}

.strategy-btn {
  background: none;
  border: none;
  border-radius: 100px;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.strategy-btn.active {
  background: var(--surface-1);
  color: var(--brand-1);
  box-shadow: var(--shadow-sm);
}

/* SEO Check items */
.seo-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.seo-item:last-child { border-bottom: none; }

.seo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}

.seo-icon.good { background: #dcfce7; color: #16a34a; }
.seo-icon.ok   { background: #fef9c3; color: #ca8a04; }
.seo-icon.bad  { background: #fee2e2; color: #dc2626; }
.seo-icon.info { background: #dbeafe; color: #2563eb; }

.seo-info { flex: 1; min-width: 0; }
.seo-info strong { display: block; font-size: 14px; font-weight: 600; color: var(--text-1); margin-bottom: 2px; }
.seo-info span { font-size: 13px; color: var(--text-2); word-break: break-word; }

/* PAA */
.paa-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.paa-item i { color: var(--brand-1); flex-shrink: 0; }

/* URL bar display */
.analyzed-url {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 100px;
  padding: 5px 16px;
  font-size: 13px;
  color: rgba(255,255,255,.8);
  margin-top: 12px;
  backdrop-filter: blur(8px);
  max-width: 100%;
  overflow: hidden;
}

.analyzed-url span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =========================================================
   LOADING STATE
   ========================================================= */
.loading-state {
  display: none;
  text-align: center;
  padding: 80px 20px;
}

.loading-state.visible { display: block; }

.loading-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.loading-dots span {
  width: 12px;
  height: 12px;
  background: var(--brand-1);
  border-radius: 50%;
  animation: dot-bounce .8s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: .15s; }
.loading-dots span:nth-child(3) { animation-delay: .3s; }

@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: .4; }
  40%            { transform: scale(1);   opacity: 1; }
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
  margin: 0 auto;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-2);
  transition: var(--transition);
}

.loading-step.active {
  border-color: var(--brand-1);
  color: var(--brand-1);
  background: #eff6ff;
}

/* Last step stays active → pulse to show it's still working */
.loading-step.active:last-child {
  animation: step-pulse 1.4s ease-in-out infinite;
}

@keyframes step-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .55; }
}

.loading-step.done { color: var(--score-good); border-color: var(--score-good); background: #f0fdf4; }
.loading-step i { font-size: 16px; }

.loading-wait-hint {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  animation: step-pulse 1.8s ease-in-out infinite;
}

/* Error state */
.error-state {
  display: none;
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  color: #991b1b;
}

.error-state.visible { display: block; }

/* =========================================================
   SCORE SUMMARY BAR
   ========================================================= */
.summary-bar {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.summary-domain {
  flex: 1;
  min-width: 200px;
}

.summary-domain .domain-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-domain .domain-sub {
  font-size: 12px;
  color: var(--text-3);
}

.summary-scores {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* =========================================================
   LANGUAGE SWITCHER
   ========================================================= */
.lang-switcher {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 100px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  user-select: none;
  transition: var(--transition);
}

.lang-current:hover {
  background: rgba(255,255,255,.22);
}

.lang-code { letter-spacing: .04em; }

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  overflow: hidden;
  z-index: 200;
}

.lang-switcher.open .lang-dropdown { display: block; }

.lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-1);
  text-decoration: none;
  transition: background .15s;
}

.lang-item:hover { background: var(--surface-2); }
.lang-item.active { background: #eff6ff; color: var(--brand-1); font-weight: 600; }


/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--brand-1); }

/* =========================================================
   TABS
   ========================================================= */
.wr-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-3);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.wr-tab {
  flex: 1;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.wr-tab.active {
  background: var(--surface-1);
  color: var(--brand-1);
  box-shadow: var(--shadow-sm);
}

.wr-tab-panel { display: none; }
.wr-tab-panel.active { display: block; }

/* =========================================================
   KEYWORD TAGS
   ========================================================= */
.kw-tag {
  display: inline-block;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 13px;
  color: var(--text-1);
  margin: 4px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 576px) {
  .search-bar { flex-wrap: wrap; border-radius: var(--radius-md); }
  .btn-analyze { width: 100%; justify-content: center; border-radius: 10px; }

  .summary-bar { flex-direction: column; align-items: flex-start; }
  .summary-scores { width: 100%; justify-content: space-around; }

  .wr-tab span { display: none; }

  .score-circle { width: 72px; height: 72px; }
  .score-circle svg { width: 72px; height: 72px; }
  .score-circle .score-val { font-size: 18px; }
}

@media (max-width: 768px) {
  .hero { padding: 48px 0 64px; }
  .hero.compact { padding: 24px 0 30px; }
  .content-wrap { padding: 24px 12px 60px; }
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeInUp .4s ease both; }
.fade-in-2 { animation: fadeInUp .4s .1s ease both; }
.fade-in-3 { animation: fadeInUp .4s .2s ease both; }
