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

:root {
    --semrush: #1e40af;
    --ahrefs: #059669;
    --moz: #d97706;
    --similarweb: #8b5cf6;
    --seranking: #dc2626;
    --bg: #f8fafc;
    --card-bg: #fff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e40af 0%, #059669 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Main */
main {
    padding: 40px 0;
}

section {
    margin-bottom: 60px;
}

section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--text);
    border-bottom: 3px solid var(--semrush);
    padding-bottom: 12px;
    display: inline-block;
}

section h3 {
    font-size: 1.4rem;
    margin-top: 28px;
    margin-bottom: 16px;
    color: var(--semrush);
    font-weight: 600;
}

section h4 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text);
    font-weight: 600;
}

section p {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 16px;
    line-height: 1.8;
}

/* Intro */
.intro {
    margin-bottom: 40px;
}

/* Featured Tool */
.featured-tool {
    background: var(--card-bg);
    padding: 40px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
    border-top: 4px solid var(--semrush);
}

.featured-tool h2 {
    margin-bottom: 12px;
}

.featured-tool > .container > p {
    margin-bottom: 24px;
    color: var(--text-light);
}

/* Comparison Tool */
.comparison-tool {
    margin-top: 20px;
}

.tool-controls {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.tool-controls label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
}

.tool-controls select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}

.comparison-display {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 24px;
}

.comparison-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.tool-info {
    padding: 20px;
    border-radius: 8px;
    color: white;
    text-align: center;
}

.tool-info.semrush-color {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
}

.tool-info.competitor-color {
    background: linear-gradient(135deg, #059669, #047857);
}

.tool-info h3 {
    margin: 0 0 8px 0;
    color: white;
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
}

.comparison-features {
    margin-bottom: 20px;
}

.feature-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.feature-row:last-child {
    border-bottom: none;
}

.feature-label {
    font-weight: 600;
    margin-bottom: 4px;
}

.feature-value {
    color: var(--text-light);
}

.comparison-verdict {
    background: #fef3c7;
    padding: 16px;
    border-radius: 6px;
    border-left: 4px solid #d97706;
}

.comparison-verdict h4 {
    margin-top: 0;
}

/* Detailed Comparisons */
.detailed-comparisons {
    background: var(--card-bg);
    padding: 40px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.comparison-section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 2px solid var(--border);
}

.comparison-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.comparison-column {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 8px;
}

.comparison-column h4 {
    margin-top: 0;
}

.comparison-column ul {
    list-style: none;
    padding: 0;
}

.comparison-column li {
    padding: 8px 0;
    color: var(--text-light);
}

.comparison-column li:before {
    content: "✓ ";
    color: var(--ahrefs);
    font-weight: 700;
    margin-right: 8px;
}

.comparison-metrics {
    margin: 20px 0;
}

.metric-card {
    margin-bottom: 16px;
}

.metric-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.metric-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bar-fill {
    padding: 8px 12px;
    border-radius: 4px;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
}

.semrush-bar {
    background: var(--semrush);
}

.ahrefs-bar {
    background: var(--ahrefs);
}

.recommendation-box {
    background: #dbeafe;
    border-left: 4px solid var(--semrush);
    padding: 16px;
    border-radius: 6px;
    margin: 16px 0;
}

.recommendation-box.alternate {
    background: #d1fae5;
    border-left-color: var(--ahrefs);
}

.recommendation-box h4 {
    margin-top: 0;
}

/* Features Table */
.features-table {
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
}

thead {
    background: #f1f5f9;
    border-bottom: 2px solid var(--border);
}

th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text);
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

tbody tr:hover {
    background: #f8fafc;
}

/* Use Cases Grid */
.use-case-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.use-case-card {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 8px;
}

.use-case-card h4 {
    margin-top: 0;
}

.use-case-card ul {
    list-style: none;
    padding: 0;
}

.use-case-card li {
    padding: 8px 0;
    color: var(--text-light);
}

/* Competitors Grid */
.competitors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.competitor-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.competitor-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.competitor-card h4 {
    margin-top: 0;
}

.competitor-card p {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.competitor-card ul {
    list-style: none;
    padding: 0;
}

.competitor-card li {
    padding: 4px 0;
    font-size: 0.85rem;
    color: var(--text-light);
}

.competitor-card li:before {
    content: "• ";
    margin-right: 6px;
}

/* Metrics Section */
.metrics {
    background: var(--card-bg);
    padding: 40px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 30px;
}

.metric-section {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 8px;
}

.metric-section h3 {
    margin-top: 0;
}

.metric-item {
    margin-bottom: 16px;
}

.item-name {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.item-comparison {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bar {
    height: 32px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.bar-content {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 8px;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
}

.best-for-list {
    list-style: none;
    padding: 0;
}

.best-for-list li {
    padding: 8px 0;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
}

.best-for-list li:last-child {
    border-bottom: none;
}

/* Decision Guide */
.decision-guide {
    background: var(--card-bg);
    padding: 40px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.decision-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.decision-card {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--semrush);
}

.decision-card:nth-child(2) {
    border-left-color: var(--ahrefs);
}

.decision-card:nth-child(3) {
    border-left-color: var(--moz);
}

.decision-card:nth-child(4) {
    border-left-color: var(--similarweb);
}

.decision-card h3 {
    margin-top: 0;
}

.decision-card ul {
    list-style: none;
    padding: 0;
}

.decision-card li {
    padding: 8px 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.decision-card li:before {
    content: "✓ ";
    color: var(--semrush);
    font-weight: 700;
    margin-right: 8px;
}

.decision-card:nth-child(2) li:before {
    color: var(--ahrefs);
}

.decision-card:nth-child(3) li:before {
    color: var(--moz);
}

.decision-card:nth-child(4) li:before {
    color: var(--similarweb);
}

/* Comparison Table Section */
.comparison-table-section {
    background: var(--card-bg);
    padding: 40px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
    border: 2px solid var(--border);
    border-radius: 8px;
}

.comprehensive-table {
    width: 100%;
    border-collapse: collapse;
}

.comprehensive-table thead {
    background: linear-gradient(135deg, #1e40af, #059669);
    color: white;
}

.comprehensive-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.comprehensive-table td {
    padding: 12px;
    border-right: 1px solid var(--border);
}

.comprehensive-table tbody tr {
    border-bottom: 1px solid var(--border);
}

.comprehensive-table tbody tr:hover {
    background: #f8fafc;
}

.comprehensive-table tbody tr.highlight {
    background: #dbeafe;
    font-weight: 600;
}

.table-notes {
    margin-top: 16px;
    padding: 12px;
    background: #fef3c7;
    border-left: 4px solid #d97706;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* FAQs */
.faqs {
    background: var(--card-bg);
    padding: 40px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.faqs h2 {
    margin-bottom: 30px;
}

.faq-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-item h3 {
    font-size: 1.05rem;
    margin-top: 0;
    margin-bottom: 12px;
}

.faq-item p {
    margin-bottom: 0;
}

/* Footer */
.footer {
    background: var(--text);
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
}

.footer p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    section h2 {
        font-size: 1.6rem;
    }

    .comparison-grid,
    .use-case-grid,
    .competitors-grid,
    .metrics-grid,
    .decision-grid,
    .comparison-header {
        grid-template-columns: 1fr;
    }

    .table-wrapper {
        overflow-x: auto;
    }

    .comprehensive-table {
        font-size: 0.85rem;
    }

    .comprehensive-table th,
    .comprehensive-table td {
        padding: 8px 4px;
    }
}
