/* ===================================
   GLOBAL SEARCH SYSTEM
   Phase 1 Implementation - January 2026
   =================================== */

/* Search Container */
.global-search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto 2rem;
    z-index: 1000;
}

/* Search Input Group */
.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.search-input-group:focus-within {
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
}

/* Search Icon */
.search-icon {
    position: absolute;
    left: 16px;
    color: #94a3b8;
    pointer-events: none;
    width: 20px;
    height: 20px;
}

/* Search Input */
#globalSearchInput {
    width: 100%;
    padding: 14px 140px 14px 48px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    color: #1e293b;
    background: transparent;
    outline: none;
}

#globalSearchInput::placeholder {
    color: #94a3b8;
}

/* Keyboard Shortcut Badge */
.search-shortcut {
    position: absolute;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    pointer-events: none;
}

/* Clear Button */
.search-clear-btn {
    position: absolute;
    right: 100px;
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    color: #64748b;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: none;
}

.search-clear-btn:hover {
    background: #e2e8f0;
    color: #475569;
}

.search-clear-btn.visible {
    display: block;
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 500px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
}

.search-results-dropdown.visible {
    display: block;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Loading State */
.search-loading {
    padding: 20px;
    text-align: center;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.search-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Search No Results */
.search-no-results {
    padding: 32px 20px;
    text-align: center;
    color: #64748b;
}

.search-no-results i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.search-no-results p {
    margin: 0;
    font-size: 15px;
}

/* Search Results Sections */
.search-results-section {
    border-bottom: 1px solid #f1f5f9;
}

.search-results-section:last-child {
    border-bottom: none;
}

.search-section-header {
    padding: 12px 16px;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-section-header i {
    width: 16px;
    height: 16px;
}

.search-section-count {
    margin-left: auto;
    background: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    color: #667eea;
}

/* Search Result Items */
.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    display: flex;
    align-items: start;
    gap: 12px;
}

.search-result-item:hover {
    background: #f8fafc;
    border-left-color: #667eea;
}

.search-result-item:active {
    background: #f1f5f9;
}

/* Result Item Icon */
.result-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.result-icon-music { background: #fef3c7; color: #f59e0b; }
.result-icon-scam { background: #fee2e2; color: #ef4444; }
.result-icon-job { background: #dbeafe; color: #3b82f6; }
.result-icon-pod { background: #e9d5ff; color: #a855f7; }
.result-icon-verification { background: #d1fae5; color: #10b981; }
.result-icon-withdrawal { background: #fecaca; color: #dc2626; }
.result-icon-competition { background: #fed7aa; color: #ea580c; }
.result-icon-user { background: #e0e7ff; color: #6366f1; }

/* Result Item Content */
.result-item-content {
    flex: 1;
    min-width: 0;
}

.result-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-item-meta {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.result-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
}

.result-meta-badge.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.result-meta-badge.status-approved {
    background: #d1fae5;
    color: #065f46;
}

.result-meta-badge.status-active {
    background: #dbeafe;
    color: #1e3a8a;
}

.result-meta-badge.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

/* Recent Searches Section */
.search-recent-section {
    padding: 12px 16px;
    background: #f8fafc;
}

.search-recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.search-recent-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.search-recent-clear {
    font-size: 12px;
    color: #667eea;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.search-recent-clear:hover {
    background: white;
}

.search-recent-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-recent-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: #475569;
}

.search-recent-item:hover {
    border-color: #667eea;
    background: #f8fafc;
}

.search-recent-item i {
    color: #94a3b8;
    width: 14px;
    height: 14px;
}

.search-recent-item .recent-text {
    flex: 1;
}

.search-recent-item .recent-remove {
    color: #cbd5e1;
    width: 16px;
    height: 16px;
    display: none;
}

.search-recent-item:hover .recent-remove {
    display: block;
}

/* Search Tips */
.search-tips {
    padding: 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.search-tips-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 8px;
}

.search-tips-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.search-tip-item {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-tip-item i {
    width: 14px;
    height: 14px;
    color: #94a3b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .global-search-container {
        max-width: 100%;
        margin: 0 0 1.5rem;
    }

    #globalSearchInput {
        padding: 12px 120px 12px 40px;
        font-size: 14px;
    }

    .search-icon {
        left: 12px;
        width: 18px;
        height: 18px;
    }

    .search-shortcut {
        display: none;
    }

    .search-clear-btn {
        right: 12px;
    }

    .search-results-dropdown {
        max-height: 400px;
    }

    .result-item-title {
        font-size: 13px;
    }

    .result-item-meta {
        font-size: 11px;
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    .search-input-group {
        background: #1e293b;
        border-color: #334155;
    }

    #globalSearchInput {
        color: #f1f5f9;
    }

    #globalSearchInput::placeholder {
        color: #64748b;
    }

    .search-results-dropdown {
        background: #1e293b;
        border-color: #334155;
    }

    .search-result-item:hover {
        background: #334155;
    }

    .result-item-title {
        color: #f1f5f9;
    }

    .result-item-meta {
        color: #94a3b8;
    }
}

/* Accessibility Enhancements */
.search-result-item:focus {
    outline: 2px solid #667eea;
    outline-offset: -2px;
}

/* Performance Optimization */
.search-results-dropdown {
    will-change: transform, opacity;
}

.search-result-item {
    will-change: background-color, border-color;
}

/* Print Styles */
@media print {
    .global-search-container {
        display: none;
    }
}
