/* Grid Layout */
.kbb-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

.kbb-grid-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.kbb-grid-item:hover {
    transform: translateY(-5px);
}

.kbb-article-card {
    padding: 1.5rem;
}

.kbb-article-image {
    margin-bottom: 1rem;
}

.kbb-article-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.kbb-article-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin-bottom: 10px !important;
    margin-top: 0 !important;
    text-transform: none !important;
    line-height: 1.4 !important;
}

.kbb-article-title a {
    color: #333 !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

.kbb-article-title a:hover {
    color: var(--kbb-primary-color, #0073aa) !important;
    text-decoration: none;
}

/* Search Form */
#kbb-search-form {
    max-width: 1200px;
    margin: 2rem auto;
    position: relative;
}

#kbb-search-input {
    width: 100%;
    height: 56px;
    padding: 0 56px 0 24px;
    font-size: 1.1rem;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

#kbb-search-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

#kbb-search-input:focus {
    outline: none;
    border-color: var(--kbb-primary-color, #0073aa);
    box-shadow: 0 0 0 3px rgba(var(--kbb-primary-color-rgb, 0, 115, 170), 0.1);
}

#kbb-search-results {
    margin-top: 2rem;
    border-radius: 8px;
    display: none; /* Hide by default */
}

#kbb-search-results:not(:empty) {
    display: block; /* Only show when it has content */
}

/* List Layout */
.kbb-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

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

.kbb-list-item {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.kbb-list-content {
    display: flex;
    gap: 1.5rem;
}

.kbb-list-image {
    flex: 0 0 150px;
}

.kbb-list-text {
    flex: 1;
}

/* Accordion Layout */
.kbb-accordion-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.kbb-accordion-item {
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.kbb-accordion-trigger {
    width: 100%;
    padding: 1rem;
    background: #f8f9fa;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kbb-accordion-trigger h3 {
    margin: 0;
}

.kbb-accordion-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.kbb-accordion-item.active .kbb-accordion-icon {
    transform: rotate(45deg);
}

.kbb-accordion-content {
    display: none;
    padding: 1.5rem;
}

.kbb-accordion-item.active .kbb-accordion-content {
    display: block;
}

.kbb-accordion-image {
    margin-bottom: 1rem;
}

.kbb-accordion-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Search Results Styling */
.kbb-loading {
    text-align: center;
    padding: 1rem;
    color: #666;
}

.kbb-no-results,
.kbb-error {
    padding: 1rem;
    background: #f8f8f8;
    border-radius: 4px;
    text-align: center;
}

.kbb-error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.kbb-search-results-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.kbb-search-results-list li {
    position: relative;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.kbb-search-results-list h4 {
    margin: 0 0 0.5rem 0;
}

.kbb-search-results-list a {
    color: #0073aa;
    text-decoration: none;
}

.kbb-search-results-list a:hover {
    text-decoration: underline;
}

.kbb-post-type {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    background: #e9ecef;
    border-radius: 20px;
    color: #495057;
}

/* AI Response Styling */
.kbb-results-empty {
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.kbb-ai-response:empty {
    display: none;
}

.kbb-ai-response {
    background: #f8fafc;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.kbb-ai-answer {
    background: #fff;
    border: 1px solid #e3e8ef;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.kbb-ai-answer h3 {
    color: var(--kbb-primary-color, #0073aa);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.kbb-search-results h3 {
    margin-bottom: 1rem;
}

/* Knowledge Base Chat Interface */
.kbb-chat-interface {
    width: 100%;
    max-width: 800px;
    margin: 60px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.kbb-title {
    font-size: 2em;
    margin: auto;
    padding: 0 0 25px 0;
    color: #333;
    text-align: center;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
}

.kbb-title-icon {
    color: var(--kbb-primary-color, #0073aa);
    font-size: 1.8rem;
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
}

.kbb-title-text {
    display: inline-flex;
    align-items: center;
}

.kbb-custom-icon {
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
}

.kbb-input-wrapper {
    margin-bottom: 30px;
    position: relative;
    width: 100%;
}

.kbb-search-field {
    position: relative;
    width: 100%;
    display: block;
}

#kbb-search-input {
    width: 100%;
    height: 56px;
    padding: 0 56px 0 24px;
    font-size: 1.1rem;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

#kbb-search-input:focus {
    outline: none;
    border-color: var(--kbb-primary-color, #0073aa);
    box-shadow: 0 0 0 3px rgba(var(--kbb-primary-color-rgb, 0, 115, 170), 0.1);
}

#kbb-search-input::placeholder {
    color: #6b7280;
}

.kbb-search-icon-button {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    z-index: 2;
    border-radius: 12px;
}

.kbb-search-icon-button svg {
    width: 20px;
    height: 20px;
    color: #6b7280;
    transition: color 0.2s ease;
}

.kbb-search-icon-button:hover svg {
    color: var(--kbb-primary-color, #0073aa);
}

/* Starter Buttons */
.kbb-starter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
    width: 100%;
    justify-content: flex-start;
}

.kbb-starter-button {
    padding: 8px 16px;
    background-color: transparent;
    border: 1px solid var(--kbb-primary-color, #0073aa);
    color: #374151;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    font-weight: 500;
    white-space: nowrap;
}

.kbb-starter-button:hover,
.kbb-starter-button.active {
    background-color: var(--kbb-primary-color, #0073aa);
    border-color: var(--kbb-primary-color, #0073aa);
    color: white;
}

/* Search Results */
#kbb-search-results {
    min-height: 100px;
}

.kbb-response {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: none;
}

.kbb-cta-container {
    margin-top: 1.5rem;
}

.kbb-learn-more-container {
    margin-top: 1rem;
}

/* Content type tags */
.kbb-content-type {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kbb-search-results-list h3 {
    font-size: 18px;
    margin: 25px 0 15px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    font-weight: 600;
}

.kbb-result-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.kbb-result-item:last-child {
    border-bottom: none;
}

.kbb-result-item h4 {
    font-size: 16px;
    margin: 0 0 10px;
    font-weight: 600;
}

.kbb-result-item h4 a {
    color: #0073aa;
    text-decoration: none;
}

.kbb-result-item h4 a:hover {
    text-decoration: underline;
}

/* Disclaimer */
.kbb-disclaimer {
    margin-top: 20px;
    color: #666;
    font-size: 15px;
    line-height: 1.5;
}

/* Status Messages */
.kbb-no-results, 
.kbb-error {
    padding: 20px;
    background-color: #f8f8f8;
    border-left: 3px solid #ddd;
    margin: 20px 0;
    border-radius: 5px;
}

.kbb-error {
    border-left-color: #dc3232;
    background-color: #fef0f0;
}

.kbb-no-results {
    border-left-color: #ffb900;
    background-color: #fff9e8;
}

/* Loading Indicator */
.kbb-loading {
    display: none;
    text-align: center;
    margin: 25px 0;
}

.kbb-loading-spinner {
    display: inline-block;
    width: 35px;
    height: 35px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--kbb-primary-color, #0073aa);
    animation: kbb-spin 1s linear infinite;
}

@keyframes kbb-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    .kbb-input-wrapper {
        flex-direction: column;
    }
    
    #kbb-search-input {
        margin-bottom: 15px;
    }
    
    .kbb-search-button {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    
    .kbb-starter-buttons {
        justify-content: center;
    }
}

/* Crawl Progress Styles */
.kbb-progress-stats {
    margin-bottom: 15px;
}

.kbb-progress-stats p {
    margin: 5px 0;
}

.kbb-progress-bar-container {
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 4px;
    margin: 10px 0;
    overflow: hidden;
}

.kbb-progress-bar {
    background-color: var(--kbb-primary-color, #0073aa);
    height: 20px;
    border-radius: 4px;
    text-align: center;
    color: white;
    line-height: 20px;
    transition: width 0.5s ease-in-out;
}

#kbb_error_list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    background-color: #f9f9f9;
    font-size: 13px;
}

#kbb_error_list div {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

#kbb_error_list div:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

#kbb_current_url {
    word-break: break-all;
    font-family: monospace;
    font-size: 13px;
}

/* Vectorization Progress Styles */
.kbb-vectorize-progress-container {
    margin-top: 20px;
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

#kbb-vectorize-status {
    font-weight: 600;
}

.kbb-progress-stats {
    margin-bottom: 15px;
}

.kbb-progress-stats p {
    margin: 5px 0;
}

.kbb-progress-bar-container {
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 4px;
    margin: 10px 0;
    overflow: hidden;
}

.kbb-progress-bar {
    background-color: var(--kbb-primary-color, #0073aa);
    height: 20px;
    border-radius: 4px;
    text-align: center;
    color: white;
    line-height: 20px;
    transition: width 0.5s ease-in-out;
}

#kbb-vectorize-errors {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    background-color: #f9f9f9;
    font-size: 13px;
}

#kbb-vectorize-errors div {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

#kbb-vectorize-errors div:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* End Vectorization Progress Styles */

.kbb-result-excerpt {
    color: #555;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* CTA and action buttons */
.kbb-cta-button, 
.kbb-action-button {
    display: inline-block;
    background-color: var(--kbb-primary-color, #0073aa);
    color: white !important;
    border: none;
    padding: 10px 20px;
    border-radius: 2px;
    font-weight: 500;
    text-decoration: none !important;
    transition: background-color 0.2s ease;
}

.kbb-cta-button:hover, 
.kbb-action-button:hover {
    background-color: var(--kbb-primary-color-darker, #005a87);
    color: white !important;
    text-decoration: none !important;
}

/* Full-width template styles */
.kbb-full-width-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    background-color: #fff;
}

.kbb-full-width-content {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.kbb-page-content {
    margin: 0;
    padding: 0;
}

.entry-content {
    margin: 0;
    padding: 0;
    max-width: none;
}

/* Force theme to use full width */
body.page-template-full-width-template {
    background-color: #fff;
    margin: 0;
    padding: 0;
}

body.page-template-full-width-template .content-area,
body.page-template-full-width-template .site-content,
body.page-template-full-width-template .entry-content,
body.page-template-full-width-template #primary,
body.page-template-full-width-template #main {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide sidebar on full-width template */
body.page-template-full-width-template #secondary,
body.page-template-full-width-template .sidebar,
body.page-template-full-width-template .widget-area {
    display: none !important;
}

/* Responsive styles for the full-width template */
@media (max-width: 1200px) {
    .kbb-full-width-content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .kbb-full-width-content {
        padding: 1rem;
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .kbb-chat-interface {
        padding: 0 16px;
        margin: 40px auto;
    }

    .kbb-title {
        font-size: 1.8rem;
        margin-bottom: 24px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .kbb-title-icon {
        margin-bottom: 8px;
    }
}

/* Clean Template Specific Styles */
body.kbb-clean-template {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    min-height: 100vh !important;
}

body.kbb-clean-template .kbb-full-width-container,
body.kbb-clean-template .kbb-full-width-content,
body.kbb-clean-template .entry-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

body.kbb-clean-template .kbb-chat-interface {
    width: 100%;
    max-width: 800px;
    margin: 60px auto;
    padding: 0 20px;
}

/* Override any theme styles */
body.kbb-clean-template #page,
body.kbb-clean-template #main,
body.kbb-clean-template #primary,
body.kbb-clean-template #content,
body.kbb-clean-template .site,
body.kbb-clean-template .site-content,
body.kbb-clean-template .content-area {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

/* Hide all theme elements */
body.kbb-clean-template header,
body.kbb-clean-template footer,
body.kbb-clean-template .site-header,
body.kbb-clean-template .site-footer,
body.kbb-clean-template #masthead,
body.kbb-clean-template #colophon,
body.kbb-clean-template .header,
body.kbb-clean-template .footer,
body.kbb-clean-template #wpadminbar {
    display: none !important;
}

/* AI Enhanced Answer Styling */
.kbb-results-container {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 30px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.kbb-ai-answer-section {
    background-color: #fff;
    padding: 25px;
    border-radius: 6px;
    margin-bottom: 25px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kbb-ai-label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.kbb-ai-icon {
    color: var(--kbb-primary-color, #0073aa);
    margin-right: 8px;
    font-size: 16px;
}

.kbb-ai-content {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.kbb-buttons-container {
    display: flex;
    margin-top: 20px;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.kbb-cta-wrapper {
    flex: 0 0 auto;
}

.kbb-learn-more-wrapper {
    flex: 0 0 auto;
}

.kbb-cta-button {
    display: inline-block;
    background-color: var(--kbb-primary-color, #0073aa);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.kbb-cta-button:hover {
    background-color: #005a87;
    text-decoration: none;
}

.kbb-learn-more-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--kbb-primary-color, #0073aa);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.kbb-learn-more-link:hover {
    color: var(--kbb-primary-color-darker, #005a87);
    text-decoration: none;
}

.kbb-learn-more-link:after {
    content: "→";
    margin-left: 8px;
    font-size: 18px;
    line-height: 1;
}

/* Related Articles Styling */
.kbb-related-articles-section {
    margin-bottom: 20px;
}

.kbb-related-heading {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin-bottom: 15px !important;
    letter-spacing: 0.5px !important;
    text-transform: none !important;
    line-height: 1.4 !important;
}

.kbb-article-card {
    background-color: #fff;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.kbb-article-excerpt {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    margin-bottom: 15px;
}

.kbb-article-tag {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #c4c4c4;
    color: #000000 !important;
    padding: 4px 8px;
    border-radius: 20px; /* Fully rounded corners */
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}

/* Disclaimer Note */
.kbb-disclaimer-note {
    font-size: 12px;
    color: #718096;
    line-height: 1.5;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .kbb-buttons-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .kbb-learn-more-wrapper {
        margin-left: 0;
        margin-top: 10px;
    }
}

.kbb-hide-results {
    display: none !important;
}

.kbb-hide-results:not(:empty) {
    display: block !important;
    margin-top: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Replace with this simpler approach */
.kbb-has-results {
    display: block !important;
}

/* Fix the CSS color-mix for browsers that may not support it */
:root {
    --kbb-primary-color-darker: #005a87; /* Fallback darker shade */
}

/* No Results Styling with Support Buttons */
.kbb-no-results-container {
    background: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    margin: 2rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.kbb-no-results-message {
    font-size: 1.2rem;
    color: #4b5563;
    margin-bottom: 1rem;
    font-weight: 500;
}

.kbb-no-results-subtext {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.kbb-no-results-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.kbb-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 24px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.kbb-learn-more-button {
    background-color: transparent;
    color: var(--kbb-primary-color, #0073aa);
    border: 1px solid var(--kbb-primary-color, #0073aa);
}

.kbb-learn-more-button:hover {
    background-color: var(--kbb-primary-color, #0073aa);
    color: white;
}

@media (max-width: 640px) {
    .kbb-no-results-buttons {
        flex-direction: column;
    }
}

