/*
  Keywordfinder.pro - Shared Styles
  Note for deployment:
  - Consider adding a Content-Security-Policy header on the server, e.g. via Hostinger .htaccess
  - Recommended security headers: X-Content-Type-Options, Referrer-Policy, Permissions-Policy, X-Frame-Options
*/

:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #eef4ff;
  --text: #0f172a;
  --muted: #475569;
  --line: rgba(15, 23, 42, 0.1);
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --accent: #0ea5e9;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow: 0 20px 60px rgba(37, 99, 235, 0.10);
  --radius: 18px;
  --radius-sm: 12px;
  --container: 1180px;
}

[data-theme="dark"] {
  --bg: #020817;
  --surface: #0f172a;
  --surface-2: #111c34;
  --text: #e5eefb;
  --muted: #93a4bf;
  --line: rgba(148, 163, 184, 0.18);
  --primary: #60a5fa;
  --primary-2: #3b82f6;
  --accent: #22d3ee;
  --shadow: 0 20px 60px rgba(2, 8, 23, 0.6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 22%),
    var(--bg);
  color: var(--text);
  line-height: 1.65;
}

body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select {
  font: inherit;
}

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin: 0 auto;
}

.section {
  padding: 84px 0;
}

.section-sm { padding: 56px 0; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.grid {
  display: grid;
  gap: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .95rem 1.25rem;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: .25s ease;
  font-weight: 700;
}
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(37,99,235,.22);
  outline-offset: 2px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: var(--shadow);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost {
  background: rgba(37,99,235,.08);
  color: var(--primary);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  gap: 1rem;
}
.logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  font-weight: 800;
  font-size: 1.08rem;
}
.logo-wrap img {
  width: 40px;
  height: 40px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav a {
  color: var(--muted);
  font-weight: 600;
  padding: .5rem .7rem;
  border-radius: 10px;
}
.nav a:hover,
.nav a.active {
  color: var(--text);
  background: rgba(37,99,235,.08);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.theme-toggle, .menu-toggle, .icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
}
.menu-toggle { display: none; }

.hero {
  padding: 90px 0 54px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: 2rem;
}
.hero h1 {
  font-size: clamp(2.25rem, 5vw, 4.35rem);
  line-height: 1.05;
  margin: 1rem 0;
  letter-spacing: -0.04em;
}
.hero p {
  color: var(--muted);
  font-size: 1.06rem;
  max-width: 60ch;
}
.hero-cta {
  display: flex;
  gap: .9rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .9rem;
  margin-top: 2rem;
}
.metric-card,
.card,
.feature-card,
.blog-card,
.faq-item,
.form-card,
.article-card,
.legal-card,
.info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.metric-card {
  padding: 1rem;
}
.metric-card strong {
  display: block;
  font-size: 1.35rem;
}
.metric-card span {
  color: var(--muted);
  font-size: .94rem;
}
.hero-visual {
  position: relative;
}
.glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(37,99,235,.14), transparent 60%);
  filter: blur(18px);
  z-index: -1;
}
.tool-preview {
  padding: 1.2rem;
  overflow: hidden;
}
.tool-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.mini-dots { display: flex; gap: .35rem; }
.mini-dots span {
  width: 10px; height: 10px; border-radius: 999px;
  background: #cbd5e1;
}
.preview-panel {
  display: grid;
  gap: .85rem;
}
.preview-search,
.preview-list div {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 14px;
}
.preview-search { height: 52px; }
.preview-list div { height: 48px; }
.preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.preview-tags span {
  padding: .45rem .75rem;
  background: rgba(37,99,235,.08);
  color: var(--primary);
  border-radius: 999px;
  font-weight: 700;
  font-size: .88rem;
}

.tool-section .section-head,
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.section-head h2 {
  margin: .6rem 0 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.1;
}
.section-head p {
  margin: .5rem 0 0;
  color: var(--muted);
  max-width: 60ch;
}

.tool-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.25rem;
}
.sidebar-card,
.results-card {
  padding: 1.15rem;
}
.form-group {
  display: grid;
  gap: .5rem;
  margin-bottom: 1rem;
}
label { font-weight: 700; }
.input,
textarea,
select {
  width: 100%;
  padding: .95rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
textarea { min-height: 150px; resize: vertical; }
.inline-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.filter-pills button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  padding: .6rem .9rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}
.filter-pills button.active {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: transparent;
}
.result-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.results-meta {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  color: var(--muted);
}
.keyword-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .96rem;
}
.keyword-table th,
.keyword-table td {
  padding: .85rem .8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}
.keyword-table th {
  color: var(--muted);
  font-size: .88rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.keyword-table tr:hover td {
  background: rgba(37,99,235,.03);
}
.difficulty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: .35rem .65rem;
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 800;
}
.diff-easy { background: rgba(22,163,74,.14); color: var(--success); }
.diff-medium { background: rgba(217,119,6,.14); color: var(--warning); }
.diff-hard { background: rgba(220,38,38,.14); color: var(--danger); }
.empty-state {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}

.feature-grid,
.blog-grid,
.footer-grid,
.stats-grid,
.page-grid,
.legal-grid,
.contact-grid {
  display: grid;
  gap: 1.25rem;
}
.feature-grid { grid-template-columns: repeat(4, 1fr); }
.feature-card,
.blog-card,
.info-card,
.article-card,
.legal-card {
  padding: 1.25rem;
}
.feature-card h3,
.blog-card h3,
.article-card h3 { margin-top: .35rem; }
.muted { color: var(--muted); }
.icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37,99,235,.15), rgba(14,165,233,.18));
  color: var(--primary);
  font-weight: 800;
  font-size: 1.2rem;
}

.faq-list {
  display: grid;
  gap: .85rem;
}
.faq-item {
  overflow: hidden;
}
.faq-question {
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--text);
  text-align: left;
  padding: 1rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  cursor: pointer;
}
.faq-answer {
  padding: 0 1.1rem 1rem;
  color: var(--muted);
  display: none;
}
.faq-item.active .faq-answer { display: block; }
.faq-item.active .faq-toggle { transform: rotate(45deg); }
.faq-toggle {
  font-size: 1.4rem;
  transition: .2s ease;
}

.blog-card .meta,
.article-meta {
  color: var(--muted);
  font-size: .92rem;
  display: flex;
  gap: .7rem;
  flex-wrap: wrap;
}
.tag {
  display: inline-flex;
  padding: .35rem .6rem;
  background: rgba(37,99,235,.08);
  color: var(--primary);
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 800;
}

.cta-card {
  position: relative;
  overflow: hidden;
  padding: 2rem;
}
.cta-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37,99,235,.08), rgba(14,165,233,.08));
  pointer-events: none;
}
.cta-card > * { position: relative; }

.page-hero {
  padding: 84px 0 24px;
}
.breadcrumbs {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .92rem;
}
.page-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  margin: .8rem 0 1rem;
  line-height: 1.08;
}
.page-hero p { color: var(--muted); max-width: 70ch; }
.page-grid { grid-template-columns: 1fr 320px; }
.article-card {
  padding: 1.5rem;
}
.article-card h2 { margin-top: 1.7rem; }
.article-card h3 { margin-top: 1.25rem; }
.article-card ul,
.article-card ol { padding-left: 1.2rem; }
blockquote {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--primary);
  background: var(--surface-2);
  border-radius: 0 12px 12px 0;
}
.sidebar-stack {
  display: grid;
  gap: 1rem;
}
.list-clean {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list-clean li + li { margin-top: .75rem; }

.form-card { padding: 1.35rem; }
.form-note { color: var(--muted); font-size: .92rem; }
.field-error {
  color: var(--danger);
  font-size: .86rem;
  display: none;
}
.success-box {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(22,163,74,.12);
  color: var(--success);
  border: 1px solid rgba(22,163,74,.2);
}

.footer {
  margin-top: 84px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
}
.footer-grid {
  grid-template-columns: 1.3fr .8fr .8fr .7fr;
  padding: 54px 0 30px;
}
.footer h4 { margin: 0 0 .75rem; }
.footer p,
.footer li,
.footer a { color: var(--muted); }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li + li { margin-top: .55rem; }
.socials {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.socials a {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--surface);
}
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 1rem 0 2rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: var(--shadow);
  display: none;
  cursor: pointer;
}
.back-to-top.show { display: inline-flex; align-items:center; justify-content:center; }

.site-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: grid;
  place-items: center;
  transition: opacity .35s ease, visibility .35s ease;
}
.site-loader.hidden {
  opacity: 0;
  visibility: hidden;
}
.loader-orb {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 4px solid rgba(37,99,235,.15);
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.fade-up {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .45s ease, transform .45s ease;
}
.fade-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1100px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-layout,
  .page-grid,
  .footer-grid,
  .contact-grid,
  .hero-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    position: fixed;
    inset: 78px 1rem auto 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1rem;
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
    align-items: stretch;
  }
  .nav.open { display: flex; }
  .header-actions .header-cta { display: none; }
  .hero-metrics { grid-template-columns: 1fr; }
  .keyword-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .section { padding: 68px 0; }
  .hero { padding-top: 72px; }
  .feature-grid,
  .blog-grid,
  .stats-grid,
  .legal-grid { grid-template-columns: 1fr; }
  .inline-actions,
  .hero-cta,
  .result-toolbar { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
}

/* Upgrade overrides for production branding and usability */
.logo-wrap {
  min-width: 0;
}
.logo-wrap img {
  width: 42px;
  height: 42px;
  min-width: 42px;
  object-fit: contain;
}
.logo-wrap span {
  display: inline-block;
  line-height: 1.15;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.footer .logo-wrap img {
  width: 44px;
  height: 44px;
}
.header-actions .btn[disabled],
.btn[disabled] {
  opacity: .6;
  cursor: not-allowed;
  pointer-events: none;
}
.toolbar-controls {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.toolbar-controls select {
  min-width: 180px;
}
.tool-note {
  margin-top: .8rem;
  color: var(--muted);
  font-size: .92rem;
}
@media (max-width: 860px) {
  .logo-wrap span {
    font-size: 1rem;
    white-space: normal;
  }
}
@media (max-width: 640px) {
  .toolbar-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-controls select {
    min-width: 0;
    width: 100%;
  }
}
