/* =============================================================
   SEO Analyzer — Main Stylesheet
   Design: Light / Clean / Blue
   ============================================================= */

:root {
  --primary:     #2563eb;
  --primary-dark:#1d4ed8;
  --primary-light:#eff6ff;
  --success:     #10b981;
  --warning:     #f59e0b;
  --danger:      #ef4444;
  --orange:      #f97316;
  --text:        #1e293b;
  --text-muted:  #64748b;
  --border:      #e2e8f0;
  --bg:          #f8fafc;
  --white:       #ffffff;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow:      0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.05);
  --shadow-lg:   0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --radius:      12px;
  --radius-lg:   20px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  line-height: 1.6;
}

/* =============================================================
   Navbar
   ============================================================= */
.navbar {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}
.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(145deg, var(--primary), #4f46e5, #7c3aed);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37,99,235,.3), inset 0 1px 0 rgba(255,255,255,.18);
  position: relative; overflow: hidden;
}
.brand-icon::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.12) 0%, transparent 100%);
  border-radius: 11px 11px 0 0;
}
.brand-icon-sm { width: 28px; height: 28px; font-size: 14px; border-radius: 6px; }
.brand-text { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.nav-link { color: var(--text-muted) !important; font-weight: 500; padding: 6px 12px !important; border-radius: 8px; transition: all .2s; }
.nav-link:hover, .nav-link.active { color: var(--primary) !important; background: var(--primary-light); }
.user-avatar {
  width: 28px; height: 28px; background: var(--primary); color: white;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}

/* =============================================================
   Hero Section
   ============================================================= */
.hero-section {
  background: linear-gradient(160deg, #ffffff 0%, #eff6ff 40%, #e0e7ff 100%);
  padding: 70px 0 50px;
  min-height: 480px;
}
.hero-badge {
  display: inline-flex; align-items: center;
  background: var(--primary-light); color: var(--primary);
  border: 1px solid #bfdbfe;
  padding: 6px 16px; border-radius: 100px;
  font-size: .85rem; font-weight: 600;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800; line-height: 1.2;
  color: var(--text); margin: 16px 0 20px;
}
.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 1.1rem; color: var(--text-muted); max-width: 600px;
  margin: 0 auto 36px; line-height: 1.7;
}

/* URL Form */
.url-form-wrapper { max-width: 700px; margin: 0 auto; }
.url-form { background: white; border-radius: var(--radius-lg); padding: 8px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.url-input-group { display: flex; align-items: center; gap: 8px; }
.url-icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 1.1rem; flex-shrink: 0; }
.url-input {
  flex: 1; border: none; outline: none; font-size: 1rem;
  color: var(--text); background: transparent; min-width: 0;
  font-family: inherit;
}
.url-input::placeholder { color: #94a3b8; }
.url-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; border: none; border-radius: 12px;
  padding: 12px 24px; font-weight: 600; font-size: .95rem;
  cursor: pointer; transition: all .2s; white-space: nowrap;
  font-family: inherit;
}
.url-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.4); }
.url-btn:active { transform: translateY(0); }
.url-hint { font-size: .82rem; color: var(--text-muted); margin-top: 12px; margin-bottom: 0; }

/* =============================================================
   Loading State
   ============================================================= */
.loading-card {
  background: white; border-radius: var(--radius-lg);
  padding: 40px; margin-top: 20px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.loading-animation { position: relative; width: 80px; height: 80px; margin: 0 auto; }
.loading-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}
.loading-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--primary);
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-steps { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; text-align: left; max-width: 280px; margin-left: auto; margin-right: auto; }
.loading-step { font-size: .85rem; color: var(--text-muted); padding: 6px 12px; border-radius: 8px; transition: all .4s; }
.loading-step.active { color: var(--primary); background: var(--primary-light); font-weight: 500; }
.loading-step.done { color: var(--success); }

/* Error Card */
.error-card {
  background: #fff5f5; border: 1px solid #fecaca;
  border-radius: var(--radius-lg); padding: 32px;
  margin-top: 20px; text-align: center;
}

/* =============================================================
   Results
   ============================================================= */
.results-header {
  background: white; border-radius: var(--radius-lg);
  padding: 28px 32px; box-shadow: var(--shadow);
  border: 1px solid var(--border); margin-bottom: 24px;
}
.score-gauge {
  width: 130px; height: 130px; position: relative; margin: 0 auto;
}
.score-ring {
  transform: rotate(-90deg);
  transition: stroke-dashoffset 1.5s cubic-bezier(.34,1.56,.64,1);
}
.score-number {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800; line-height: 1;
}
.score-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.score-grade { font-size: .85rem; font-weight: 700; letter-spacing: .02em; }

.count-pills { display: flex; gap: 12px; flex-wrap: wrap; }
.count-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 100px;
  font-weight: 600; font-size: .9rem;
}
.count-pill.success { background: #ecfdf5; color: var(--success); }
.count-pill.warning { background: #fffbeb; color: var(--warning); }
.count-pill.danger  { background: #fef2f2; color: var(--danger); }

/* Check Items */
.checks-section { display: flex; flex-direction: column; gap: 16px; }
.checks-group {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  overflow: hidden;
}
.checks-group-header {
  padding: 14px 20px; font-weight: 700; font-size: .9rem;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border); cursor: pointer;
  user-select: none;
}
.checks-group-header.success { background: #f0fdf4; color: #15803d; }
.checks-group-header.warning { background: #fffbeb; color: #92400e; }
.checks-group-header.danger  { background: #fef2f2; color: #991b1b; }
.checks-group-header .count-badge {
  margin-left: auto; background: rgba(0,0,0,.1);
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
}
.checks-group-header .chevron { transition: transform .25s; }
.checks-group-header.collapsed .chevron { transform: rotate(-90deg); }

.check-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.check-item:last-child { border-bottom: none; }
.check-item:hover { background: #fafafa; }
.check-icon { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; margin-top: 2px; }
.check-icon.success { background: #dcfce7; color: var(--success); }
.check-icon.warning { background: #fef3c7; color: var(--warning); }
.check-icon.danger  { background: #fee2e2; color: var(--danger); }
.check-text { flex: 1; }
.check-category { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--text-muted); margin-bottom: 2px; }
.check-message { font-size: .88rem; color: var(--text); line-height: 1.5; }

/* AI Summary */
.ai-card {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border-radius: var(--radius-lg); padding: 28px 32px;
  color: white; margin-bottom: 24px;
}
.ai-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.15); padding: 4px 12px;
  border-radius: 100px; font-size: .78rem; font-weight: 600;
  margin-bottom: 14px;
}
.ai-text { font-size: .95rem; line-height: 1.7; opacity: .92; white-space: pre-line; }

/* Details Grid */
.details-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 20px; }
.detail-card { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.detail-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; }
.detail-value { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-top: 4px; }
.detail-sub { font-size: .78rem; color: var(--text-muted); }

/* =============================================================
   Stats Bar
   ============================================================= */
.stats-bar { background: var(--primary); padding: 24px 0; }
.stat-item { padding: 10px; }
.stat-number { display: block; font-size: 1.8rem; font-weight: 800; color: white; }
.stat-label { font-size: .85rem; color: rgba(255,255,255,.75); font-weight: 500; }

/* =============================================================
   Features Section
   ============================================================= */
.section-title { font-size: 1.9rem; font-weight: 800; color: var(--text); }
.feature-card {
  background: white; border-radius: var(--radius); padding: 24px;
  border: 1px solid var(--border); height: 100%;
  transition: all .2s; cursor: default;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #bfdbfe; }
.feature-icon {
  width: 48px; height: 48px; background: var(--primary-light);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 1.3rem; margin-bottom: 14px;
}
.feature-title { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.feature-desc { font-size: .85rem; color: var(--text-muted); margin: 0; line-height: 1.6; }

/* =============================================================
   How It Works
   ============================================================= */
.step-card { padding: 24px; }
.step-number {
  width: 56px; height: 56px; background: linear-gradient(135deg, var(--primary), #6366f1);
  color: white; border-radius: 50%; font-size: 1.3rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; box-shadow: 0 4px 14px rgba(37,99,235,.35);
}

/* =============================================================
   CTA Section
   ============================================================= */
.cta-section { background: var(--bg); }
.cta-card {
  background: linear-gradient(135deg, #eff6ff, #e0e7ff);
  border-radius: var(--radius-lg); padding: 48px 32px;
  border: 1px solid #c7d2fe;
}

/* =============================================================
   Auth Pages
   ============================================================= */
.auth-section { min-height: calc(100vh - 140px); display: flex; align-items: center; padding: 40px 0; }
.auth-card { background: white; border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.auth-icon { width: 64px; height: 64px; background: var(--primary-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto; font-size: 1.8rem; color: var(--primary); }
.form-control, .form-select { border-radius: 10px; border-color: var(--border); padding: 10px 14px; font-size: .93rem; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.input-group-text { background: var(--bg); border-color: var(--border); color: var(--text-muted); border-radius: 10px 0 0 10px !important; }

/* =============================================================
   History Page
   ============================================================= */
.history-card {
  background: white; border-radius: var(--radius); padding: 16px 20px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: all .2s;
}
.history-card:hover { box-shadow: var(--shadow); border-color: #bfdbfe; }
.history-score {
  width: 60px; height: 60px; border-radius: 50%;
  border: 3px solid var(--score-color, var(--primary));
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.history-score .score-num { font-size: 1rem; font-weight: 800; color: var(--score-color, var(--primary)); line-height: 1; }
.history-score .score-grade { font-size: .65rem; font-weight: 700; color: var(--score-color, var(--primary)); }
.history-url { color: var(--text); font-size: .9rem; }

/* =============================================================
   Footer
   ============================================================= */
.footer { background: white; border-top: 1px solid var(--border); }
.footer-badge { font-size: .78rem; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); border-radius: 100px; padding: 4px 12px; }

/* =============================================================
   Buttons
   ============================================================= */
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border: none; border-radius: 10px; font-weight: 600; }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), #1e3a8a); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.3); }
.btn-outline-primary { border-color: var(--primary); color: var(--primary); border-radius: 10px; font-weight: 600; }
.btn-outline-primary:hover { background: var(--primary); color: white; }
.btn-outline-secondary { border-radius: 10px; font-weight: 600; }

/* =============================================================
   Utilities & Misc
   ============================================================= */
.min-width-0 { min-width: 0; }
.empty-state { padding: 60px 20px; color: var(--text-muted); }

/* Scan result URL bar */
.scan-url-bar {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 20px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px; font-size: .9rem;
}
.scan-url-bar .url-label { color: var(--text-muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.scan-url-bar .url-value { color: var(--primary); font-weight: 600; word-break: break-all; }

@media (max-width: 576px) {
  .hero-section { padding: 40px 0 30px; }
  .url-btn { padding: 12px 16px; font-size: .85rem; }
  .url-btn .btn-text span:first-child { display: none; }
  .auth-card { padding: 24px; }
  .results-header { padding: 20px; }
  .count-pills { gap: 8px; }
  .count-pill { padding: 8px 12px; font-size: .82rem; }
}

/* =============================================================
   Page Hero (About, Contact, Terms, Privacy)
   ============================================================= */
.page-hero {
  background: linear-gradient(160deg, #ffffff 0%, #eff6ff 40%, #e0e7ff 100%);
  padding: 60px 0 48px;
  border-bottom: 1px solid var(--border);
}
.page-hero .hero-title { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.section-label {
  display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--primary); margin-bottom: 10px;
}
.section-title { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; color: var(--text); }

/* =============================================================
   About Page
   ============================================================= */
.stat-pill {
  display: inline-flex; align-items: center; background: var(--bg);
  border: 1px solid var(--border); border-radius: 100px;
  padding: 6px 16px; font-size: .85rem; font-weight: 500;
}
.about-visual { padding: 20px; }
.about-card-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.mini-stat-card {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm); transition: box-shadow .2s;
}
.mini-stat-card:hover { box-shadow: var(--shadow); }
.mini-stat-card i { font-size: 1.6rem; color: var(--primary); }
.mini-stat-num { font-size: 1.4rem; font-weight: 800; color: var(--text); line-height: 1; }
.mini-stat-label { font-size: .75rem; color: var(--text-muted); margin-top: 3px; }
.tech-pill {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; transition: box-shadow .2s;
}
.tech-pill:hover { box-shadow: var(--shadow); }
.tech-icon { width: 40px; height: 40px; background: var(--primary-light); border-radius: 8px;
             display: flex; align-items: center; justify-content: center;
             color: var(--primary); font-size: 1.1rem; flex-shrink: 0; }
.roadmap-item { padding: 20px; }
.roadmap-icon { width: 52px; height: 52px; border-radius: 50%; display: flex;
                align-items: center; justify-content: center; font-size: 1.3rem; margin: 0 auto; }
.roadmap-icon.done { background: #f0fdf4; color: #10b981; }
.roadmap-icon.soon { background: #fffbeb; color: #f59e0b; }
.cta-section {
  background: linear-gradient(135deg, #eff6ff, #e0e7ff);
  border-radius: var(--radius-lg); padding: 50px 30px;
  border: 1px solid #bfdbfe;
}

/* =============================================================
   Contact Page
   ============================================================= */
.contact-info-box {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; height: 100%;
}
.contact-info-item {
  display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px;
}
.contact-info-icon {
  width: 38px; height: 38px; background: var(--primary-light); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 1rem; flex-shrink: 0;
}
.contact-success {
  background: white; border: 1px solid #bbf7d0; border-radius: var(--radius-lg);
  padding: 48px 36px; text-align: center;
}
.success-icon { font-size: 3.5rem; color: var(--success); margin-bottom: 16px; }

/* =============================================================
   Footer Extended
   ============================================================= */
.footer { background: white; border-top: 1px solid var(--border); }
.footer-links { margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: .875rem; transition: color .2s; }
.footer-links a:hover { color: var(--primary); }
.footer-legal { transition: color .2s; }
.footer-legal:hover { color: var(--primary) !important; }

/* =============================================================
   Blog Listing
   ============================================================= */
.blog-card {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: all .2s; color: var(--text);
}
.blog-card:hover { box-shadow: var(--shadow); border-color: #bfdbfe; transform: translateY(-2px); }
.blog-card-featured { box-shadow: var(--shadow-sm); }
.blog-card-featured:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.blog-icon-lg {
  width: 80px; height: 80px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; margin: 0 auto;
}
.blog-card-header { padding: 24px 24px 0; }
.blog-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.blog-card-body { padding: 16px 24px; }
.blog-card-footer {
  padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.blog-category {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--primary); background: var(--primary-light); border-radius: 100px;
  padding: 3px 10px;
}
.blog-meta { font-size: .8rem; color: var(--text-muted); }
.blog-title-lg { font-size: 1.4rem; font-weight: 800; color: var(--text); line-height: 1.3; margin: 8px 0 10px; }
.blog-title { font-size: 1.05rem; font-weight: 700; color: var(--text); line-height: 1.4; margin: 8px 0 10px; }
.blog-excerpt { color: var(--text-muted); font-size: .875rem; line-height: 1.6; }
.blog-read-more { color: var(--primary); font-size: .85rem; font-weight: 600; }
.blog-cta {
  background: linear-gradient(135deg, #eff6ff, #e0e7ff);
  border: 1px solid #bfdbfe; border-radius: var(--radius-lg);
  padding: 28px 32px;
}

/* =============================================================
   Blog Single Post / Article
   ============================================================= */
.article-title { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; line-height: 1.25; color: var(--text); }
.article-excerpt { font-size: 1.1rem; color: var(--text-muted); line-height: 1.6; margin-top: 12px; }
.author-avatar {
  width: 32px; height: 32px; background: var(--primary); color: white;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .85rem;
}
.article-body { font-size: 1rem; line-height: 1.85; color: var(--text); }
.article-body h2 { font-size: 1.5rem; font-weight: 800; margin: 2.5rem 0 1rem; color: var(--text); }
.article-body h3 { font-size: 1.2rem; font-weight: 700; margin: 2rem 0 .75rem; color: var(--text); }
.article-body p { margin-bottom: 1.25rem; }
.article-body ul, .article-body ol { margin: 0 0 1.25rem 1.5rem; padding: 0; }
.article-body li { margin-bottom: .5rem; }
.article-body pre {
  background: #0f172a; color: #e2e8f0; border-radius: var(--radius);
  padding: 20px; overflow-x: auto; margin: 1.5rem 0; font-size: .85rem; line-height: 1.6;
}
.article-body code:not(pre code) {
  background: #f1f5f9; color: var(--primary); border-radius: 4px;
  padding: 2px 6px; font-size: .88em;
}
.article-body a { color: var(--primary); }
.article-body a:hover { color: var(--primary-dark); }
.article-cta {
  background: var(--primary-light); border: 1px solid #bfdbfe;
  border-radius: var(--radius); padding: 24px;
}
.article-cta-icon {
  width: 48px; height: 48px; background: var(--primary); color: white;
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.sidebar-box {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px;
}
.sidebar-post-icon {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
.sidebar-post-link:hover .fw-semibold { color: var(--primary) !important; }
