/*
 * Knowledge Base Custom Styles
 * 
 * This file contains all the custom styles for the knowledge base functionality.
 * These styles are specifically designed to improve readability and user experience.
 */

/* === RESET & CLEANUP === */
body.knowledge-base-home * {
    box-sizing: border-box;
}

/* Remove all WordPress default spacing */
.knowledge-base-main,
.knowledge-base-main .wp-block-group,
.knowledge-base-main .wp-block-columns,
.knowledge-base-main .wp-block-column {
    margin: 0 !important;
    padding: 0 !important;
}

.wp-site-blocks {
    padding: 0 !important;
    margin: 0 !important;
}

/* === BASE STYLING === */
body.knowledge-base-home {
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    color: #111827;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.knowledge-base-main {
    background: #ffffff;
    min-height: 100vh;
}

/* === HERO SECTION === */
.kb-hero-section {
    padding: 80px 24px 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.kb-hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.05);
    z-index: 1;
}

.kb-hero-section > * {
    position: relative;
    z-index: 2;
}

.kb-main-title {
    font-size: 3.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 20px 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.kb-main-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 40px 0;
    font-weight: 400;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* === SEARCH BAR === */
.kb-search-wrapper {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.kb-main-search {
    width: 100%;
    max-width: 600px;
}

.kb-main-search .wp-block-search {
    position: relative;
    width: 100%;
    margin: 0;
    display: flex;
    justify-content: center;
}

.kb-main-search input[type="search"] {
    width: 100%;
    max-width: 600px;
    padding: 16px 60px 16px 24px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    outline: none;
    text-align: left;
    color: #374151;
}

.kb-main-search input[type="search"]::placeholder {
    color: #9ca3af;
    font-size: 15px;
}

.kb-main-search input[type="search"]:focus {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15), 0 12px 40px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.kb-main-search .wp-block-search__button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50px;
    width: 44px;
    height: 44px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.kb-main-search .wp-block-search__button:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.kb-main-search .wp-block-search__button svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* === DOCUMENTATION SECTION === */
.kb-docs-section {
    padding: 60px 24px;
    background: #f8fafc;
    width: 100%;
}

.kb-docs-heading {
    font-size: 2.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px 0;
    text-align: center;
    line-height: 1.3;
}

.kb-docs-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    margin: 0 0 48px 0;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Hide any weDocs search elements */
.wedocs-search-wrap,
.wedocs-shortcode-wrap .search-form,
.wedocs-shortcode-wrap .wedocs-search {
    display: none;
}

.kb-wedocs-content .wedocs-shortcode-wrap {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* === IMPROVED CARD STYLING === */
.wedocs-shortcode-wrap > div,
.wedocs-docs-list,
.wedocs-docs-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 28px;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.wedocs-docs-single,
.wedocs-single-doc,
.wedocs-shortcode-wrap .wedocs-doc-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 32px;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.03), 0 1px 3px rgba(0,0,0,0.08);
    position: relative;
    height: auto;
    min-height: 200px;
    overflow: hidden;
}

.wedocs-docs-single::before,
.wedocs-single-doc::before,
.wedocs-shortcode-wrap .wedocs-doc-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wedocs-docs-single:hover,
.wedocs-single-doc:hover,
.wedocs-shortcode-wrap .wedocs-doc-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px rgba(0,0,0,0.1), 0 8px 15px rgba(0,0,0,0.08);
    border-color: #cbd5e0;
}

.wedocs-docs-single:hover::before,
.wedocs-single-doc:hover::before,
.wedocs-shortcode-wrap .wedocs-doc-item:hover::before {
    opacity: 1;
}

/* === IMPROVED CARD CONTENT STYLING === */
.wedocs-docs-single h3,
.wedocs-docs-single .wedocs-doc-title,
.wedocs-single-doc h3,
.wedocs-single-doc .wedocs-doc-title {
    color: #111827;
    font-size: 1.375rem;
    font-weight: 600;
    margin: 0 0 16px 0;
    line-height: 1.4;
    text-decoration: none;
}

.wedocs-docs-single p,
.wedocs-docs-single .wedocs-doc-excerpt,
.wedocs-single-doc p,
.wedocs-single-doc .wedocs-doc-excerpt {
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.7;
    margin: 0 0 24px 0;
    text-decoration: none;
}

/* === IMPROVED LINK STYLING === */
.wedocs-docs-single a,
.wedocs-docs-single .wedocs-doc-link,
.wedocs-single-doc a,
.wedocs-single-doc .wedocs-doc-link {
    color: #3b82f6;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    vertical-align: middle;
}

.wedocs-docs-single a:hover,
.wedocs-single-doc a:hover {
    color: #2563eb;
}

.wedocs-docs-single a::after,
.wedocs-single-doc a::after {
    content: "→";
    font-size: 0.95rem;
    line-height: 1;
    transition: transform 0.15s ease;
    display: inline-block;
    vertical-align: middle;
}

.wedocs-docs-single a:hover::after,
.wedocs-single-doc a:hover::after {
    transform: translateX(4px);
}

/* === IMPROVED HELP SECTION === */
.kb-help-section {
    padding: 60px 24px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
}

.kb-help-heading {
    font-size: 2.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px 0;
    text-align: center;
    line-height: 1.3;
}

.kb-help-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    margin: 0 0 48px 0;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.kb-help-columns {
    gap: 28px;
    max-width: 1000px;
    margin: 0 auto;
}

.kb-help-columns .wp-block-column {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 16px;
    padding: 36px 28px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.03), 0 1px 3px rgba(0,0,0,0.08);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.kb-help-columns .wp-block-column::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.08);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kb-help-columns .wp-block-column:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px rgba(0,0,0,0.1), 0 8px 15px rgba(0,0,0,0.08);
}

.kb-help-columns .wp-block-column:hover::before {
    opacity: 1;
}

.kb-help-icon {
    font-size: 2.5rem;
    margin: 0 0 16px 0;
    line-height: 1;
    position: relative;
    z-index: 2;
}

.kb-help-item-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 12px 0;
    position: relative;
    z-index: 2;
    line-height: 1.4;
}

.kb-help-item-desc {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .kb-hero-section {
        padding: 60px 20px 80px;
    }
    
    .kb-main-title {
        font-size: 2.5rem;
        line-height: 1.3;
        margin-bottom: 16px;
    }
    
    .kb-main-subtitle {
        font-size: 1.125rem;
        margin: 0 0 32px 0;
        padding: 0 10px;
    }
    
    .kb-search-wrapper,
    .kb-main-search {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .kb-main-search input[type="search"] {
        padding: 14px 50px 14px 20px;
        font-size: 16px;
    }
    
    .kb-main-search .wp-block-search__button {
        width: 40px;
        height: 40px;
        right: 5px;
    }
    
    .kb-docs-section,
    .kb-help-section {
        padding: 40px 20px;
    }
    
    .kb-docs-heading,
    .kb-help-heading {
        font-size: 1.875rem;
        margin-bottom: 12px;
    }
    
    .kb-docs-subtitle,
    .kb-help-subtitle {
        font-size: 1rem;
        margin-bottom: 36px;
        padding: 0 10px;
    }
    
    .wedocs-shortcode-wrap > div,
    .wedocs-docs-list {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .wedocs-docs-single,
    .wedocs-single-doc {
        padding: 28px 24px;
        min-height: 160px;
    }
    
    .kb-help-columns {
        flex-direction: column;
        gap: 20px;
    }
    
    .kb-help-columns .wp-block-column {
        margin-bottom: 0;
        min-height: 150px;
        padding: 28px 24px;
    }
}

@media (max-width: 480px) {
    .kb-main-title {
        font-size: 2.25rem;
    }
    
    .kb-main-subtitle {
        font-size: 1rem;
        padding: 0 5px;
    }
    
    .kb-docs-heading,
    .kb-help-heading {
        font-size: 1.75rem;
    }
    
    .wedocs-docs-single,
    .wedocs-single-doc {
        padding: 24px 20px;
    }
}

/* === CLEANUP === */
.wedocs-shortcode-wrap .wedocs-breadcrumbs,
.wedocs-shortcode-wrap .wedocs-docs-archive-nav,
.wedocs-shortcode-wrap .wedocs-pagination {
    display: none;
}

.wedocs-shortcode-wrap img {
    display: none;
}

/* Additional cleanup for any remaining weDocs elements */
.wedocs-shortcode-wrap > *:not(.wedocs-docs-list):not(.wedocs-docs-wrapper):not(.wedocs-docs-single) {
    display: none;
}