/* ==========================================================================
   SEO Tools - Main Stylesheet
   ========================================================================== */

:root {
    --primary: #059669;
    --primary-dark: #047857;
    --secondary: #0891b2;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #f0fdf4;
    --white: #fff;
    --border: #d1fae5;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 8px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* Header */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.site-header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.nav-links { display: flex; gap: 25px; }
.nav-links a { color: var(--text-light); font-weight: 500; transition: var(--transition); }
.nav-links a:hover { color: var(--primary); }

/* Tool Page */
.tool-page { padding: 40px 0; }
.tool-header { text-align: center; margin-bottom: 40px; }
.tool-header h1 { font-size: 2.5rem; margin-bottom: 15px; color: var(--text); }
.tool-header .subtitle { font-size: 1.1rem; color: var(--text-light); max-width: 700px; margin: 0 auto; }

/* Tool Card */
.tool-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
}
.tool-card h2, .tool-card h3 { font-size: 1.2rem; margin-bottom: 20px; color: var(--text); }

/* Form Elements */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 8px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-control, .form-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}
.monospace { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 0.9rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-lg { padding: 15px 30px; font-size: 1.1rem; }
.btn-block { display: flex; width: 100%; }

.action-buttons { display: flex; gap: 15px; flex-wrap: wrap; }
.action-buttons .btn { flex: 1; min-width: 180px; }

/* Options */
.options-row, .options-grid { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 20px; }
.options-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.checkbox-label {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; background: var(--bg); border-radius: var(--radius);
    cursor: pointer; transition: var(--transition);
}
.checkbox-label:hover { background: var(--border); }
.checkbox-label input { width: 18px; height: 18px; accent-color: var(--primary); }

/* Result */
.result-card { border-left: 4px solid var(--success); }
.result-box {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}
.result-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 40px; }
.stat-item { text-align: center; }
.stat-value { font-size: 2rem; font-weight: 700; color: #065f46; }
.stat-label { font-size: 0.9rem; color: var(--text-light); }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 0.85rem; color: var(--text-light); }

/* Keyword Table */
.keyword-table { overflow-x: auto; }
.keyword-table table { width: 100%; border-collapse: collapse; }
.keyword-table th, .keyword-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
.keyword-table th { background: var(--bg); font-weight: 600; }
.keyword-table tr:hover { background: #f0fdf4; }

/* SERP Preview */
.serp-preview {
    background: var(--white);
    border: 1px solid #dfe1e5;
    border-radius: 8px;
    padding: 20px;
    max-width: 600px;
}
.serp-preview.mobile { max-width: 400px; }
.serp-title { color: #1a0dab; font-size: 20px; margin-bottom: 5px; cursor: pointer; }
.serp-title:hover { text-decoration: underline; }
.serp-url { color: #006621; font-size: 14px; margin-bottom: 5px; }
.serp-description { color: #545454; font-size: 14px; line-height: 1.5; }
.char-count { font-size: 0.85rem; color: var(--text-light); float: right; }
.warning-text { color: var(--warning); margin-top: 10px; }

/* Schema Fields */
.schema-fields { margin-top: 20px; }

/* Meta Results */
.meta-results { display: flex; flex-direction: column; gap: 20px; }
.meta-item { background: var(--bg); padding: 15px; border-radius: var(--radius); }
.meta-item label { font-weight: 600; color: var(--primary); display: block; margin-bottom: 5px; }
.meta-value { word-break: break-all; }
.meta-length { font-size: 0.85rem; color: var(--text-light); margin-top: 5px; }
.meta-length.warning { color: var(--warning); }

/* Score Display */
.score-display { text-align: center; }
.score-value { font-size: 4rem; font-weight: 700; }
.score-value.good { color: var(--success); }
.score-value.warning { color: var(--warning); }
.score-value.bad { color: var(--error); }
.score-label { font-size: 1.2rem; color: var(--text-light); }

/* Tag List */
.tag-list { display: flex; flex-direction: column; gap: 10px; }
.tag-item { display: flex; gap: 15px; padding: 10px; background: var(--bg); border-radius: var(--radius); }
.tag-key { font-weight: 600; min-width: 150px; color: var(--primary); }
.tag-val { word-break: break-all; }

/* Issues List */
.issues-list { list-style: none; }
.issues-list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.issues-list li:last-child { border-bottom: none; }

/* Links Table */
.links-table { overflow-x: auto; }
.links-table table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.links-table th, .links-table td { padding: 10px; text-align: left; border-bottom: 1px solid var(--border); }
.links-table th { background: var(--bg); }
.url-cell { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Heading Tree */
.heading-tree { font-family: monospace; }
.heading-item { padding: 8px 0; border-bottom: 1px solid var(--border); }
.heading-item.level-1 { padding-left: 0; }
.heading-item.level-2 { padding-left: 20px; }
.heading-item.level-3 { padding-left: 40px; }
.heading-item.level-4 { padding-left: 60px; }
.heading-item.level-5 { padding-left: 80px; }
.heading-item.level-6 { padding-left: 100px; }
.heading-tag { background: var(--primary); color: white; padding: 2px 8px; border-radius: 4px; margin-right: 10px; font-size: 0.85rem; }

/* OG Preview */
.og-preview { border: 1px solid #ddd; border-radius: 8px; overflow: hidden; max-width: 500px; }
.og-image-placeholder { background: #f0f0f0; height: 260px; display: flex; align-items: center; justify-content: center; color: #999; }
.og-image-placeholder img { width: 100%; height: 100%; object-fit: cover; }
.og-content { padding: 15px; }
.og-url { font-size: 12px; color: #999; text-transform: uppercase; }
.og-title { font-size: 16px; font-weight: 600; margin: 5px 0; }
.og-description { font-size: 14px; color: #666; }

/* Checklist */
.checklist { display: flex; flex-direction: column; gap: 10px; }
.checklist-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--bg); border-radius: var(--radius); cursor: pointer; }
.checklist-item input { width: 20px; height: 20px; accent-color: var(--primary); }
.checklist-item:has(input:checked) { background: #d1fae5; }

/* Vitals Grid */
.vitals-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 600px) { .vitals-grid { grid-template-columns: 1fr; } }
.vital-card { text-align: center; padding: 20px; background: var(--bg); border-radius: var(--radius); }
.vital-name { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.vital-target { font-size: 1.2rem; font-weight: 600; margin: 10px 0; }
.vital-desc { font-size: 0.9rem; color: var(--text-light); }

/* Redirect Types */
.redirect-types { display: flex; flex-direction: column; gap: 15px; }
.redirect-type { padding: 15px; background: var(--bg); border-radius: var(--radius); }
.redirect-type h4 { color: var(--primary); margin-bottom: 5px; }

/* Breadcrumb Builder */
.breadcrumb-builder { display: flex; flex-direction: column; gap: 15px; }
.breadcrumb-level { display: flex; align-items: center; gap: 10px; }
.level-num { width: 30px; height: 30px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.breadcrumb-level input { flex: 1; }

/* Anchor Stats */
.anchor-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.anchor-stat { display: flex; justify-content: space-between; padding: 12px; background: var(--bg); border-radius: var(--radius); }
.anchor-type { font-weight: 500; }
.anchor-count { font-weight: 700; color: var(--primary); }

/* Code Block */
.code-block { background: #1f2937; color: #10b981; padding: 15px; border-radius: var(--radius); font-family: monospace; overflow-x: auto; }
.help-text { margin-top: 10px; color: var(--text-light); font-size: 0.9rem; }

/* Info Box */
.info-box { background: #e0f2fe; border-left: 4px solid #0891b2; padding: 15px; border-radius: var(--radius); margin-bottom: 20px; }

/* Tools Grid */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.tool-grid-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border);
}
.tool-grid-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.tool-grid-item h3 { font-size: 1.1rem; color: var(--text); margin-bottom: 8px; }
.tool-grid-item p { font-size: 0.9rem; color: var(--text-light); }

/* Categories */
.tools-categories { margin-top: 40px; }
.category { margin-bottom: 50px; }
.category h2 { font-size: 1.5rem; margin-bottom: 20px; color: var(--text); }

/* How To Steps */
.how-to-steps { counter-reset: step; list-style: none; }
.how-to-steps li { position: relative; padding-left: 50px; margin-bottom: 15px; counter-increment: step; }
.how-to-steps li::before {
    content: counter(step);
    position: absolute; left: 0; top: 0;
    width: 32px; height: 32px;
    background: var(--primary); color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
}

/* Content Section */
.content-section { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; margin-bottom: 30px; }
.content-section h2 { font-size: 1.5rem; margin-bottom: 20px; }
.content-section p { margin-bottom: 15px; color: var(--text-light); }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-question { font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; }
.faq-question::after { content: '+'; font-size: 1.5rem; color: var(--primary); }
.faq-item.active .faq-question::after { content: '−'; }
.faq-answer { color: var(--text-light); margin-top: 10px; display: none; }
.faq-item.active .faq-answer { display: block; }

/* Related Tools */
.related-tools { background: var(--bg); padding: 60px 0; }
.related-tools h2 { text-align: center; margin-bottom: 30px; }

/* Footer */
.site-footer { background: #1f2937; color: #d1d5db; padding: 50px 0 30px; }
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-section h4 { font-size: 1.1rem; margin-bottom: 20px; color: white; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #9ca3af; transition: var(--transition); }
.footer-links a:hover { color: white; }
.copyright { text-align: center; padding-top: 30px; border-top: 1px solid #374151; color: #6b7280; }

/* Responsive */
@media (max-width: 768px) {
    .site-header .container { flex-direction: column; gap: 15px; }
    .nav-links { flex-wrap: wrap; justify-content: center; }
    .tool-header h1 { font-size: 1.8rem; }
    .action-buttons { flex-direction: column; }
    .action-buttons .btn { width: 100%; }
}
