/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-gray: #f9fafb;
    --border: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 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: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav a:hover {
    color: var(--primary);
}

.search-form {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    max-width: 400px;
}

.search-input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
}

.search-btn {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover {
    background: var(--primary-dark);
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-search {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
}

.hero-search input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
}

.hero-search button {
    padding: 1rem 2rem;
    background: white;
    color: var(--primary);
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.hero-search button:hover {
    transform: translateY(-2px);
}

/* Content sections */
.content-section {
    padding: 3rem 0;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text);
}

/* Categories grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.category-card {
    padding: 1.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
    display: block;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px var(--shadow);
    border-color: var(--primary);
}

.category-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.category-icon-large {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.category-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.category-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.category-count {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Articles list */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.article-card {
    padding: 1.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s;
}

.article-card:hover {
    box-shadow: 0 4px 12px var(--shadow);
    border-color: var(--primary);
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.article-title a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.article-title a:hover {
    color: var(--primary);
}

.article-category, .article-category-badge {
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s;
}

.article-category:hover, .article-category-badge:hover {
    background: var(--primary-dark);
}

.article-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.article-meta, .article-meta-full {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

.meta-item svg {
    stroke-width: 2;
}

/* Article content */
.article-content {
    max-width: 800px;
    margin: 0 auto;
}

.article-header-full {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.article-header-full h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.article-meta-full {
    margin-top: 1rem;
}

.markdown-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text);
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.markdown-content h1 { font-size: 2rem; }
.markdown-content h2 { font-size: 1.5rem; }
.markdown-content h3 { font-size: 1.25rem; }

.markdown-content p {
    margin-bottom: 1rem;
}

.markdown-content ul, .markdown-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.markdown-content li {
    margin-bottom: 0.5rem;
}

.markdown-content code {
    background: var(--bg-gray);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

.markdown-content pre {
    background: var(--bg-gray);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.markdown-content pre code {
    background: none;
    padding: 0;
}

.markdown-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-light);
    font-style: italic;
}

.markdown-content a {
    color: var(--primary);
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.markdown-content th, .markdown-content td {
    border: 1px solid var(--border);
    padding: 0.75rem;
    text-align: left;
}

.markdown-content th {
    background: var(--bg-gray);
    font-weight: 600;
}

/* Article tags */
.article-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 2rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.tag {
    padding: 0.25rem 0.75rem;
    background: var(--bg-gray);
    color: var(--text-light);
    border-radius: 6px;
    font-size: 0.85rem;
}

/* Article feedback */
.article-feedback {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--bg-gray);
    border-radius: 12px;
    text-align: center;
}

.article-feedback p {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.feedback-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.feedback-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-btn:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.feedback-btn.active {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

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

/* Category header */
.category-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.category-description {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-state svg {
    stroke-width: 1.5;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

/* Error page */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.error-icon {
    margin-bottom: 1.5rem;
    color: var(--danger);
}

.error-page h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-details {
    margin: 2rem 0;
    text-align: left;
}

.error-details pre {
    background: var(--bg-gray);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Footer */
.footer {
    background: var(--text);
    color: white;
    margin-top: 4rem;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3, .footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .search-form {
        max-width: 100%;
    }

    .nav {
        width: 100%;
        justify-content: center;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .category-header {
        flex-direction: column;
        text-align: center;
    }

    .article-header {
        flex-direction: column;
        align-items: start;
    }

    .article-header-full h1 {
        font-size: 1.75rem;
    }

    .feedback-buttons {
        flex-direction: column;
    }

    .product-links-grid {
        grid-template-columns: 1fr;
    }

    .faq-section {
        padding: 2rem 0;
    }

    .cta-section {
        padding: 2rem;
    }

    .cta-content h2 {
        font-size: 1.5rem;
    }
}

/* SEO Category Page Sections */

/* SEO Intro Section */
.seo-intro {
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--bg-gray);
    border-radius: 12px;
    line-height: 1.8;
}

.seo-intro p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
    color: var(--text);
}

.seo-intro p:last-child {
    margin-bottom: 0;
}

/* Product Links Section */
.product-links-section {
    margin-bottom: 3rem;
}

.product-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.product-link-card {
    position: relative;
    padding: 1.5rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.product-link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px var(--shadow);
    border-color: var(--primary);
}

.product-link-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
    transition: color 0.2s;
}

.product-link-card:hover h3 {
    color: var(--primary-dark);
}

.product-link-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.link-arrow {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform 0.2s;
}

.product-link-card:hover .link-arrow {
    transform: translateX(4px);
}

/* Comparison Section */
.comparison-section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bg-gray) 0%, var(--bg) 100%);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.comparison-content {
    line-height: 1.8;
}

.comparison-content p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.comparison-content ul,
.comparison-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.comparison-content li {
    margin-bottom: 0.5rem;
}

.comparison-content strong {
    color: var(--primary);
    font-weight: 600;
}

/* FAQ Section */
.faq-section {
    margin-bottom: 3rem;
    padding: 3rem 0;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.faq-item {
    padding: 1.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s;
}

.faq-item:hover {
    box-shadow: 0 4px 12px var(--shadow);
    border-color: var(--primary);
}

.faq-question {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.faq-question::before {
    content: "Q:";
    color: var(--primary);
    font-weight: 700;
    flex-shrink: 0;
}

.faq-answer {
    padding-left: 2rem;
    color: var(--text-light);
    line-height: 1.7;
}

.faq-answer p {
    margin-bottom: 0.75rem;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul,
.faq-answer ol {
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.faq-answer li {
    margin-bottom: 0.5rem;
}

.faq-answer code {
    background: var(--bg-gray);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

/* CTA Section */
.cta-section {
    margin-bottom: 3rem;
    padding: 3rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 16px;
    text-align: center;
    color: white;
}

.cta-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: white;
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
