/* Categorized Search Plugin Styles - CSP Prefix */
.csp-search-container {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

.csp-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 8px 12px;
    transition: all 0.3s ease;
}
span.title-search-nav {
    border-bottom: 3px solid #d50b2f;
    padding-bottom: 5px;
    width: auto;
}
.csp-search-input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#csp-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 12px;
    font-size: 14px;
    background: transparent;
    direction: rtl;
}

#csp-search-input::placeholder {
    color: #9ca3af;
    font-size: 13px;
}

.csp-search-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.csp-search-btn:hover {
    color: #3b82f6;
}

/* Search Results Dropdown */
.csp-search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 8px;
    display: none;
}

.csp-search-results-dropdown.csp-show {
    display: block;
}

/* Loading State */
.csp-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #6b7280;
}

.csp-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: csp-spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Category Sections */
.csp-result-category {
    border-bottom: 1px solid #f3f4f6;
}

.csp-result-category:last-child {
    border-bottom: none;
}

.csp-category-title {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;

}

.csp-category-icon {
    margin-left: 8px;
    font-size: 16px;
}

.csp-result-count {
    margin-right: auto;
    background: #e5e7eb;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Individual Result Items */
.csp-category-items {
    padding: 4px 0;
}

.csp-result-item {
    display: block;
    padding: 12px 16px;
    transition: background-color 0.2s ease;
    cursor: pointer;
    border-bottom: 1px solid #f9fafb;
    text-decoration: none;
    color: inherit;
}

.csp-result-item:hover {
    background-color: #f9fafb;
    text-decoration: none;
    color: inherit;
}

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

.csp-result-title {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin: 0;
    line-height: 1.4;
    direction: rtl;
    text-align: right;
}

.csp-result-item:hover .csp-result-title {
    color: #3b82f6;
}

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

.csp-no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.csp-no-results h4 {
    font-size: 16px;
    margin: 0 0 8px 0;
    color: #374151;
}

.csp-no-results p {
    font-size: 14px;
    margin: 0;
}

/* Highlight search terms */
.csp-result-title mark {
    background: #fef3c7;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .csp-search-container {
        max-width: 100%;
    }
    
    .csp-search-results-dropdown {
        max-height: 300px;
    }
    
    .csp-result-item {
        padding: 10px 12px;
    }
    
    .csp-result-title {
        font-size: 13px;
    }
    
    .csp-category-title {
        font-size: 13px;
        padding: 10px 12px;
    }
}