/* User Search System - Minimal Styles */

/* Header Search Button (matches notification button style) */
.header-icon-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Search Modal (matches notification center style) */
.user-search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 10000;
    justify-content: center;
    align-items: flex-start;
    padding-top: 80px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.user-search-modal.active {
    opacity: 1;
}

.search-modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 2px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.user-search-modal.active .search-modal-content {
    transform: translateY(0);
}

.search-modal-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    padding: 1.25rem 1.5rem;
    border-radius: 14px 14px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.search-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.close-search-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.close-search-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Search Input */
.search-input-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.search-input-container .search-icon {
    color: #667eea;
    font-size: 1.2rem;
}

#userSearchInput {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    outline: none;
    color: #333;
}

#userSearchInput::placeholder {
    color: #999;
}

.search-loading {
    color: #667eea;
    font-size: 1.2rem;
}

/* Search Results */
.search-results {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 14px 14px;
    overflow-y: auto;
    max-height: 50vh;
    min-height: 200px;
}

.search-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    color: #999;
    text-align: center;
}

.search-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.search-empty-state p {
    margin: 0;
    font-size: 1rem;
}

/* Search Result Item */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

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

.search-result-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.result-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    flex-shrink: 0;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-meta {
    font-size: 0.9rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.result-meta i {
    font-size: 0.85rem;
}

.friend-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.result-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #666;
}

.stat-item i {
    color: #667eea;
    font-size: 0.8rem;
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.result-btn {
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.result-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.result-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.result-btn.secondary {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 0.6rem 0.75rem;
}

.result-btn.secondary:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

/* Icon-only action buttons */
.result-action-btn.icon-only {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: #f3f4f6;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.result-action-btn.icon-only:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.result-action-btn.icon-only.danger:hover {
    background: #ef4444;
    color: white;
}

.result-action-btn.icon-only.favorited {
    background: #fef3c7;
    color: #f59e0b;
}

.result-action-btn.icon-only.favorited:hover {
    background: #fbbf24;
    color: white;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .user-search-modal {
        padding-top: 60px;
    }
    
    .search-modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .search-modal-header h3 {
        font-size: 1.1rem;
    }
    
    .search-result-item {
        padding: 0.875rem 1rem;
        gap: 0.75rem;
    }
    
    .result-avatar {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .result-name {
        font-size: 1rem;
    }
    
    .result-meta {
        font-size: 0.85rem;
    }
    
    .result-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .result-btn i {
        font-size: 0.9rem;
    }
    
    /* Stack buttons on very small screens */
    @media (max-width: 480px) {
        .result-actions {
            flex-direction: column;
            width: auto;
        }
        
        .result-btn {
            width: 100%;
            justify-content: center;
        }
    }
}

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

.search-results::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 0 0 14px 0;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* ==========================================
   DARK MODE STYLES
   ========================================== */
[data-theme="dark"] .search-input-container {
    background: #1e293b;
}

[data-theme="dark"] .search-input-container .search-icon {
    color: #818cf8;
}

[data-theme="dark"] #userSearchInput {
    color: #e2e8f0;
}

[data-theme="dark"] #userSearchInput::placeholder {
    color: #64748b;
}

[data-theme="dark"] .search-results {
    background: #1e293b;
}

[data-theme="dark"] .search-empty-state {
    color: #64748b;
}

[data-theme="dark"] .search-result-item {
    border-bottom-color: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .search-result-item:hover {
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .result-name {
    color: #e2e8f0;
}

[data-theme="dark"] .result-meta {
    color: #94a3b8;
}

[data-theme="dark"] .stat-item {
    color: #94a3b8;
}

[data-theme="dark"] .stat-item i {
    color: #818cf8;
}

[data-theme="dark"] .result-action-btn.icon-only {
    background: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .result-action-btn.icon-only:hover {
    background: #6366f1;
    color: white;
}

[data-theme="dark"] .result-action-btn.icon-only.danger:hover {
    background: #ef4444;
}

[data-theme="dark"] .result-action-btn.icon-only.favorited {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

[data-theme="dark"] .result-action-btn.icon-only.favorited:hover {
    background: #fbbf24;
    color: #1e293b;
}

[data-theme="dark"] .search-results::-webkit-scrollbar-track {
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .search-results::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] .search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.6);
}
