/* SEARCH FUNCTIONALITY - Main search, sorting, and hashtag features */
.search-sort-section {
    background: white;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-container {
    position: relative;
    margin-bottom: 15px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 16px;
}

.posts-search-input {
    width: 100%;
    padding: 12px 45px 12px 45px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
    text-align: center;
}

.posts-search-input:focus {
    border-color: #007bff;
}

.clear-search-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    transition: color 0.3s;
}

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

.sort-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sort-container label {
    font-weight: 600;
    color: #333;
}

.sort-select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    background: white;
    transition: border-color 0.3s;
}

.sort-select:focus {
    border-color: #007bff;
}

/* Search Results */
#search-results-container {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-results-section {
    margin-bottom: 30px;
}

.search-results-section:last-child {
    margin-bottom: 0;
}

.search-results-section h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

.search-results-people {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.search-result-person {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
    color: inherit;
}

.search-result-person:hover {
    background: #e9e9e9;
}

.search-result-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.search-result-username {
    font-size: 14px;
    color: #666;
}

.search-results-posts {
    /* Posts will use existing post card styles */
}

.no-search-results {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Hashtag links in post content */
.hashtag-link {
    color: #1DA1F2;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.hashtag-link:hover {
    text-decoration: underline;
}

.search-results-hashtags,
.search-results-topics {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

/* Hashtags Tab */
.hashtags-header {
    text-align: center;
    margin-bottom: 30px;
}

.hashtags-header h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 15px;
}

.hashtags-search {
    max-width: 500px;
    margin: 0 auto;
}

.hashtags-search input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 15px;
    outline: none;
    text-align: center;
    transition: border-color 0.3s;
}

.hashtags-search input:focus {
    border-color: #007bff;
}

.hashtags-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px 0;
}

.hashtag-item {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hashtag-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    background: #f0f8ff;
}

.hashtag-name {
    font-weight: 600;
    color: #007bff;
    font-size: 16px;
}

.hashtag-count {
    background: #e9ecef;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.no-hashtags {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.hashtag-posts-header {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hashtag-back-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 15px;
    transition: background 0.3s;
}

.hashtag-back-button:hover {
    background: #0056b3;
}

.hashtag-posts-header h2 {
    font-size: 24px;
    color: #333;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .search-results-people {
        grid-template-columns: 1fr;
    }
    
    .hashtags-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .hashtag-item {
        padding: 12px 15px;
    }
}
