/**
 * Knowledge Base Search Modal Styles
 * CSP Compliant - External CSS file
 * Previously injected via JavaScript inline style
 */

/* Modal Container */
.kb-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
}

.kb-search-modal.active {
    display: flex;
}

/* Modal Overlay */
.kb-search-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Modal Content */
.kb-search-modal-content {
    position: relative;
    width: 100%;
    max-width: 700px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    margin: 0 20px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.kb-search-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

/* Input Wrapper */
.kb-search-modal-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.kb-search-modal-input-wrapper > span:first-child {
    position: absolute;
    left: 15px;
    font-size: 20px;
    color: #9ca3af;
}

/* Search Input */
#modal-search-input {
    flex: 1;
    padding: 12px 50px 12px 45px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
}

#modal-search-input:focus {
    border-color: #0ebdf3;
}

/* Close Button */
.kb-search-modal-close {
    position: absolute;
    right: 5px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6b7280;
    font-size: 20px;
}

/* Category Chips Container */
.kb-search-modal-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

/* Individual Category Chip */
.kb-category-chip {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #e5e7eb;
    background: transparent;
    color: #4b5563;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kb-category-chip:hover {
    border-color: #0ebdf3;
    color: #0ebdf3;
}

.kb-category-chip.active {
    background: #0ebdf3;
    border-color: #0ebdf3;
    color: white;
}

/* Modal Body */
.kb-search-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Search Results Container */
.kb-search-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Results Header */
.kb-search-results-header {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

/* Individual Result Item */
.kb-search-result-item {
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kb-search-result-item:hover {
    background: #e0f2fe;
}

/* Result Category Badge */
.kb-search-result-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 3px 8px;
    background: #0ebdf3;
    color: white;
    border-radius: 4px;
    margin-bottom: 6px;
}

/* Result Title */
.kb-search-result-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

/* Result Preview Text */
.kb-search-result-preview {
    font-size: 14px;
    color: #6b7280;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Empty State */
.kb-search-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.kb-search-empty span {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

/* Pagination */
.kb-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.kb-pagination-btn {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kb-pagination-btn:hover:not(.disabled) {
    background: #f3f4f6;
    border-color: #0ebdf3;
}

.kb-pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.kb-pagination-info {
    color: #6b7280;
    font-size: 14px;
}

/* Detail Modal */
.kb-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.kb-detail-modal.active {
    display: flex;
}

.kb-detail-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.kb-detail-modal-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-height: 80vh;
    overflow-y: auto;
}

.kb-detail-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f3f4f6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    z-index: 10;
}

.kb-detail-modal-close:hover {
    background: #e5e7eb;
}

.kb-detail-modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.kb-detail-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 10px;
    background: #0ebdf3;
    color: white;
    border-radius: 4px;
    margin-bottom: 10px;
}

.kb-detail-modal-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.kb-detail-modal-body {
    padding: 30px;
    color: #4b5563;
    line-height: 1.7;
}

/* Responsive */
@media (max-width: 768px) {
    .kb-search-modal {
        padding-top: 60px;
    }

    .kb-search-modal-content {
        max-height: calc(100vh - 80px);
        margin: 0 10px;
    }

    .kb-detail-modal {
        padding: 10px;
    }

    .kb-detail-modal-header,
    .kb-detail-modal-body {
        padding: 20px;
    }
}
