/**
 * Smart Search & Enhanced Comments CSS
 */

/* ================================
   SMART SEARCH INTERFACE
   ================================ */

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

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 16px;
    color: #64748b;
    z-index: 2;
    pointer-events: none;
}

.search-field {
    width: 100%;
    padding: 16px 50px 16px 50px !important;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

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

.search-clear {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 2;
}

.search-clear:hover {
    background: #f1f5f9;
    color: #64748b;
}

.search-submit {
    margin-left: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.search-submit:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.search-close {
    margin-left: 12px;
    padding: 16px;
    background: #f1f5f9;
    border: none;
    border-radius: 12px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-close:hover {
    background: #e2e8f0;
    color: #475569;
}

/* Search Suggestions Dropdown */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: 8px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 500px;
    overflow-y: auto;
}

.search-suggestions.show {
    opacity: 1;
    transform: translateY(0);
}

.suggestions-section {
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.suggestions-section:last-child {
    border-bottom: none;
}

.suggestions-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestions-title svg {
    color: #3b82f6;
}

/* Suggestions List */
.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    color: #374151;
}

.suggestion-item:hover,
.suggestion-item.highlighted {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
}

.suggestion-item svg {
    color: #94a3b8;
    flex-shrink: 0;
}

.suggestion-item:hover svg,
.suggestion-item.highlighted svg {
    color: #3b82f6;
}

.no-suggestions {
    padding: 20px;
    text-align: center;
    color: #94a3b8;
    font-style: italic;
}

/* Popular Topics */
.popular-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topic-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.3s ease;
}

.topic-tag:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Trending Searches */
.trending-searches {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trending-item:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.trending-item svg {
    color: #10b981;
    flex-shrink: 0;
}

.trending-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.trending-term {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
}

.trending-count {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* ================================
   ENHANCED COMMENTS
   ================================ */

.comment-author {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.user-level {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Level Colors */
.level-1, .level-2, .level-3 {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
}

.level-4, .level-5, .level-6, .level-7, .level-8, .level-9 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.level-10, .level-11, .level-12, .level-13, .level-14, .level-15 {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.level-16, .level-17, .level-18, .level-19, .level-20 {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.level-21, .level-22, .level-23, .level-24, .level-25 {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.user-level svg {
    width: 10px;
    height: 10px;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.verified-badge svg {
    width: 12px;
    height: 12px;
}

/* Enhanced Reaction Buttons */
.reaction-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reaction-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.reaction-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-color: #3b82f6;
}

.reaction-count {
    background: rgba(0, 0, 0, 0.1);
    color: inherit;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 4px;
}

.reaction-btn.active .reaction-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Dark Mode */
body.dark-mode .search-field {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-mode .search-field:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

body.dark-mode .search-suggestions {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .suggestions-section {
    border-bottom-color: #334155;
}

body.dark-mode .suggestions-title {
    color: #cbd5e1;
}

body.dark-mode .suggestion-item {
    color: #e2e8f0;
}

body.dark-mode .suggestion-item:hover,
body.dark-mode .suggestion-item.highlighted {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

body.dark-mode .topic-tag {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

body.dark-mode .topic-tag:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: white;
}

body.dark-mode .trending-term {
    color: #e2e8f0;
}

body.dark-mode .trending-count {
    color: #94a3b8;
}

body.dark-mode .reaction-btn {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

body.dark-mode .reaction-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #60a5fa;
}

/* ================================
   COMMENT POLICY NOTICE
   ================================ */

.comment-policy-notice {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 0.85rem;
}

.comment-policy-notice small {
    color: #92400e;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.comment-policy-notice strong {
    color: #78350f;
    font-weight: 700;
}

/* Dark mode for policy notice */
body.dark-mode .comment-policy-notice {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border-color: #3b82f6;
}

body.dark-mode .comment-policy-notice small {
    color: #cbd5e1;
}

body.dark-mode .comment-policy-notice strong {
    color: #f1f5f9;
}

/* Responsive */
@media (max-width: 768px) {
    .search-suggestions {
        left: -20px;
        right: -20px;
        margin-top: 12px;
    }
    
    .suggestions-section {
        padding: 16px;
    }
    
    .popular-topics {
        gap: 6px;
    }
    
    .topic-tag {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .comment-author {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .user-level,
    .verified-badge {
        font-size: 0.65rem;
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    .search-field {
        padding: 14px 45px 14px 45px !important;
        font-size: 0.95rem;
    }
    
    .search-submit,
    .search-close {
        padding: 14px;
    }
    
    .search-icon {
        left: 14px;
    }
    
    .search-clear {
        right: 14px;
    }
}
