/* Search Component Styles - Professional Glassmorphism Design */

/* Toggle Button */
.search-toggle-btn {
    position: absolute;
    top: 10px;
    right: 90px;
    /* Adjusted to avoid overlapping with layer control */
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
}

.search-toggle-btn:hover {
    background: #f8f8f8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.search-toggle-btn i {
    font-size: 18px;
}

/* Sidebar Panel */
.search-panel {
    position: fixed;
    top: 0;
    right: -400px;
    /* Hidden default */
    width: 380px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: right 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(0, 0, 0, 0.05);
}

.search-panel.active {
    right: 0;
}

/* Header */
.search-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-header h3 {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.close-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #888;
    transition: color 0.2s;
    padding: 5px;
}

.close-search-btn:hover {
    color: #333;
}

/* Search Input Area */
.search-input-wrapper {
    padding: 20px 24px;
    background: rgba(249, 250, 251, 0.5);
}

/* Filters Section */
.search-filters {
    padding: 16px 24px;
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.filters-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
}

.clear-filters-btn {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.clear-filters-btn:hover {
    background: rgba(59, 130, 246, 0.1);
}

.clear-filters-btn:disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

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

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    background: white;
    cursor: pointer;
    font-family: inherit;
    color: #333;
}

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

.filter-select:hover {
    border-color: #d1d5db;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    /* Space for icon */
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    background: white;
    box-sizing: border-box;
    font-family: inherit;
}

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

.search-icon-placeholder {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
}

/* Results Content */
.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 0 10px;
}

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

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

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

/* Result Groups */
.result-group {
    margin: 15px 14px;
}

.result-group-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    margin-bottom: 8px;
    padding-left: 8px;
    font-weight: 600;
}

/* Individual Result Item */
.result-item {
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    border: 1px solid #f3f4f6;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-item:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.result-main-text {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

.result-sub-text {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Empty State */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 14px;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    animation: slideIn 0.3s ease forwards;
}

/* Highlighted Text */
.highlight {
    background-color: rgba(255, 255, 0, 0.4);
    border-radius: 2px;
    padding: 0 1px;
    color: inherit;
    font-weight: inherit;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .search-panel {
        width: 100%;
        right: -100%;
    }

    .search-toggle-btn {
        right: 10px;
        top: 60px;
        /* Below zoom controls often */
    }
}