/* Search Page Styles */
.search-page-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: white;
    height: 100vh;
    height: auto;
    position: relative;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .search-page-container {
        background-color: #101010;
    }
    
    .search-header {
        background-color: rgba(16, 16, 16, 0.7);
        border-bottom-color: rgba(56, 68, 77, 0.7);
    }
    
    .search-input-container {
        background-color: rgba(32, 35, 39, 0.85);
    }
    
    .search-input-container.focused {
        background-color: #101010;
        border-color: #1877F2;
    }
    
    .search-input {
        color: #e7e9ea;
    }
    
    .search-input::placeholder {
        color: #71767b;
    }
    
    .search-tabs {
        border-bottom-color: #2f3336;
    }
    
    .search-tab {
        color: #71767b;
    }
    
    .search-tab.active {
        color: #e7e9ea;
    }
    
    .section-title {
        color: #e7e9ea;
    }
    
    .trending-post:hover {
        background-color: #1a1a1a;
    }
    
    .trending-category,
    .trending-more,
    .trending-stats,
    .trending-author-info,
    .trending-location {
        color: #71767b;
    }
    
    .trending-title {
        color: #e7e9ea;
    }
    
    .who-to-follow-item,
    .search-person-item {
        border-bottom-color: #2f3336;
    }
    
    .follow-name,
    .search-person-name {
        color: #e7e9ea;
    }
    
    .follow-handle,
    .search-person-username {
        color: #71767b;
    }
    
    .follow-avatar,
    .search-person-avatar {
        background-color: #2f3336;
        border-color: #2f3336;
    }
    
    .show-more-btn {
        color: #1877F2;
    }
    
    .error-message {
        color: #f91880;
    }
    
    .no-results {
        color: #71767b;
    }
}

/* Search Header */
.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(230, 236, 240, 0.7);
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background-color: rgba(235, 238, 240, 0.85);
    backdrop-filter: blur(6px);
    border-radius: 50px;
    padding: 10px 16px;
    transition: background-color 0.2s, border-color 0.2s;
    border: 1px solid transparent;
}

.search-input-container.focused {
    background-color: white;
    border-color: #1877F2;
}

.search-input-container i {
    color: #657786;
    margin-right: 10px;
}

.search-input {
    border: none;
    background: none;
    outline: none;
    font-size: 15px;
    width: 100%;
    color: #0f1419;
}

.search-input::placeholder {
    color: #657786;
}

.profile-icon-container {
    display: flex;
    align-items: center;
}

.profile-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
}

.profile-icon.text-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    background-color: #1877F2;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
}

/* Search Tabs - Updated to match home page style */
.search-tabs {
    display: flex;
    background-color: #f0f2f5;
    border-radius: 20px;
    margin: 8px 16px;
    padding: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border-bottom: none;
    overflow-x: auto;
    scrollbar-width: none;
    position: sticky;
    top: 60px;
    z-index: 90;
}

.search-tabs::-webkit-scrollbar {
    display: none;
}

.search-tab {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 10px 0;
    font-weight: bold;
    color: var(--tab-inactive);
    position: relative;
    font-size: 15px;
    cursor: pointer;
    border-radius: 16px;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
}

.search-tab:hover {
    background-color: var(--hover-bg);
}

.search-tab.active {
    color: #fff;
    background-color: #1877F2;
    box-shadow: 0 1px 3px rgba(24, 119, 242, 0.4);
}

/* Remove underline from active tab */
.search-tab.active::after {
    display: none;
}

/* Dark mode for tabs */
@media (prefers-color-scheme: dark) {
    .search-tabs {
        background-color: #2d2d2d;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    }
}

/* Sections */
.search-section {
    padding: 16px;
    border-bottom: 1px solid #e6ecf0;
}

.section-title {
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 16px;
    color: #0f1419;
}

/* Who to Follow Section - Cleaned up */
.who-to-follow-section {
    position: static;
    margin-bottom: 0;
    padding-bottom: 0;
}

.who-to-follow-list {
    max-height: none;
    overflow: visible;
}

.who-to-follow-list::-webkit-scrollbar {
    display: none;
}

.who-to-follow-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #efefef;
}

.who-to-follow-item:last-child {
    border-bottom: none;
}

.follow-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #efefef;
}

.follow-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.follow-avatar i {
    font-size: 20px;
    color: #8e8e8e;
}

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

.follow-name {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 600;
    color: #262626;
    line-height: 1.3;
    text-decoration: none;
}

/* Remove underline from follow name */
.follow-name:hover {
    text-decoration: none;
}

.follow-handle {
    font-size: 14px;
    color: #8e8e8e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
}

.follow-btn {
    background-color: #1877F2;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 16px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    min-width: 76px;
    text-align: center;
}

.follow-btn:hover {
    background-color: #166fe5;
    transform: translateY(-1px);
}

.follow-btn.following {
    background-color: #efefef;
    color: #262626;
    border: 1px solid #dbdbdb;
}

.follow-btn.following:hover {
    background-color: #dbdbdb;
    border-color: #c4c4c4;
}

/* Verification Badge */
.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-left: 4px;
    width: 16px;
    height: 16px;
}

.verified-badge i {
    font-size: 14px;
    color: #1877F2;
}

/* Trending Posts */
.trending-post {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #e6ecf0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.trending-post:hover {
    background-color: #f7f7f7;
}

.trending-content {
    flex: 1;
    margin-right: 12px;
}

.trending-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.trending-category {
    font-size: 13px;
    color: #657786;
}

.trending-more {
    color: #657786;
    cursor: pointer;
    padding: 4px;
}

.trending-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f1419;
    margin-bottom: 4px;
    line-height: 1.3;
}

.trending-stats {
    font-size: 13px;
    color: #657786;
    margin-bottom: 8px;
}

.trending-author {
    display: flex;
    align-items: center;
}

.trending-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #ccd6dd;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    overflow: hidden;
}

.trending-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trending-avatar i {
    font-size: 12px;
    color: white;
}

.trending-author-info {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #657786;
}

.trending-author-name {
    margin-right: 4px;
    font-weight: 700;
}

.trending-media {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.trending-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trending-media.template {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.trending-media .template-text {
    color: white;
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
}

.trending-location {
    font-size: 13px;
    color: #657786;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Search Results */
.search-results-container {
    display: none;
}

.search-default-content {
    display: block;
}

.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.search-loading .spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1877F2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.search-loading p {
    color: #657786;
    font-size: 14px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-people-results {
    padding: 16px;
}

.search-person-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #efefef;
}

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

.search-person-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #efefef;
}

.search-person-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-person-avatar i {
    font-size: 20px;
    color: #8e8e8e;
}

.search-person-info {
    flex-grow: 1;
    min-width: 0;
}

.search-person-name {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #262626;
    text-decoration: none;
    margin-bottom: 2px;
    font-weight: 600;
    line-height: 1.3;
}

/* Remove underline from search person name */
.search-person-name:hover {
    text-decoration: none;
}

.search-person-username {
    font-size: 14px;
    color: #8e8e8e;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-posts-results,
.search-tags-results,
.search-top-results {
    padding: 0;
}

.search-tag-title {
    padding: 16px;
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f1419;
    border-bottom: 1px solid #e6ecf0;
}

.follow-link {
    text-decoration: none;
    color: inherit;
}

/* Remove underline from follow link */
.follow-link:hover {
    text-decoration: none;
}

.show-more-container {
    padding: 16px 0;
}

.show-more-btn {
    display: block;
    text-align: center;
    color: #1877F2;
    background: none;
    border: none;
    font-size: 15px;
    cursor: pointer;
    padding: 12px 0;
    text-decoration: none;
    width: 100%;
    transition: background-color 0.2s;
}

.show-more-btn:hover {
    text-decoration: none;
    background-color: rgba(24, 119, 242, 0.1);
}

/* Reels Search Results */
.search-reels-results {
    padding: 16px;
}

.search-reel-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #0f1419;
}

.reel-search-item {
    margin-bottom: 20px;
    cursor: pointer;
}

.reel-thumbnail {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    background-color: #000;
}

.reel-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reel-stats {
    position: absolute;
    right: 12px;
    bottom: 12px;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.reel-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

.reel-info {
    padding: 12px 0;
}

.reel-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

.reel-author img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.reel-author span {
    font-weight: 600;
    font-size: 14px;
}

.reel-caption {
    font-size: 14px;
    color: #0f1419;
    line-height: 1.4;
    margin: 0;
}

/* Loading and Error States */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.error-message, .no-results {
    text-align: center;
    color: #657786;
    padding: 20px 0;
}

.error-message {
    color: #e0245e;
}

.search-results {
    padding: 16px;
    border-bottom: 1px solid #e6ecf0;
}

.search-spinner {
    height: 100px;
}

/* Remove old verification badge styles */
.blue-verified, .red-verified {
    display: none;
}

/* Dark Mode - Header, Tabs & Suggestions Section Only */
@media (prefers-color-scheme: dark) {
    .search-page-container {
        background-color: #101010;
    }
    
    /* Search Header */
    .search-header {
        background-color: rgba(16, 16, 16, 0.7);
        border-bottom-color: rgba(56, 68, 77, 0.7);
    }
    
    .search-input-container {
        background-color: rgba(32, 35, 39, 0.85);
    }
    
    .search-input-container.focused {
        background-color: #101010;
        border-color: #1877F2;
    }
    
    .search-input {
        color: #e7e9ea;
    }
    
    .search-input::placeholder {
        color: #71767b;
    }
    
    /* Search Tabs */
    .search-tabs {
        border-bottom-color: #2f3336;
        background-color: #101010;
    }
    
    .search-tab {
        color: #71767b;
    }
    
    .search-tab.active {
        color: #e7e9ea;
    }
    
    /* Suggestions Section (Who to Follow) */
    .who-to-follow-section {
        background-color: #101010;
    }
    
    .section-title {
        color: #e7e9ea;
    }
    
    .who-to-follow-item {
        border-bottom-color: #2f3336;
    }
    
    .follow-name {
        color: #e7e9ea;
    }
    
    .follow-handle {
        color: #71767b;
    }
    
    .follow-avatar {
        background-color: #2f3336;
        border-color: #2f3336;
    }
    
    .follow-avatar i {
        color: #8b98a5;
    }
}
