/* Knowledgebase Plugin Frontend Styles */

.knowledgebase-container {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header Section */
.knowledgebase-header {
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}

.knowledgebase-search-row {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
}

.knowledgebase-search-bar {
    flex: 1;
}

.knowledgebase-search-bar input[type="text"] {
    width: 100%;
    max-width: 500px;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>') no-repeat 15px center;
    background-size: 16px 16px;
    padding-left: 45px;
}

.knowledgebase-search-bar input[type="text"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.knowledgebase-sort {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.knowledgebase-sort label {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

.knowledgebase-sort select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    min-width: 120px;
}

/* Content Layout */
.knowledgebase-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

.knowledgebase-main {
    min-height: 400px;
}

.knowledgebase-results-info {
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.results-count {
    font-weight: 600;
    color: #333;
}

/* Posts Grid */
.knowledgebase-posts {
    display: grid;
    gap: 30px;
}

.knowledgebase-posts.loading {
    opacity: 0.6;
    pointer-events: none;
}

.knowledgebase-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    transition: box-shadow 0.3s ease;
}

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

.card-image img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    color: #666;
}

.card-date {
    font-weight: 500;
}

.card-post-type,
.card-content-type {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-content-type {
    background: #e3f2fd;
    color: #1976d2;
}

.card-premium-badge {
    background: #b71c1c;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
}

.card-title a {
    color: #333;
    text-decoration: none;
}

.card-title a:hover {
    color: #0073aa;
}

.card-excerpt {
    color: #666;
    line-height: 1.6;
    font-size: 14px;
}

.card-taxonomies {
    margin-top: 10px;
}

.taxonomy-term {
    display: inline-block;
    background: #f8f9fa;
    color: #495057;
    padding: 4px 8px;
    margin: 2px 4px 2px 0;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.taxonomy-term:hover {
    background: #e9ecef;
}

/* Sidebar */
.knowledgebase-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 10px;
    border: 1px solid #e3e3e3;
    border-radius: 10px;
}

.knowledgebase-filters h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-group h4::after {
    content: '▼';
    font-size: 10px;
    color: #999;
}

.filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
}

.kb-apply-btn {
    background: #d42f7d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 20px;
}

.kb-apply-btn:hover {
    background: #ad1f62;
}

.kb-apply-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Sidebar Content */
.kb-branding h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.kb-tower-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kb-tower-btn {
    background: #582d64;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
}

.kb-tower-btn:hover {
    background: #ad1f62;
    transform: translateY(-1px);
}

.kb-tower-btn.active {
    background: #d42f7d;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.3);
}

.kb-tower-btn.active:hover {
    background: #1976d2;
}

.kb-tower-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading state for tower buttons */
.kb-tower-buttons.loading .kb-tower-btn {
    opacity: 0.6;
    pointer-events: none;
}

/* Pagination */
.knowledgebase-pagination {
    margin-top: 40px;
    text-align: center;
}

#knowledgebase-load-more {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#knowledgebase-load-more:hover {
    background: #e0e0e0;
}

/* Error and No Results */
.knowledgebase-no-results,
.knowledgebase-error {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .knowledgebase-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .knowledgebase-sidebar {
        order: -1;
    }
    
    .knowledgebase-search-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .knowledgebase-search-bar {
        order: 1;
    }
    
    .knowledgebase-sort {
        order: 2;
        justify-content: flex-start;
    }
    
    .knowledgebase-card {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .card-image img {
        height: 180px;
    }
    
    .kb-tower-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .knowledgebase-container {
        padding: 0 15px;
    }
    
    .knowledgebase-filter-tabs {
        width: 100%;
        justify-content: space-between;
    }
    
    .kb-filter-tab {
        flex: 1;
        text-align: center;
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .card-meta {
        font-size: 11px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .kb-tower-buttons {
        grid-template-columns: 1fr;
    }
}