/* ============================================================
   Rankify — SEO Keyword Intelligence Engine
   Theme: Navy Blue #1B2A6B | Orange #F97316 | Light Blue #93C5FD
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:        #1B2A6B;
  --navy-dark:   #111C4E;
  --navy-mid:    #243580;
  --orange:      #F97316;
  --orange-dark: #EA6C0A;
  --orange-bg:   #FFF7ED;
  --blue:        #3B82F6;
  --blue-light:  #93C5FD;
  --blue-bg:     #EFF6FF;
  --blue-pale:   #DBEAFE;
  --success:     #16A34A;
  --success-bg:  #F0FDF4;
  --danger:      #DC2626;
  --danger-bg:   #FEF2F2;
  --text-1:      #0F172A;
  --text-2:      #334155;
  --text-3:      #64748B;
  --border:      #E2E8F0;
  --surface:     #F8FAFC;
  --white:       #FFFFFF;
  --r-sm:        6px;
  --r-md:        10px;
  --r-lg:        16px;
  --r-xl:        20px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.07);
  --shadow-md:   0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:   0 8px 32px rgba(27,42,107,.12);
}

html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--surface);
  color: var(--text-1);
  line-height: 1.6;
  min-height: 100vh;
}
.container { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.hidden    { display: none !important; }
.section-gap { margin-bottom: 2rem; }

/* ── Header ── */
.site-header {
  background: var(--navy);
  padding: 14px 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(27,42,107,.3);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo-group   { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 40px; height: 40px;
  background: var(--orange);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
  box-shadow: 0 2px 8px rgba(249,115,22,.4);
}
.logo-name { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -.3px; }
.logo-sub  { font-size: 11px; color: var(--blue-light); margin-top: 1px; }
.header-pills { display: flex; gap: 8px; }
.hpill {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500;
  background: rgba(255,255,255,.1);
  color: #fff; border-radius: 20px;
  padding: 4px 12px;
  border: 1px solid rgba(255,255,255,.15);
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #2563EB 100%);
  padding: 60px 0 50px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(249,115,22,.2);
  color: #FED7AA;
  border: 1px solid rgba(249,115,22,.3);
  border-radius: 20px; padding: 5px 14px;
  font-size: 12px; font-weight: 500;
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700; color: #fff;
  text-align: center; margin-bottom: 14px;
  line-height: 1.2; letter-spacing: -.5px;
}
.hero-title .accent { color: var(--orange); }
.hero-sub {
  text-align: center; color: #93C5FD;
  font-size: 15px; max-width: 580px;
  margin: 0 auto 36px;
}
.hero { text-align: center; }

.input-card {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: 24px 28px 18px;
  box-shadow: var(--shadow-lg);
  max-width: 680px; margin: 0 auto;
}
.input-row { display: flex; gap: 10px; margin-bottom: 12px; }
.input-wrap { flex: 1; position: relative; }
.input-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3); font-size: 15px; pointer-events: none;
}
.input-wrap input {
  width: 100%; height: 50px;
  padding: 0 14px 0 42px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  font-size: 14px; font-family: 'DM Mono', monospace;
  color: var(--text-1); background: var(--white);
  transition: border-color .2s; outline: none;
}
.input-wrap input:focus { border-color: var(--navy); }
.input-wrap input::placeholder { font-family: 'DM Sans', sans-serif; color: var(--text-3); }

.btn-analyze {
  height: 50px; padding: 0 26px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff; border: none;
  border-radius: var(--r-md);
  font-size: 14px; font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
  box-shadow: 0 3px 14px rgba(249,115,22,.4);
  transition: opacity .2s, transform .1s;
}
.btn-analyze:hover  { opacity: .9; }
.btn-analyze:active { transform: scale(.98); }
.btn-analyze:disabled { opacity: .5; cursor: not-allowed; }

.input-hint {
  display: flex; justify-content: center; gap: 18px;
  font-size: 12px; color: var(--text-3);
  flex-wrap: wrap;
}
.input-hint span { display: flex; align-items: center; gap: 4px; }
.input-hint i { color: var(--orange); }

/* ── Loading ── */
.loading-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 48px;
  text-align: center; box-shadow: var(--shadow-md);
}
.loading-orb {
  position: relative; width: 64px; height: 64px;
  margin: 0 auto 20px;
}
.loading-spinner {
  position: absolute; inset: 0;
  border: 3px solid var(--border);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
.loading-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--navy);
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 16px; font-weight: 600; color: var(--navy); margin-bottom: 24px; }
.loading-steps { display: inline-flex; flex-direction: column; gap: 10px; text-align: left; }
.lstep {
  font-size: 13px; color: var(--text-3);
  display: flex; align-items: center; gap: 10px;
}
.lstep-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); flex-shrink: 0;
  transition: background .3s;
}
.lstep.active { color: var(--navy); font-weight: 500; }
.lstep.active .lstep-dot { background: var(--orange); }
.lstep.done   { color: var(--success); }
.lstep.done .lstep-dot { background: var(--success); }

/* ── Error ── */
.error-card {
  background: var(--danger-bg); border: 1px solid #FCA5A5;
  border-radius: var(--r-md); padding: 16px 20px;
  color: var(--danger); display: flex; align-items: center;
  gap: 10px; font-size: 14px;
}

/* ── Results topbar ── */
.results-topbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 1.25rem;
}
.results-site { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.results-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-action {
  height: 34px; padding: 0 14px;
  background: var(--white); color: var(--text-2);
  border: 1px solid var(--border); border-radius: var(--r-md);
  font-size: 12px; font-weight: 500; font-family: 'DM Sans', sans-serif;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: background .15s, border-color .15s;
}
.btn-action:hover { background: var(--surface); }
.btn-action.btn-new {
  background: var(--navy); color: #fff; border-color: var(--navy);
}
.btn-action.btn-new:hover { background: var(--navy-dark); }

/* ── Stat grid ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 1.25rem;
}
.stat-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px 16px;
  text-align: center; box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--orange);
}
.stat-val { font-size: 30px; font-weight: 700; color: var(--navy); }
.stat-lbl { font-size: 11px; color: var(--text-3); margin-top: 4px; text-transform: uppercase; letter-spacing: .6px; }

/* ── Cards ── */
.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px 26px;
  margin-bottom: 1.25rem; box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 15px; font-weight: 700; color: var(--navy);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 2px solid var(--surface);
}
.card-title i { color: var(--orange); }

.data-source-pill {
  margin-left: auto; font-size: 11px; font-weight: 500;
  padding: 3px 10px; border-radius: 20px;
}

/* ── Biz grid ── */
.biz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.biz-cell { background: var(--surface); border-radius: var(--r-md); padding: 12px 14px; border: 1px solid var(--border); }
.biz-k { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px; }
.biz-v { font-size: 13px; color: var(--text-1); font-weight: 600; }

/* ── Filter bar ── */
.filter-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 12px 14px;
  background: var(--surface); border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-group label { font-size: 12px; color: var(--text-3); font-weight: 500; }
.filter-group select {
  font-size: 12px; padding: 4px 8px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--white); color: var(--text-1);
  font-family: 'DM Sans', sans-serif; cursor: pointer; outline: none;
}
.filter-count { margin-left: auto; font-size: 12px; color: var(--text-3); }

/* ── Keyword table ── */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border); }
.kw-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.kw-table th {
  text-align: left; padding: 10px 12px;
  background: var(--navy); color: #CBD5E1;
  font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: none; white-space: nowrap;
}
.kw-table th:first-child { border-radius: var(--r-sm) 0 0 0; }
.kw-table th:last-child  { border-radius: 0 var(--r-sm) 0 0; }
.kw-table td {
  padding: 10px 12px; border-bottom: 1px solid #F1F5F9;
  color: var(--text-1); vertical-align: middle; word-break: break-word;
  white-space: nowrap;
}
.kw-table td:first-child { white-space: normal; }
.kw-table tbody tr:last-child td { border-bottom: none; }
.kw-table tbody tr:hover td { background: #F8FAFF; }
.kw-table tbody tr:nth-child(even) td { background: #FAFBFF; }
.kw-table tbody tr:nth-child(even):hover td { background: #F0F4FF; }

.col-kw     { width: 28%; }
.col-intent { width: 12%; }
.col-vol    { width: 9%; }
.col-diff   { width: 10%; }

.col-pri    { width: 16%; }
.col-src    { width: 11%; }
.col-copy   { width: 14%; }

.kw-text { font-weight: 600; color: var(--navy); }
.vol-num { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 500; color: var(--navy); }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center;
  font-size: 10px; padding: 3px 9px;
  border-radius: 20px; font-weight: 600; white-space: nowrap;
}
.badge-trans  { background: #ECFDF5; color: #059669; border: 1px solid #A7F3D0; }
.badge-info   { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-pale); }
.badge-local  { background: var(--orange-bg); color: var(--orange-dark); border: 1px solid #FED7AA; }
.badge-easy   { background: #ECFDF5; color: #059669; border: 1px solid #A7F3D0; }
.badge-medium { background: #FFFBEB; color: #D97706; border: 1px solid #FDE68A; }
.badge-hard   { background: var(--danger-bg); color: var(--danger); border: 1px solid #FCA5A5; }
.badge-high   { background: var(--navy); color: #fff; }
.badge-mid    { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-pale); }
.badge-long   { background: var(--surface); color: var(--text-3); border: 1px solid var(--border); }
.badge-google { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; font-size: 9px; }
.badge-ai     { background: #F5F3FF; color: #7C3AED; border: 1px solid #DDD6FE; font-size: 9px; }
.badge-conf   { font-size: 10px; padding: 2px 8px; }

/* copy btn */
.btn-copy {
  height: 26px; padding: 0 10px;
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 11px; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
  font-family: 'DM Sans', sans-serif; transition: all .15s;
  vertical-align: middle;
}
.btn-copy:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-copy.copied { background: var(--success-bg); color: var(--success); border-color: #86EFAC; }

/* ── Clusters ── */
.cluster-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; }
.cluster-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px 16px;
  border-left: 3px solid var(--orange);
}
.cluster-topic {
  font-size: 12px; font-weight: 700; color: var(--navy);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.cluster-topic i { color: var(--orange); }
.cluster-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.cluster-pill {
  display: inline-flex; align-items: center;
  background: var(--white); border: 1px solid var(--border);
  border-radius: 20px; padding: 3px 11px;
  font-size: 12px; color: var(--text-2);
  transition: all .15s; cursor: default;
}
.cluster-pill:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── Tabs ── */
.tab-card { padding-bottom: 12px; }
.tab-bar {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 2px solid var(--border);
  margin-bottom: 22px;
}
.tab {
  padding: 9px 18px; background: none; border: none;
  font-size: 13px; font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-3); cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  display: flex; align-items: center; gap: 6px;
  transition: color .15s; border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.tab:hover  { color: var(--navy); background: var(--surface); }
.tab.active { color: var(--navy); border-bottom-color: var(--orange); font-weight: 700; }
.tab-panel  { display: none; }
.tab-panel.active { display: block; }

/* ── Competitors ── */
.comp-grid { display: grid; gap: 14px; }
.comp-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px 16px;
  border-top: 3px solid var(--navy);
}
.comp-url {
  font-size: 14px; font-weight: 700; color: var(--navy);
  margin-bottom: 12px; display: flex; align-items: center; gap: 7px;
}
.comp-url i { color: var(--orange); }
.comp-kw-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.comp-kw-row:last-child { border-bottom: none; }

/* ── Opportunities / Content / Voice ── */
.opp-section { margin-bottom: 22px; }
.opp-section:last-child { margin-bottom: 0; }
.section-label {
  font-size: 12px; font-weight: 700; color: var(--navy);
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 10px; display: flex; align-items: center; gap: 7px;
  padding: 8px 12px; background: var(--surface);
  border-radius: var(--r-sm); border-left: 3px solid var(--orange);
}
.list-item {
  display: flex; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid #F1F5F9;
  font-size: 13px; color: var(--text-1);
}
.list-item:last-child { border-bottom: none; }
.list-num { color: var(--orange); min-width: 22px; font-size: 12px; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.voice-quote { font-style: italic; color: var(--text-2); }
.voice-quote::before { content: '"'; color: var(--orange); font-style: normal; font-weight: 700; margin-right: 2px; }
.voice-quote::after  { content: '"'; color: var(--orange); font-style: normal; font-weight: 700; margin-left: 2px; }

/* ── Footer ── */
.site-footer {
  background: var(--navy-dark); padding: 20px 0;
  margin-top: 48px;
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-logo { font-size: 16px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 8px; }
.footer-logo i { color: var(--orange); }
.footer-text { font-size: 12px; color: #64748B; }

/* ── Responsive ── */
@media (max-width: 620px) {
  .input-row  { flex-direction: column; }
  .btn-analyze { width: 100%; justify-content: center; }
  .results-topbar { flex-direction: column; align-items: flex-start; }
  .hero { padding: 40px 0 32px; }
  .card { padding: 16px; }
  .header-pills { display: none; }
  .tab { padding: 7px 12px; font-size: 12px; }
}