/**
 * Frontend styles for Gar's Knowledge Base
 */

/* Container and Layout */
.gars-kb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.gars-kb-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Header Section */
.gars-kb-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 60px 40px;
    text-align: center;
}

.kb-header-content {
    max-width: 800px;
    margin: 0 auto;
}

.kb-title {
    font-size: 3rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.kb-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin: 0 0 40px 0;
    line-height: 1.6;
}

/* Search Form */
.kb-search-form {
    max-width: 500px;
    margin: 0 auto;
}

.search-input-group {
    display: flex;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.kb-search-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    font-size: 16px;
    outline: none;
}

.kb-search-button {
    background: #2c3e50;
    color: #fff;
    border: none;
    padding: 15px 25px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}

.kb-search-button:hover {
    background: #34495e;
}

/* Breadcrumbs */
.kb-breadcrumbs {
    padding: 20px 40px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

.kb-breadcrumbs a {
    color: #007cba;
    text-decoration: none;
}

.kb-breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #6c757d;
}

.kb-breadcrumbs .current {
    color: #6c757d;
    font-weight: 500;
}

/* Section Titles */
.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 30px 0;
    color: #2c3e50;
    text-align: center;
}

/* Categories Grid */
.kb-categories-section {
    padding: 60px 40px;
}

.kb-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.kb-category-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.kb-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.category-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.category-thumbnail {
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.category-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.default-thumbnail {
    color: #6c757d;
    font-size: 48px;
}

.category-info {
    padding: 25px;
}

.category-name {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.category-description {
    color: #6c757d;
    line-height: 1.6;
    margin: 0 0 15px 0;
}

.category-stats {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #007cba;
}

.subcategories {
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.subcategories h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subcategory-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.subcategory-list a {
    background: #fff;
    color: #007cba;
    padding: 5px 12px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 13px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.subcategory-list a:hover {
    background: #007cba;
    color: #fff;
}

/* Articles Grid and List */
.kb-featured-section,
.kb-popular-section {
    padding: 60px 40px;
    background: #f8f9fa;
}

.kb-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.kb-article-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.kb-article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.kb-article-card.featured {
    border: 2px solid #ffd700;
}

.article-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.article-thumbnail {
    height: 150px;
    background: #f8f9fa;
    overflow: hidden;
}

.article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-info {
    padding: 20px;
}

.article-category {
    background: #007cba;
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-bottom: 10px;
}

.article-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #2c3e50;
    line-height: 1.4;
}

.article-excerpt {
    color: #6c757d;
    line-height: 1.6;
    margin: 0 0 15px 0;
    font-size: 14px;
}

.article-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #6c757d;
    align-items: center;
}

.kb-articles-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.kb-article-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
}

.kb-article-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Article Page */
.kb-article {
    max-width: none;
}

.article-header {
    padding: 40px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.article-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #6c757d;
    flex-wrap: wrap;
}

.article-meta a {
    color: #007cba;
    text-decoration: none;
}

.article-meta a:hover {
    text-decoration: underline;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #2c3e50;
    line-height: 1.2;
}

.article-excerpt {
    font-size: 1.1rem;
    color: #6c757d;
    line-height: 1.6;
    margin: 0 0 30px 0;
    font-style: italic;
}

.article-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.action-button {
    background: #007cba;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.action-button:hover {
    background: #005a87;
    color: #fff;
}

.social-sharing {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: auto;
}

.social-sharing a {
    color: #6c757d;
    text-decoration: none;
    font-size: 12px;
    padding: 5px 10px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.social-sharing a:hover {
    background: #f8f9fa;
}

/* Article Body */
.article-body {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    padding: 40px;
}

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

.article-toc {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.toc-title {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin: 5px 0;
}

.toc-link {
    color: #007cba;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
}

.toc-link:hover {
    text-decoration: underline;
}

.toc-level-3 { padding-left: 15px; }
.toc-level-4 { padding-left: 30px; }
.toc-level-5 { padding-left: 45px; }
.toc-level-6 { padding-left: 60px; }

.article-content {
    line-height: 1.8;
    font-size: 16px;
    color: #2c3e50;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin: 30px 0 15px 0;
    color: #2c3e50;
    line-height: 1.3;
}

.article-content h1 { font-size: 2rem; }
.article-content h2 { font-size: 1.75rem; }
.article-content h3 { font-size: 1.5rem; }
.article-content h4 { font-size: 1.25rem; }
.article-content h5 { font-size: 1.1rem; }
.article-content h6 { font-size: 1rem; }

.article-content p {
    margin: 0 0 20px 0;
}

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

.article-content pre,
.article-content code {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.article-content code {
    padding: 2px 6px;
    font-size: 14px;
}

.article-content pre {
    padding: 15px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.5;
}

.article-content blockquote {
    border-left: 4px solid #007cba;
    padding: 15px 20px;
    margin: 20px 0;
    background: #f8f9fa;
    font-style: italic;
}

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

.article-content li {
    margin: 5px 0;
}

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

.article-content th,
.article-content td {
    border: 1px solid #e9ecef;
    padding: 12px;
    text-align: left;
}

.article-content th {
    background: #f8f9fa;
    font-weight: 600;
}

/* Article Rating */
.article-rating {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin-top: 40px;
    text-align: center;
}

.article-rating h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
}

.rating-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.rating-button {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.rating-button:hover {
    border-color: #007cba;
    background: #f8f9fa;
}

.rating-button.voted {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

.rating-count {
    font-weight: 600;
}

.rating-feedback {
    margin-top: 15px;
    padding: 15px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    color: #155724;
}

/* Sidebar */
.article-sidebar {
    min-width: 0;
}

.related-articles,
.article-info-box,
.quick-actions-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.related-articles h3,
.article-info-box h3,
.quick-actions-box h3 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.related-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

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

.related-link {
    text-decoration: none;
    color: inherit;
}

.related-link h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #007cba;
}

.related-link p {
    margin: 0;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
}

.info-list {
    margin: 0;
}

.info-list dt {
    font-weight: 600;
    color: #2c3e50;
    margin-top: 10px;
}

.info-list dt:first-child {
    margin-top: 0;
}

.info-list dd {
    margin: 5px 0;
    color: #6c757d;
}

.action-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.action-list li {
    margin-bottom: 10px;
}

.action-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #007cba;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

/* Override for better theme compatibility - use readable text color */
.gars-kb-content .quick-actions-box .action-link {
    color: #333333 !important;
}

.gars-kb-content .quick-actions-box .action-link:hover {
    color: #007cba !important;
    text-decoration: underline;
}

.action-link:hover {
    color: #005a87;
}

/* Quick Links */
.kb-quick-links {
    padding: 60px 40px;
    background: #2c3e50;
    color: #fff;
}

.kb-quick-links .section-title {
    color: #fff;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 30px 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.quick-link:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-3px);
    color: #fff;
}

.quick-link-icon {
    font-size: 2rem;
}

.quick-link-text {
    font-weight: 500;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 992px) {
    .article-body {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .kb-categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .kb-articles-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .gars-kb-container {
        padding: 10px;
    }
    
    .gars-kb-header {
        padding: 40px 20px;
    }
    
    .kb-title {
        font-size: 2rem;
    }
    
    .kb-subtitle {
        font-size: 1rem;
    }
    
    .search-input-group {
        flex-direction: column;
    }
    
    .kb-search-button {
        justify-content: center;
    }
    
    .kb-breadcrumbs,
    .article-header,
    .article-body,
    .kb-categories-section,
    .kb-featured-section,
    .kb-popular-section,
    .kb-quick-links {
        padding: 20px;
    }
    
    .article-title {
        font-size: 1.8rem;
    }
    
    .article-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .social-sharing {
        margin-left: 0;
        justify-content: center;
    }
    
    .rating-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .quick-links-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .kb-categories-grid,
    .kb-articles-grid {
        grid-template-columns: 1fr;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .category-stats {
        flex-direction: column;
        gap: 5px;
    }
}