/**
 * Helpdesk Knowledge Base - Public Styles
 * With CSS Variables for Theme Support
 */

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color, #333);
    background: var(--bg-color, #f5f7fa);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
}

a {
    color: var(--primary-color, #4a6cf7);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--secondary-color, #F20D80);
}

img {
    max-width: 100%;
    height: auto;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--max-content-width, 1200px);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--header-bg, #fff);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color, #1a1a2e);
    display: flex;
    align-items: center;
}

.logo:hover {
    color: var(--primary-color, #4a6cf7);
}

.logo-image {
    max-height: 45px;
    width: auto;
}

/* Logo switching for dark mode */
.logo-image.logo-dark {
    display: none;
}

body.dark-mode .logo-image.logo-light {
    display: none;
}

body.dark-mode .logo-image.logo-dark {
    display: block;
}

/* If no dark logo, apply filter to light logo (only when no dark logo exists) */
body.dark-mode .logo-image.logo-light:only-child {
    filter: brightness(0) invert(1);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-nav a {
    padding: 8px 16px;
    border-radius: var(--button-radius, 6px);
    font-weight: 500;
    transition: background 0.2s;
    color: var(--text-color, #333);
}

.main-nav a:hover {
    background: var(--primary-color, #4a6cf7);
    color: #fff;
}

/* Theme Toggle Button */
.theme-toggle {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--card-bg, #f0f4ff);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-color, #333);
    transition: all 0.3s;
    position: relative;
}

.theme-toggle:hover {
    background: var(--primary-color, #4a6cf7);
    color: #fff;
}

.theme-toggle #theme-icon-light,
.theme-toggle #theme-icon-dark {
    position: absolute;
    transition: opacity 0.3s, transform 0.3s;
}

/* Light mode: show sun, hide moon */
body.light-mode .theme-toggle #theme-icon-light {
    opacity: 1;
    transform: rotate(0deg);
}
body.light-mode .theme-toggle #theme-icon-dark {
    opacity: 0;
    transform: rotate(-90deg);
}

/* Dark mode: show moon, hide sun */
body.dark-mode .theme-toggle #theme-icon-light {
    opacity: 0;
    transform: rotate(90deg);
}
body.dark-mode .theme-toggle #theme-icon-dark {
    opacity: 1;
    transform: rotate(0deg);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color, #4a6cf7) 0%, var(--secondary-color, #6366f1) 100%);
    padding: 60px 0;
    text-align: center;
    color: #fff;
}

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

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 25px;
}

/* Search Form */
.search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-bg, #fff);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.search-form input {
    flex: 1;
    padding: 18px 25px;
    border: none;
    font-size: 1rem;
    outline: none;
    background: var(--card-bg, #fff);
    color: var(--text-color, #333);
}

.search-form input::placeholder {
    color: var(--text-muted, #999);
}

.search-form button {
    padding: 18px 35px;
    background: var(--secondary-color, #1a1a2e);
    color: #fff;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 0 var(--button-radius, 8px) var(--button-radius, 8px) 0;
}

.search-form button:hover {
    filter: brightness(1.1);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px 20px;
}

/* Categories Section */
.categories-section h2,
.recent-section h2,
.search-results h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--text-color, #1a1a2e);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* Categories per row variants */
.categories-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}
.categories-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}
.categories-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 900px) {
    .categories-grid.cols-3,
    .categories-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .categories-grid.cols-2,
    .categories-grid.cols-3,
    .categories-grid.cols-4 {
        grid-template-columns: 1fr;
    }
}

.category-card {
    background: var(--card-bg, #fff);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
    color: inherit;
    border: 1px solid var(--border-color, transparent);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    color: inherit;
}

.category-icon {
    width: 50px;
    height: 50px;
    /* Fallback for browsers without color-mix support */
    background: rgba(74, 108, 247, 0.15);
    background: var(--primary-color-light, rgba(74, 108, 247, 0.15));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    color: var(--primary-color, #4a6cf7);
    font-size: 1.4rem;
}

.category-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-color, #1a1a2e);
}

.category-card p {
    color: var(--text-muted, #666);
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.article-count {
    font-size: 0.85rem;
    color: var(--text-muted, #888);
    font-weight: 500;
}

/* Articles List */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.article-card {
    background: var(--card-bg, #fff);
    padding: 20px 25px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
    border: 1px solid var(--border-color, transparent);
}

.article-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.article-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.article-card h3 a {
    color: var(--text-color, #1a1a2e);
}

.article-card h3 a:hover {
    color: var(--primary-color, #4a6cf7);
}

.article-card p {
    color: var(--text-muted, #666);
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.article-card .date {
    font-size: 0.85rem;
    color: var(--text-muted, #999);
}

.category-tag {
    display: inline-block;
    padding: 4px 10px;
    /* Fallback */
    background: rgba(74, 108, 247, 0.15);
    background: var(--primary-color-light, rgba(74, 108, 247, 0.15));
    color: var(--primary-color, #4a6cf7);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 10px;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 25px;
    font-size: 0.9rem;
    color: var(--text-muted, #666);
}

.breadcrumb a {
    color: var(--text-muted, #666);
}

.breadcrumb a:hover {
    color: var(--primary-color, #4a6cf7);
}

.breadcrumb .separator {
    margin: 0 8px;
    color: var(--border-color, #ccc);
}

/* Page Header */
.page-header {
    margin-bottom: 30px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.page-header-icon {
    width: 60px;
    height: 60px;
    /* Fallback */
    background: rgba(74, 108, 247, 0.15);
    background: var(--primary-color-light, rgba(74, 108, 247, 0.15));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color, #4a6cf7);
    font-size: 1.8rem;
    flex-shrink: 0;
}

.page-header-content {
    flex: 1;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--text-color, #1a1a2e);
    margin-bottom: 10px;
}

.page-header .description {
    color: var(--text-muted, #666);
    font-size: 1.1rem;
}

/* Article Layout - FIXED for proper sidebar behavior */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
    align-items: start;
}

/* When sidebar is on the left */
.article-layout.sidebar-left {
    grid-template-columns: 280px 1fr;
}

/* Position sidebar on the left using grid areas */
.article-layout.sidebar-left .article-main {
    order: 2;
}

.article-layout.sidebar-left .article-sidebar {
    order: 1;
}

/* Responsive - single column on mobile */
@media (max-width: 900px) {
    .article-layout,
    .article-layout.sidebar-left {
        grid-template-columns: 1fr;
    }

    .article-layout .article-main,
    .article-layout.sidebar-left .article-main {
        order: 1;
    }

    .article-layout .article-sidebar,
    .article-layout.sidebar-left .article-sidebar {
        order: 2;
    }
}

.article-main {
    min-width: 0;
    order: 1;
}

.article-sidebar {
    order: 2;
}

.article-full {
    background: var(--card-bg, #fff);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--border-color, transparent);
}

.article-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color, #eee);
}

.article-header h1 {
    font-size: 1.8rem;
    color: var(--text-color, #1a1a2e);
    margin-bottom: 15px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-muted, #666);
}

.article-meta .category a {
    color: var(--primary-color, #4a6cf7);
}

/* Article Content */
.article-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-color, #333);
}

.article-content h2 {
    font-size: 1.4rem;
    margin: 30px 0 15px;
    color: var(--text-color, #1a1a2e);
}

.article-content h3 {
    font-size: 1.2rem;
    margin: 25px 0 12px;
    color: var(--text-color, #1a1a2e);
}

.article-content p {
    margin-bottom: 15px;
}

.article-content ul,
.article-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content pre {
    background: var(--code-bg, #1a1a2e);
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--button-radius, 8px);
    overflow-x: auto;
    margin: 20px 0;
}

.article-content code {
    background: var(--border-color, #f1f5f9);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

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

.article-content blockquote {
    border-left: 4px solid var(--primary-color, #4a6cf7);
    padding-left: 20px;
    margin: 20px 0;
    color: var(--text-muted, #555);
    font-style: italic;
}

.article-content img {
    border-radius: var(--button-radius, 8px);
    margin: 20px 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.article-content th,
.article-content td {
    padding: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    text-align: left;
}

.article-content th {
    background: var(--bg-color, #f8fafc);
    font-weight: 600;
}

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

.kb-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg, #fff);
    border-radius: 8px;
    overflow: hidden;
}

.kb-table th,
.kb-table td {
    padding: 12px 15px;
    border: 1px solid var(--border-color, #e2e8f0);
    text-align: left;
}

.kb-table thead th {
    background: var(--primary-color-light, rgba(74, 108, 247, 0.1));
    font-weight: 600;
    color: var(--text-color, #333);
}

.kb-table tbody tr:hover {
    background: var(--bg-color, #f8fafc);
}

/* Columns Block */
.kb-columns {
    display: grid;
    gap: 25px;
    margin: 25px 0;
}

.kb-columns.cols-2 {
    grid-template-columns: 1fr 1fr;
}

.kb-columns.cols-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 768px) {
    .kb-columns.cols-2,
    .kb-columns.cols-3 {
        grid-template-columns: 1fr;
    }
}

.kb-column {
    padding: 20px;
    background: var(--bg-color, #f8fafc);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
}

/* Sidebar */
.article-sidebar {
    background: var(--card-bg, #fff);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 90px;
    border: 1px solid var(--border-color, transparent);
}

.article-sidebar h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--text-color, #1a1a2e);
}

.related-list {
    list-style: none;
}

.related-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color, #f1f5f9);
}

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

.related-list a {
    color: var(--text-muted, #444);
    font-size: 0.95rem;
}

.related-list a:hover {
    color: var(--primary-color, #4a6cf7);
}

/* Sidebar Navigation */
.sidebar-empty {
    color: var(--text-muted, #888);
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 15px;
}

.sidebar-nav {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color, #f1f5f9);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    color: var(--text-muted, #555);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.sidebar-link:hover {
    background: var(--primary-color-light, rgba(74, 108, 247, 0.1));
    color: var(--primary-color, #4a6cf7);
}

.sidebar-link i {
    width: 18px;
    text-align: center;
}

/* Navigation */
.article-nav {
    margin-top: 30px;
}

.back-link {
    color: var(--text-muted, #666);
    font-weight: 500;
}

.back-link:hover {
    color: var(--primary-color, #4a6cf7);
}

.back-nav {
    margin-top: 30px;
}

/* Error Page */
.error-page {
    text-align: center;
    padding: 60px 20px;
}

.error-page h1 {
    font-size: 2rem;
    color: var(--text-color, #1a1a2e);
    margin-bottom: 15px;
}

.error-page p {
    color: var(--text-muted, #666);
    margin-bottom: 25px;
}

/* Button */
.btn {
    display: inline-block;
    padding: 12px 25px;
    background: var(--primary-color, #4a6cf7);
    color: #fff;
    border-radius: var(--button-radius, 8px);
    font-weight: 600;
    transition: background 0.2s, filter 0.2s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    filter: brightness(1.1);
    color: #fff;
}

/* No Content */
.no-content,
.no-results {
    text-align: center;
    padding: 40px;
    color: var(--text-muted, #666);
    background: var(--card-bg, #fff);
    border-radius: 10px;
}

/* Recent Section */
.recent-section {
    margin-top: 50px;
}

/* Footer */
.site-footer {
    background: var(--footer-bg, #1a1a2e);
    color: var(--footer-text, #888);
    padding: 30px 0;
    margin-top: auto;
    text-align: center;
    transition: background-color 0.3s;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.footer-copyright {
    font-size: 0.9rem;
}

.footer-text {
    font-size: 0.85rem;
    max-width: 600px;
}

.footer-support {
    font-size: 0.9rem;
}

.footer-support a {
    color: var(--primary-color, #4a6cf7);
}

.footer-support i {
    margin-right: 6px;
}

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

    .search-form {
        flex-direction: column;
        border-radius: 12px;
    }

    .search-form input {
        border-bottom: 1px solid var(--border-color, #eee);
    }

    .search-form button {
        border-radius: 0 0 12px 12px;
    }

    .article-full {
        padding: 25px;
    }

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

/* Block Content Styles */
.article-content figure.article-image {
    margin: 25px auto;
    text-align: center;
}

.article-content figure.article-image img {
    max-width: 100%;
    border-radius: var(--button-radius, 8px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.article-content figure.article-image figcaption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-muted, #666);
    font-style: italic;
}

/* Spacer Block */
.kb-spacer {
    width: 100%;
}

.kb-spacer-small {
    height: 20px;
}

.kb-spacer-medium {
    height: 40px;
}

.kb-spacer-large {
    height: 80px;
}

.kb-spacer-xlarge {
    height: 120px;
}

.article-content .code-block {
    background: var(--code-bg, #1e1e1e);
    border-radius: var(--button-radius, 8px);
    margin: 20px 0;
    overflow: hidden;
}

.article-content .code-block code {
    display: block;
    padding: 20px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    color: #d4d4d4;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: none;
}

/* .article-content .html-embed {
    margin: 20px 0;
    padding: 20px;
    background: var(--bg-color, #f8f9fa);
    border-radius: var(--button-radius, 8px);
    border: 1px solid var(--border-color, #e0e0e0);
} */

.article-content .html-embed iframe {
    max-width: 100%;
    border-radius: var(--button-radius, 8px);
}

/* Article Tags */
.article-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color, #eee);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.article-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    /* Fallback for browsers without color-mix */
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.3);
    text-decoration: none;
    transition: all 0.2s;
}

.article-tag:hover {
    background: rgba(99, 102, 241, 0.25);
    transform: translateY(-1px);
}

.article-tag i {
    font-size: 11px;
}

/* Support color-mix where available */
@supports (background: color-mix(in srgb, red 50%, blue)) {
    .article-tag {
        background: color-mix(in srgb, var(--tag-color, #6366f1) 15%, transparent);
        color: var(--tag-color, #6366f1);
        border: 1px solid color-mix(in srgb, var(--tag-color, #6366f1) 30%, transparent);
    }

    .article-tag:hover {
        background: color-mix(in srgb, var(--tag-color, #6366f1) 25%, transparent);
        color: var(--tag-color, #6366f1);
    }
}

/* Content Divider */
hr.kb-divider,
.article-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-color, #ddd), transparent);
    margin: 40px 0;
}

/* Maintenance Mode Page */
.maintenance-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color, #4a6cf7) 0%, var(--secondary-color, #6366f1) 100%);
    color: #fff;
    text-align: center;
    padding: 20px;
}

.maintenance-content {
    max-width: 500px;
}

.maintenance-content i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.maintenance-content h1 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.maintenance-content p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ================================================
   DARK MODE ENHANCEMENTS
   ================================================ */

/* Card and box shadows for dark mode */
body.dark-mode .category-card,
body.dark-mode .article-card,
body.dark-mode .card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Category icons */
body.dark-mode .category-icon {
    background: rgba(255, 255, 255, 0.1);
}

/* Search input */
body.dark-mode .search-input {
    background: var(--input-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

body.dark-mode .search-input::placeholder {
    color: var(--text-muted);
}

/* Buttons in dark mode */
body.dark-mode .btn {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Article content images */
body.dark-mode .article-content img {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* Code blocks already dark - ensure text is visible */
body.dark-mode .article-content .code-block {
    border: 1px solid var(--border-color);
}

/* Blockquotes */
body.dark-mode blockquote {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--primary-color);
}

/* Tables in dark mode */
body.dark-mode .kb-table {
    border-color: var(--border-color);
}

body.dark-mode .kb-table th {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

body.dark-mode .kb-table td {
    border-color: var(--border-color);
}

body.dark-mode .kb-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

/* Breadcrumb */
body.dark-mode .breadcrumb {
    color: var(--text-muted);
}

body.dark-mode .breadcrumb a {
    color: var(--text-muted);
}

/* Article feedback section */
body.dark-mode .article-feedback {
    background: var(--card-bg);
}

body.dark-mode .feedback-btn {
    background: var(--input-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

/* Sidebar */
body.dark-mode .article-sidebar {
    background: var(--card-bg);
}

body.dark-mode .related-list a {
    color: var(--text-color);
}

/* Empty states */
body.dark-mode .empty-state,
body.dark-mode .no-results {
    color: var(--text-muted);
}

/* Tag page */
body.dark-mode .tag-badge {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* ================================================
   MOBILE RESPONSIVE STYLES
   ================================================ */

/* Mobile Navigation */
@media (max-width: 768px) {
    /* Header */
    .site-header .container {
        height: 60px;
        padding: 0 15px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo-image {
        max-height: 35px;
    }

    .main-nav {
        gap: 5px;
    }

    .main-nav a {
        padding: 6px 10px;
        font-size: 0.9rem;
    }

    .main-nav a span,
    .main-nav a:not(.theme-toggle) {
        font-size: 0;
    }

    .main-nav a i {
        font-size: 1.1rem;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
    }

    /* Container */
    .container {
        padding: 0 15px;
    }

    /* Hero Section */
    .hero {
        padding: 30px 0;
    }

    .hero h1 {
        font-size: 1.6rem;
        margin-bottom: 10px;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .search-form {
        flex-direction: column;
        gap: 10px;
    }

    .search-input {
        width: 100%;
        padding: 12px 15px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .search-btn {
        width: 100%;
        padding: 12px;
    }

    /* Main Content */
    .main-content {
        padding: 20px 0;
    }

    /* Categories Grid */
    .categories-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .category-card {
        padding: 20px;
    }

    .category-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .category-card h3 {
        font-size: 1.1rem;
    }

    /* Article Cards */
    .articles-list {
        gap: 12px;
    }

    .article-card {
        padding: 15px;
    }

    .article-card h3 {
        font-size: 1rem;
    }

    /* Article Layout */
    .article-layout {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .article-sidebar {
        order: 2;
        padding: 20px;
    }

    /* Article Content */
    .article-full {
        padding: 20px;
    }

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

    .article-meta {
        flex-wrap: wrap;
        gap: 10px;
    }

    .article-content {
        font-size: 0.95rem;
    }

    .article-content h2 {
        font-size: 1.3rem;
    }

    .article-content h3 {
        font-size: 1.15rem;
    }

    /* Tables - horizontal scroll */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .kb-table {
        min-width: 500px;
    }

    /* Columns - stack on mobile */
    .kb-columns {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    /* Code blocks */
    .article-content .code-block code {
        font-size: 12px;
        padding: 15px;
    }

    /* Feedback section */
    .article-feedback {
        padding: 20px;
    }

    .feedback-buttons {
        flex-direction: column;
        gap: 10px;
    }

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

    /* Tags */
    .article-tags {
        gap: 6px;
    }

    .article-tag {
        padding: 5px 10px;
        font-size: 12px;
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }

    /* Footer */
    .site-footer {
        padding: 30px 0;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .footer-links {
        justify-content: center;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 5px;
    }

    .pagination a,
    .pagination span {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .hero h1 {
        font-size: 1.4rem;
    }

    .category-card {
        padding: 15px;
    }

    .category-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .article-full {
        padding: 15px;
    }

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

    .main-nav a:not(.theme-toggle) i {
        display: none;
    }

    .main-nav a:not(.theme-toggle)::before {
        content: '';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
    }
}

/* Tablet landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    .categories-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .article-layout {
        gap: 20px;
    }

    .article-sidebar {
        padding: 20px;
    }
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
    .main-nav a,
    .btn,
    .category-card,
    .article-card,
    .feedback-btn {
        min-height: 44px;
    }

    .article-card {
        padding: 16px;
    }
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .article-sidebar,
    .article-feedback,
    .breadcrumb,
    .theme-toggle {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .article-full {
        box-shadow: none;
        padding: 0;
    }

    .article-content a {
        text-decoration: underline;
    }

    .article-content a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}
