/* Search Sidebar */
.search-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    /* Hidden by default */
    width: 320px;
    height: 100vh;
    background: #fff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.search-sidebar.active {
    left: 0;
}

.search-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.search-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
    padding: 5px;
}

.search-close:hover {
    color: #000;
}

.search-input-container {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.search-input-wrapper {
    position: relative;
}

#searchInput {
    width: 100%;
    padding: 10px 35px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

#searchInput:focus {
    border-color: #007bff;
}

.search-icon-input {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.search-result-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.result-page-info {
    font-size: 0.8rem;
    color: #007bff;
    margin-bottom: 4px;
    font-weight: 600;
}

.result-snippet {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-snippet b {
    background-color: #fff3cd;
    /* Highlight match */
    color: #333;
    font-weight: bold;
    padding: 0 2px;
    border-radius: 2px;
}

.search-status {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

/* Spinner */
.search-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Scrollbar */
.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.search-results::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}