@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Inter:wght@300;400;500;600&display=swap');

:root {
    --brand: #ff5722;
    --brand-dark: #e64a19;
    --brand-light: #ffccbc;
    --text-main: #1a1a1a;
    --text-muted: #666666;
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 40px rgba(0, 0, 0, 0.08);
    --radius: 20px;
    --transition: cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme='dark'] {
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #f0f0f0;
    --text-muted: #b0b0b0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
}

.search-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* HEADER */
.search-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease;
}

.search-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.5;
}

/* SEARCH BOX */
.search-box {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
    animation: fadeInUp 0.6s ease 0.1s backwards;
}

.form-group label {
    font-family: 'Outfit', sans-serif;
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.1rem;
    text-align: center;
}

.search-input-container {
    position: relative;
    max-width: 700px;
    margin: 0 auto 1.5rem;
}

.search-input {
    width: 100%;
    padding: 1.2rem 1.5rem 1.2rem 3.5rem;
    font-size: 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    background: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    transition: all 0.3s var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(255, 87, 34, 0.15);
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.25rem;
    pointer-events: none;
}

/* FILTERS */
.search-filters {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.filter-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.4rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
}

.filter-btn.active {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.2);
}

.filter-btn:hover:not(.active) {
    background: var(--bg-body);
    border-color: var(--text-muted);
    color: var(--text-main);
}

/* RESULTS GRID */
.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

/* RESULT CARD */
.result-card {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s var(--transition);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    animation: fadeInUp 0.5s ease backwards;
    text-decoration: none;
    height: 100%;
}

.result-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 87, 34, 0.3);
}

/* POST CARD SPECIFIC */
.post-media {
    width: 100%;
    height: 180px;
    background: var(--bg-body);
    position: relative;
    overflow: hidden;
}

.post-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.result-card:hover .post-img {
    transform: scale(1.05);
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 2rem;
    opacity: 0.3;
    background: linear-gradient(135deg, var(--bg-body), var(--border-color));
}

.post-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.8rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-card:hover .post-title {
    color: var(--brand);
}

.post-excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: auto;
    /* Push footer down */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* USER CARD SPECIFIC */
.user-card-inner {
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.user-avatar-lg {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-body);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    background: var(--bg-body);
}

.user-avatar-placeholder {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff5722, #ff9800);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    border: 4px solid var(--bg-body);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
}

.user-details h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 0.5rem;
}

.user-bio {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.user-stats-row {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    width: 100%;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-val {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--brand);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* LOADING & EMPTY STATES */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.info-notice {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-weight: 500;
    display: none;
    /* Controlled by JS */
}

.fa-spin {
    margin-right: 8px;
    color: var(--brand);
}

/* ANIMATIONS */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .search-header h1 {
        font-size: 2.5rem;
    }

    .search-box {
        padding: 1.5rem;
    }

    .results-container {
        grid-template-columns: 1fr;
    }
}