/* ============================================
   DOCUMENTATION SEARCH (UNIQUE CLASSES)
   ============================================ */

.doc-search-wrapper {
    position: relative;
    width: 300px;
    margin: 0 20px;
}

@media (max-width: 992px) {
    .doc-search-wrapper {
        width: 100%;
        margin: 15px 0 0 0;
        order: 3;
    }
}

.doc-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 5px;
    transition: all 0.3s ease;
}

.doc-search-box:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.doc-search-icon {
    padding: 0 10px;
    color: #6b7280;
    font-size: 16px;
}

.doc-search-input {
    flex: 1;
    border: none;
    padding: 8px 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: transparent;
    min-width: 0;
}

.doc-search-input:focus {
    outline: none;
}

.doc-search-clear {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 10px;
    line-height: 1;
}

.doc-search-clear:hover {
    color: #6b7280;
}

.doc-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-top: 5px;
    max-height: 450px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

.doc-search-results.active {
    display: block;
    animation: docSearchFadeIn 0.2s ease;
}

@keyframes docSearchFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Search Result Items */
.doc-search-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.doc-search-item:hover {
    background-color: #f9fafb;
}

.doc-search-item:last-child {
    border-bottom: none;
}

.doc-search-item.active {
    background-color: rgba(59, 130, 246, 0.1);
}

.doc-search-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-search-title i {
    font-size: 12px;
    color: #3b82f6;
}

.doc-search-path {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}

.doc-search-excerpt {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.4;
}

.doc-search-highlight {
    background-color: #fef3c7;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* No Results */
.doc-search-no-results {
    padding: 30px 20px;
    text-align: center;
    color: #6b7280;
}

.doc-search-no-results i {
    font-size: 32px;
    margin-bottom: 10px;
    color: #d1d5db;
}

/* Search Stats */
.doc-search-stats {
    padding: 12px 15px;
    border-top: 1px solid #f3f4f6;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    background: #f9fafb;
}

/* Loading */
.doc-search-loading {
    padding: 20px;
    text-align: center;
    color: #6b7280;
}

.doc-search-loading i {
    animation: docSearchSpin 1s linear infinite;
    margin-right: 8px;
}

@keyframes docSearchSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .doc-search-results {
        position: fixed;
        top: 70px;
        left: 15px;
        right: 15px;
        max-height: calc(100vh - 100px);
        z-index: 9999;
    }
}
/* Enhanced Search Results */
.search-section-group {
    margin-bottom: 20px;
}

.search-section-title {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: 10px 15px;
    font-weight: 600;
    color: #374151;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid #3b82f6;
}

.search-section-title i {
    color: #3b82f6;
    font-size: 14px;
}

.section-result-count {
    margin-left: auto;
    background: #3b82f6;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.result-type {
    margin-left: auto;
    font-size: 10px;
    background: #e5e7eb;
    padding: 2px 8px;
    border-radius: 10px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-meta {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    font-size: 11px;
    color: #9ca3af;
}

.word-count:before {
    content: "📝 ";
    opacity: 0.7;
}

.occurrences:before {
    content: "🔍 ";
    opacity: 0.7;
}

.quick-search {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 5px 10px;
    margin: 3px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-search:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

/* Highlight all occurrences */
.doc-search-highlight {
    background-color: #fef3c7;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
    animation: highlight-pulse 0.5s ease;
}

@keyframes highlight-pulse {
    0% { background-color: #fef3c7; }
    50% { background-color: #fde68a; }
    100% { background-color: #fef3c7; }
}

/* Multiple highlight colors for different terms */
.doc-search-highlight:nth-of-type(odd) {
    background-color: #dbeafe;
}

.doc-search-highlight:nth-of-type(even) {
    background-color: #fef3c7;
}

/* Search stats enhancements */
.doc-search-stats {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 2px solid #e2e8f0;
    padding: 12px 15px;
    font-size: 12px;
    color: #64748b;
    text-align: center;
    border-radius: 0 0 8px 8px;
}

/* Loading animation */
.doc-search-loading i {
    animation: spin 1s linear infinite;
    margin-right: 10px;
    color: #3b82f6;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



/* Enhanced Search Results */
.search-results-enhanced {
    padding: 10px;
}

.search-result-enhanced {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #f8f9fa;
}

.search-result-enhanced:hover {
    background: #e9ecef;
    transform: translateX(3px);
}

.result-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
}

.result-type {
    background: #3b82f6;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
}

.result-occurrences {
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
}

.result-content {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.result-footer {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #6c757d;
}

.result-section {
    font-weight: 600;
}

.search-stats-enhanced {
    padding: 10px;
    background: #e9ecef;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
    border-top: 2px solid #3b82f6;
}