/* ─── Reset & Base ──────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1a1a2e;
    background: #fafbfc;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

/* ─── Navbar ────────────────────────────── */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 0 24px;
}
.nav-container {
    max-width: 1140px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.logo {
    font-size: 1.3rem; font-weight: 800; color: #1a1a2e;
    text-decoration: none; display: flex; align-items: center; gap: 8px;
}
.logo i { color: #6366f1; font-size: 1.4rem; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { color: #64748b; text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: #1a1a2e; }
.nav-cta {
    background: #6366f1 !important; color: white !important;
    padding: 8px 20px; border-radius: 8px;
    transition: background 0.2s !important;
}
.nav-cta:hover { background: #4f46e5 !important; }

/* ─── Buttons ───────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: inherit; font-size: 0.95rem; font-weight: 600;
    padding: 12px 24px; border-radius: 10px; border: none;
    cursor: pointer; text-decoration: none; transition: all 0.2s;
}
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-primary { background: #6366f1; color: white; }
.btn-primary:hover { background: #4f46e5; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(99,102,241,0.35); }
.btn-ghost { background: transparent; color: #64748b; }
.btn-ghost:hover { color: #1a1a2e; }
.btn-outline { background: transparent; color: #6366f1; border: 2px solid #6366f1; }
.btn-outline:hover { background: #6366f1; color: white; }

/* ─── Hero ──────────────────────────────── */
.hero {
    position: relative; overflow: hidden;
    padding: 160px 24px 100px;
    text-align: center;
    background: linear-gradient(135deg, #f8faff 0%, #eef2ff 50%, #e0e7ff 100%);
}
.hero-bg {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 40%, rgba(99,102,241,0.08) 0%, transparent 60%),
                radial-gradient(circle at 70% 60%, rgba(139,92,246,0.06) 0%, transparent 50%);
}
.hero-content { position: relative; max-width: 720px; margin: 0 auto; }
.badge {
    display: inline-block; padding: 6px 16px;
    background: rgba(99,102,241,0.1); color: #6366f1;
    border-radius: 50px; font-size: 0.85rem; font-weight: 600;
    margin-bottom: 24px;
}
.hero h1 { font-size: 3.2rem; font-weight: 800; line-height: 1.15; margin-bottom: 20px; color: #0f172a; }
.gradient-text { background: linear-gradient(135deg, #6366f1, #8b5cf6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-subtitle { font-size: 1.15rem; color: #64748b; max-width: 560px; margin: 0 auto 36px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 60px; }
.hero-stats { display: flex; justify-content: center; gap: 48px; flex-wrap: wrap; }
.stat strong { display: block; font-size: 1.8rem; color: #0f172a; }
.stat span { font-size: 0.85rem; color: #94a3b8; }
.stat-divider { width: 1px; background: #e2e8f0; }

/* ─── Checker ───────────────────────────── */
.checker-section { padding: 80px 24px; }
.checker-section h2 { text-align: center; font-size: 2rem; margin-bottom: 8px; }
.section-subtitle { text-align: center; color: #64748b; margin-bottom: 40px; font-size: 1.05rem; }
.checker-box {
    max-width: 640px; margin: 0 auto 40px;
    background: white; border-radius: 16px;
    padding: 24px; box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}
.input-group {
    display: flex; align-items: center; gap: 12px;
    background: #f8fafc; border-radius: 12px; padding: 6px 6px 6px 16px;
    border: 2px solid #e2e8f0; transition: border-color 0.2s;
}
.input-group:focus-within { border-color: #6366f1; }
.input-icon { color: #94a3b8; font-size: 1.1rem; }
.input-group input {
    flex: 1; border: none; background: transparent; outline: none;
    font-size: 1.05rem; font-family: inherit; padding: 12px 0;
}
.input-group .btn { white-space: nowrap; }
.check-options { margin-top: 16px; display: flex; justify-content: center; }
.toggle-label {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.9rem; color: #64748b; cursor: pointer;
}
.toggle-label input { display: none; }
.toggle-switch {
    width: 40px; height: 22px; background: #cbd5e1; border-radius: 11px;
    position: relative; transition: background 0.2s;
}
.toggle-switch::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; background: white; border-radius: 50%;
    transition: transform 0.2s;
}
.toggle-label input:checked + .toggle-switch { background: #6366f1; }
.toggle-label input:checked + .toggle-switch::after { transform: translateX(18px); }

/* ─── Loading ───────────────────────────── */
.loading { text-align: center; padding: 60px 0; }
.spinner {
    width: 48px; height: 48px; margin: 0 auto 20px;
    border: 4px solid #e2e8f0; border-top-color: #6366f1;
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { color: #64748b; }

/* ─── Results ───────────────────────────── */
.results { max-width: 900px; margin: 0 auto; }
.results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.results-header h3 { font-size: 1.3rem; }
.results-header h3 span { color: #6366f1; }
.scan-time { font-size: 0.85rem; color: #94a3b8; background: #f1f5f9; padding: 4px 12px; border-radius: 6px; }

.metrics-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
    margin-bottom: 32px;
}
.metric-card {
    background: white; border-radius: 12px; padding: 20px;
    text-align: center; border: 1px solid #e2e8f0;
    transition: transform 0.2s;
}
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.metric-card.wide { grid-column: span 4; display: flex; align-items: center; gap: 20px; text-align: left; padding: 16px 24px; }
.metric-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; font-size: 1.1rem; }
.metric-card.wide .metric-icon { margin: 0; flex-shrink: 0; }
.metric-icon.blue { background: #eef2ff; color: #6366f1; }
.metric-icon.green { background: #ecfdf5; color: #10b981; }
.metric-icon.orange { background: #fff7ed; color: #f59e0b; }
.metric-icon.red { background: #fef2f2; color: #ef4444; }
.metric-icon.purple { background: #f5f3ff; color: #8b5cf6; }
.metric-value { font-size: 2rem; font-weight: 800; color: #0f172a; }
.metric-card.wide .metric-value { font-size: 1.6rem; min-width: 40px; }
.metric-label { font-size: 0.8rem; color: #94a3b8; margin-top: 4px; }
.metric-card.wide .metric-label { font-size: 0.85rem; }
.da-bar { flex: 1; height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.da-fill { height: 100%; background: linear-gradient(90deg, #6366f1, #8b5cf6); border-radius: 4px; transition: width 1s ease; }

/* ─── Table ─────────────────────────────── */
.table-container {
    background: white; border-radius: 12px;
    border: 1px solid #e2e8f0; overflow: hidden;
}
.table-container h4 { padding: 20px 24px 0; font-size: 1rem; color: #334155; }
.backlinks-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.backlinks-table th {
    text-align: left; padding: 12px 24px; font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: #94a3b8; border-bottom: 1px solid #e2e8f0; background: #f8fafc;
}
.backlinks-table td { padding: 14px 24px; font-size: 0.9rem; border-bottom: 1px solid #f1f5f9; }
.backlinks-table tr:last-child td { border-bottom: none; }
.backlinks-table tr:hover td { background: #f8fafc; }
.source-url { color: #6366f1; text-decoration: none; word-break: break-all; }
.source-url:hover { text-decoration: underline; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; }
.tag-dofollow { background: #ecfdf5; color: #059669; }
.tag-nofollow { background: #fff7ed; color: #d97706; }
.tag-alive { background: #ecfdf5; color: #059669; }
.tag-broken { background: #fef2f2; color: #dc2626; }
.no-results { text-align: center; padding: 40px; color: #94a3b8; }

/* ─── Error ─────────────────────────────── */
.error-box {
    max-width: 640px; margin: 24px auto;
    background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px;
    padding: 20px 24px; display: flex; align-items: center; gap: 12px;
    color: #dc2626;
}

/* ─── Features ──────────────────────────── */
.features-section { padding: 100px 24px; background: white; }
.features-section h2 { text-align: center; font-size: 2rem; margin-bottom: 8px; }
.features-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
    margin-top: 48px;
}
.feature-card {
    padding: 32px; border-radius: 12px;
    border: 1px solid #e2e8f0; transition: all 0.2s;
}
.feature-card:hover { border-color: #c7d2fe; box-shadow: 0 4px 16px rgba(99,102,241,0.08); transform: translateY(-2px); }
.feature-icon {
    width: 48px; height: 48px; border-radius: 12px;
    background: #eef2ff; color: #6366f1;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; margin-bottom: 20px;
}
.feature-card h4 { font-size: 1.1rem; margin-bottom: 8px; color: #0f172a; }
.feature-card p { font-size: 0.9rem; color: #64748b; }

/* ─── Pricing ───────────────────────────── */
.pricing-section { padding: 100px 24px; }
.pricing-section h2 { text-align: center; font-size: 2rem; margin-bottom: 8px; }
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 700px; margin: 48px auto 0; }
.pricing-card {
    background: white; border-radius: 16px; padding: 40px 32px;
    border: 1px solid #e2e8f0; text-align: center; position: relative;
}
.pricing-card.popular { border: 2px solid #6366f1; box-shadow: 0 8px 32px rgba(99,102,241,0.12); }
.popular-badge {
    position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
    background: #6366f1; color: white; padding: 6px 20px; border-radius: 50px;
    font-size: 0.8rem; font-weight: 600;
}
.pricing-card h4 { font-size: 1.4rem; margin-bottom: 8px; }
.pricing-card .price { font-size: 3rem; font-weight: 800; margin-bottom: 32px; }
.pricing-card .price span { font-size: 1rem; color: #94a3b8; font-weight: 400; }
.pricing-card ul { list-style: none; text-align: left; margin-bottom: 32px; }
.pricing-card li { padding: 8px 0; display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: #475569; }
.pricing-card li i { color: #10b981; font-size: 0.85rem; }

/* ─── Footer ────────────────────────────── */
footer { padding: 60px 24px 30px; background: #0f172a; color: #94a3b8; }
.footer-content { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 24px; margin-bottom: 40px; }
.footer-brand h4 { color: white; font-size: 1.2rem; margin-bottom: 8px; }
.footer-brand h4 i { color: #6366f1; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: #94a3b8; text-decoration: none; font-size: 0.9rem; }
.footer-links a:hover { color: white; }
.footer-copy { text-align: center; font-size: 0.8rem; padding-top: 24px; border-top: 1px solid #1e293b; }

/* ─── Modal ─────────────────────────────── */
.modal {
    display: none; position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
}
.modal.active { display: flex; }
.modal-content {
    background: white; border-radius: 16px; padding: 40px;
    max-width: 440px; width: 90%; position: relative;
}
.modal-close {
    position: absolute; top: 16px; right: 20px;
    background: none; border: none; font-size: 1.8rem;
    cursor: pointer; color: #94a3b8;
}
.modal h3 { font-size: 1.5rem; margin-bottom: 8px; }
.modal-subtitle { color: #64748b; margin-bottom: 24px; font-size: 0.9rem; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: #334155; }
.form-group input {
    width: 100%; padding: 12px 16px; border: 2px solid #e2e8f0;
    border-radius: 10px; font-size: 1rem; font-family: inherit;
    transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: #6366f1; }
.modal-note { text-align: center; font-size: 0.8rem; color: #94a3b8; margin-top: 16px; }

/* ─── Plan badge ────────────────────────── */
.plan-badge {
    display: inline-block; margin: 0 auto 20px;
    padding: 8px 20px; border-radius: 50px; font-size: 0.85rem; font-weight: 600;
    text-align: center;
}
.plan-badge.free { background: #fef9ec; color: #b45309; border: 1px solid #fde68a; }
.plan-badge.pro { background: #eef2ff; color: #4f46e5; border: 1px solid #c7d2fe; }
.plan-badge.exhausted { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

.plan-tag { font-size: 0.82rem; font-weight: 500; }
.plan-tag.free { color: #b45309; }
.plan-tag.pro { color: #4f46e5; }
.plan-tag a { color: #6366f1; text-decoration: underline; }
#planInfo { margin-bottom: 16px; }

/* ─── Upgrade Banner ─────────────────────── */
.upgrade-banner {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    background: linear-gradient(135deg, #fef9ec, #fff7ed);
    border: 1px solid #fde68a; border-radius: 12px;
    padding: 20px 24px; margin: 24px auto; max-width: 640px;
}
.upgrade-icon { font-size: 2rem; }
.upgrade-content { flex: 1; }
.upgrade-content strong { display: block; color: #92400e; margin-bottom: 4px; }
.upgrade-content p { color: #78350f; font-size: 0.9rem; margin: 0; }
.upgrade-banner .btn { white-space: nowrap; }

/* ─── Toast ─────────────────────────────── */
.toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 300;
    padding: 14px 24px; border-radius: 10px; color: white;
    font-size: 0.9rem; font-weight: 500;
    transform: translateY(100px); opacity: 0; transition: all 0.3s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: #10b981; }
.toast-error { background: #ef4444; }

/* ─── Responsive ────────────────────────── */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    .hero { padding: 120px 24px 60px; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .metric-card.wide { grid-column: span 2; }
    .features-grid { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr; }
    .nav-links a:not(.nav-cta) { display: none; }
    .backlinks-table th:nth-child(3), .backlinks-table td:nth-child(3) { display: none; }
}
