/* SEO Free (seofree.online) - Main Stylesheet
   Modern, Accessible, Responsive CSS Design System
   Color Palette: White/Light-gray background, Navy text, Blue & Teal accents, Dark Mode
*/

:root {
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

  /* Colors (Light Mode) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  
  --text-main: #0f172a;       /* Navy text */
  --text-muted: #475569;
  --text-subtle: #64748b;

  --primary: #1e40af;         /* Deep Blue */
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  
  --accent: #0d9488;          /* Teal */
  --accent-hover: #0f766e;
  --accent-light: #ccfbf1;
  --accent-glow: rgba(13, 148, 136, 0.2);

  --border: #e2e8f0;
  --border-focus: #2563eb;

  --badge-allowed-bg: #ecfdf5;
  --badge-allowed-text: #065f46;
  --badge-allowed-border: #a7f3d0;

  --badge-blocked-bg: #fef2f2;
  --badge-blocked-text: #991b1b;
  --badge-blocked-border: #fecaca;

  --badge-warn-bg: #fffbeb;
  --badge-warn-text: #92400e;
  --badge-warn-border: #fde68a;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

[data-theme="dark"] {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --card-bg: #111827;
  --card-border: #1f2937;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.15);

  --accent: #14b8a6;
  --accent-hover: #2dd4bf;
  --accent-light: rgba(20, 184, 166, 0.15);
  --accent-glow: rgba(20, 184, 166, 0.25);

  --border: #1f2937;
  --border-focus: #38bdf8;

  --badge-allowed-bg: rgba(16, 185, 129, 0.15);
  --badge-allowed-text: #34d399;
  --badge-allowed-border: rgba(16, 185, 129, 0.3);

  --badge-blocked-bg: rgba(239, 68, 68, 0.15);
  --badge-blocked-text: #f87171;
  --badge-blocked-border: rgba(239, 68, 68, 0.3);

  --badge-warn-bg: rgba(245, 158, 11, 0.15);
  --badge-warn-text: #fbbf24;
  --badge-warn-border: rgba(245, 158, 11, 0.3);

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.5);
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-primary);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--accent);
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

code, pre, kbd {
  font-family: var(--font-mono);
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s, border-color 0.2s;
}
[data-theme="dark"] .site-header {
  background-color: rgba(11, 15, 25, 0.92);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo-link {
  display: flex;
  align-items: center;
}
.logo-img {
  height: 40px;
  width: auto;
}
.logo-img-dark {
  display: none;
}
[data-theme="dark"] .logo-img-light {
  display: none;
}
[data-theme="dark"] .logo-img-dark {
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}
.nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.15s;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.theme-toggle-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-main);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero Section */
.hero-section {
  padding: 3rem 0 2rem;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(13, 148, 136, 0.3);
}
.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-main);
  margin-bottom: 1rem;
}
.hero-title .highlight {
  color: var(--primary);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 1.5rem;
}

/* Tool Interface Cards */
.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  margin-bottom: 3rem;
  position: relative;
}

.mode-selector {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}
.mode-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.2s;
}
.mode-label:has(input:checked) {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.mode-label input {
  accent-color: var(--primary);
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 900px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
}

.input-group {
  display: flex;
  flex-direction: column;
}
.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.input-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}
.input-hint {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.code-textarea {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  height: 220px;
  resize: vertical;
  white-space: pre;
}

.crawler-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--accent-hover);
}
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}
.btn-outline:hover {
  background: var(--bg-secondary);
  color: var(--text-main);
}

.actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Status Banners */
.banner-success {
  background: var(--badge-allowed-bg);
  border: 1px solid var(--badge-allowed-border);
  color: var(--badge-allowed-text);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.banner-error {
  background: var(--badge-blocked-bg);
  border: 1px solid var(--badge-blocked-border);
  color: var(--badge-blocked-text);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.edit-disclaimer {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}
.dirty-notice {
  background: var(--badge-warn-bg);
  border: 1px solid var(--badge-warn-border);
  color: var(--badge-warn-text);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Results Panel */
.results-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  margin-bottom: 4rem;
}
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.results-title {
  font-size: 1.5rem;
  font-weight: 800;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}
@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.kpi-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}
.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.kpi-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kpi-allowed .kpi-value { color: #10b981; }
.kpi-blocked .kpi-value { color: #ef4444; }
.kpi-warn .kpi-value { color: #f59e0b; }

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.filter-tabs {
  display: flex;
  gap: 0.5rem;
}
.filter-btn {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn.active, .filter-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}
.data-table th {
  background: var(--bg-secondary);
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table tr:hover {
  background: rgba(0, 0, 0, 0.015);
}
[data-theme="dark"] .data-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.badge-allowed {
  background: var(--badge-allowed-bg);
  color: var(--badge-allowed-text);
  border-color: var(--badge-allowed-border);
}
.badge-blocked {
  background: var(--badge-blocked-bg);
  color: var(--badge-blocked-text);
  border-color: var(--badge-blocked-border);
}
.badge-warning {
  background: var(--badge-warn-bg);
  color: var(--badge-warn-text);
  border-color: var(--badge-warn-border);
}

.url-cell {
  max-width: 320px;
  word-break: break-all;
}
.scope-tag {
  display: block;
  font-size: 0.7rem;
  color: #f59e0b;
  margin-top: 0.25rem;
}
.explanation-cell {
  max-width: 280px;
  line-height: 1.4;
}

/* Content Sections (How it works, features, FAQs) */
.section {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}
.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.feature-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.feature-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}
.feature-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Steps Grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 500px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }
}
.step-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.step-number {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.step-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.step-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* FAQs Accordion */
.faq-list {
  max-width: 860px;
  margin: 0 auto;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  background: var(--card-bg);
  overflow: hidden;
}
.faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  text-align: left;
  background: none;
  border: none;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-question:hover {
  color: var(--primary);
}
.faq-answer {
  padding: 0 1.5rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Notice Box */
.notice-box {
  background: var(--bg-secondary);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0;
  color: var(--text-main);
  font-size: 0.95rem;
}

/* Blog Layout & Cards */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
@media (max-width: 900px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}
.post-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.post-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}
.post-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.post-category {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.post-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}
.post-title a {
  color: inherit;
}
.post-title a:hover {
  color: var(--primary);
}
.post-excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}
.post-meta {
  font-size: 0.8rem;
  color: var(--text-subtle);
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  display: flex;
  justify-content: space-between;
}

/* Single Article Typography */
.article-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 1rem 4rem;
}
.article-header {
  margin-bottom: 2.5rem;
}
.article-h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0.75rem 0 1rem;
}
.article-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-main);
}
.article-content h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 2.25rem 0 1rem;
  color: var(--text-main);
}
.article-content h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 1.75rem 0 0.75rem;
  color: var(--text-main);
}
.article-content p {
  margin-bottom: 1.25rem;
}
.article-content ul, .article-content ol {
  margin: 1rem 0 1.5rem 1.75rem;
}
.article-content li {
  margin-bottom: 0.5rem;
}
.article-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 800px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 500px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
.footer-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
}
.footer-links {
  list-style: none;
}
.footer-links li {
  margin-bottom: 0.5rem;
}
.footer-links a {
  color: var(--text-muted);
}
.footer-links a:hover {
  color: var(--primary);
}
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
}

/* Utility Helpers */
.hidden { display: none !important; }
.text-center { text-align: center; }
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
