/* ===========================================
   Guide Module — Clean, modern documentation UI
   Self-contained styles (no external variable deps)
   =========================================== */

/* Hero section on index page */
.guide-hero {
    background: linear-gradient(135deg, #1a1d22 0%, #2a2e34 50%, #3d424a 100%);
    color: #fff;
    padding: 48px 32px;
    border-radius: 12px;
    margin-bottom: 32px;
    text-align: center;
    border-bottom: 3px solid #d63031;
}
.guide-hero h1 {
    margin: 0 0 12px 0;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}
.guide-hero h1 i {
    color: #d63031;
    margin-right: 8px;
}
.guide-hero p {
    margin: 0;
    font-size: 16px;
    color: rgba(255,255,255,0.75);
}

/* Category cards grid */
.guide-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}
.guide-category-card {
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 12px;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}
.guide-category-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-3px);
    border-color: #d63031;
}
.guide-category-card > a {
    display: block;
    padding: 24px;
    color: inherit;
    text-decoration: none;
}
.guide-category-icon {
    width: 48px;
    height: 48px;
    background: rgba(214, 48, 49, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 22px;
    color: #d63031;
}
.guide-category-card h3 {
    margin: 0 0 8px 0;
    font-size: 17px;
    font-weight: 600;
    color: #1a1d22;
    border-bottom: none;
}
.guide-category-card p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #6c737e;
    line-height: 1.5;
}
.guide-article-count {
    font-size: 13px;
    color: #adb2ba;
}
.guide-subcategories {
    list-style: none;
    margin: 0;
    padding: 8px 24px 16px;
    border-top: 1px solid #f0f1f3;
}
.guide-subcategories li {
    padding: 4px 0;
}
.guide-subcategories li a {
    color: #d63031;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.guide-subcategories li a:hover {
    color: #c0392b;
}
.guide-subcategories .badge {
    background: rgba(214, 48, 49, 0.1);
    color: #d63031;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 99px;
}

/* Two-column layout: sidebar + content */
.guide-layout {
    display: flex;
    min-height: 500px;
    gap: 0;
    margin: -24px;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

/* Sidebar */
.guide-sidebar {
    width: 260px;
    min-width: 260px;
    background: #f8f9fa;
    border-right: 1px solid #e2e4e8;
    padding: 0;
    overflow-y: auto;
}
.guide-sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e4e8;
    font-weight: 600;
}
.guide-sidebar-header a {
    color: #1a1d22;
    text-decoration: none;
    font-size: 15px;
}
.guide-sidebar-header a:hover {
    color: #d63031;
}
.guide-nav {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}
.guide-nav-group {
    margin-bottom: 2px;
}
.guide-nav-category {
    display: block;
    padding: 8px 20px;
    color: #3d424a;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s ease;
}
.guide-nav-category:hover {
    background: rgba(214, 48, 49, 0.05);
    color: #d63031;
    text-decoration: none;
}
.guide-nav-group.active > .guide-nav-category {
    color: #d63031;
    background: rgba(214, 48, 49, 0.08);
}
.guide-nav-sub,
.guide-nav-articles {
    list-style: none;
    margin: 0;
    padding: 0;
}
.guide-nav-sub li a,
.guide-nav-articles li a {
    display: block;
    padding: 5px 20px 5px 36px;
    color: #6c737e;
    text-decoration: none;
    font-size: 13px;
    border-left: 2px solid transparent;
    transition: all 0.15s ease;
}
.guide-nav-sub li a:hover,
.guide-nav-articles li a:hover {
    color: #d63031;
    background: rgba(214, 48, 49, 0.04);
    text-decoration: none;
}
.guide-nav-sub li.active a,
.guide-nav-articles li.active a {
    color: #d63031;
    border-left-color: #d63031;
    background: rgba(214, 48, 49, 0.08);
    font-weight: 500;
}

/* Main content area */
.guide-content {
    flex: 1;
    padding: 24px 32px;
    min-width: 0;
}

/* Breadcrumb */
.guide-breadcrumb {
    font-size: 13px;
    color: #adb2ba;
    margin-bottom: 16px;
}
.guide-breadcrumb a {
    color: #d63031;
    text-decoration: none;
}
.guide-breadcrumb a:hover {
    text-decoration: underline;
}
.guide-breadcrumb .separator {
    margin: 0 8px;
    color: #ccd0d5;
}

/* Category description */
.guide-category-desc {
    color: #6c737e;
    font-size: 15px;
    margin-bottom: 24px;
}

/* Article list in category view */
.guide-article-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.guide-article-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.guide-article-item:hover {
    border-color: #d63031;
    box-shadow: 0 2px 8px rgba(214, 48, 49, 0.12);
    text-decoration: none;
    color: inherit;
}
.guide-article-thumb {
    width: 80px;
    height: 80px;
    min-width: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f1f3;
}
.guide-article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.guide-article-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 28px;
    color: #ccd0d5;
}
.guide-article-info h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1d22;
    border-bottom: none;
}
.guide-article-info p {
    margin: 0 0 4px 0;
    font-size: 13px;
    color: #adb2ba;
    line-height: 1.4;
}

/* Article view */
.guide-article h1 {
    font-size: 26px;
    font-weight: 700;
    color: #1a1d22;
    margin: 0 0 12px 0;
    line-height: 1.3;
}
.guide-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 13px;
    color: #adb2ba;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f1f3;
}
.guide-article-meta .fas,
.guide-article-meta .far {
    margin-right: 4px;
}

/* Table of Contents */
.guide-toc {
    background: #fef9f9;
    border: 1px solid #f0d0d0;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
}
.guide-toc-title {
    font-weight: 600;
    font-size: 14px;
    color: #d63031;
    margin-bottom: 12px;
}
.guide-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.guide-toc li {
    padding: 3px 0;
}
.guide-toc li a {
    color: #555b64;
    text-decoration: none;
    font-size: 14px;
}
.guide-toc li a:hover {
    color: #d63031;
    text-decoration: underline;
}
.guide-toc li.guide-toc-sub {
    padding-left: 16px;
}
.guide-toc li.guide-toc-sub a {
    color: #adb2ba;
    font-size: 13px;
}

/* Article body content */
.guide-article-body {
    font-size: 15px;
    line-height: 1.8;
    color: #1a1d22;
}
.guide-article-body h2 {
    font-size: 22px;
    font-weight: 600;
    color: #1a1d22;
    margin: 32px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f1f3;
}
.guide-article-body h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1d22;
    margin: 24px 0 12px;
}
.guide-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 12px 0;
}
.guide-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}
.guide-article-body table th,
.guide-article-body table td {
    padding: 8px 12px;
    border: 1px solid #e2e4e8;
    text-align: left;
}
.guide-article-body table th {
    background: #f8f9fa;
    font-weight: 600;
}
.guide-article-body code {
    background: #f0f1f3;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 90%;
}
.guide-article-body blockquote {
    border-left: 4px solid #d63031;
    background: #fef9f9;
    padding: 12px 16px;
    margin: 16px 0;
    color: #555b64;
}
.guide-article-body ul, .guide-article-body ol {
    padding-left: 24px;
}
.guide-article-body li {
    margin-bottom: 4px;
}

/* Prev/Next navigation */
.guide-nav-prevnext {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #f0f1f3;
    gap: 16px;
}
.guide-nav-prev,
.guide-nav-next {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    border: 1px solid #e2e4e8;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    max-width: 48%;
}
.guide-nav-prev:hover,
.guide-nav-next:hover {
    border-color: #d63031;
    box-shadow: 0 2px 8px rgba(214, 48, 49, 0.1);
    text-decoration: none;
    color: inherit;
}
.guide-nav-prev small,
.guide-nav-next small {
    color: #adb2ba;
    font-size: 12px;
}
.guide-nav-prev span,
.guide-nav-next span {
    color: #d63031;
    font-weight: 500;
    font-size: 14px;
    margin-top: 2px;
}
.guide-nav-next {
    text-align: right;
    margin-left: auto;
}

/* Admin forms — consistent with rest of site */
.guide-form .form-group { margin-bottom: 16px; }
.guide-form .form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}
.guide-form .form-row > div { flex: 1; }

/* Manage page tables */
.guide-manage-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 991px) {
    .guide-layout {
        flex-direction: column;
        margin: -24px;
    }
    .guide-sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e4e8;
        max-height: 250px;
    }
    .guide-content {
        padding: 20px;
    }
}

@media (max-width: 767px) {
    .guide-hero {
        padding: 32px 20px;
    }
    .guide-hero h1 {
        font-size: 22px;
    }
    .guide-categories-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .guide-category-card > a {
        padding: 16px;
    }
    .guide-content {
        padding: 16px;
    }
    .guide-article h1 {
        font-size: 22px;
    }
    .guide-article-meta {
        gap: 12px;
    }
    .guide-article-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .guide-article-thumb {
        width: 100%;
        height: 120px;
    }
    .guide-nav-prevnext {
        flex-direction: column;
    }
    .guide-nav-prev,
    .guide-nav-next {
        max-width: 100%;
    }
    .guide-form .form-row {
        flex-direction: column;
        gap: 0;
    }
}
