/* ═══════════════════════════════════════════════════════
   Search & Discovery CSS — ItsMyIdeas.com
   ═══════════════════════════════════════════════════════ */

/* ─── Content Area Reset ─── */

.site-content,
.content-area,
.content-container,
.content-bg,
.entry-content-wrap,
.loop-entry .content-bg,
.entry.content-bg {
    background: #ffffff !important;
}

#main,
#primary {
    background: #ffffff !important;
}

/* ─── Search Header Bar ─── */

.search-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 2rem 0;
}

.search-header-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.search-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.search-header .search-count {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.search-header .search-query-highlight {
    color: #2563eb;
    font-weight: 600;
}

/* ─── Search Form ─── */

.search-form-enhanced {
    display: flex;
    gap: 0.5rem;
    max-width: 640px;
}

.search-form-enhanced .search-field {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.search-form-enhanced .search-field:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-form-enhanced .search-submit {
    padding: 0.75rem 1.5rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.search-form-enhanced .search-submit:hover {
    background: #1d4ed8;
}

/* ─── Filter Bar ─── */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 0;
    align-items: center;
}

.filter-bar-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.25rem;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.filter-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    text-decoration: none;
}

.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.filter-btn .count {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-left: 0.25rem;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.filter-group-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 100%;
    margin-bottom: 0.15rem;
}

/* ─── Result Cards ─── */

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 1.5rem 0;
}

@media (max-width: 1024px) {
    .search-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .search-results-grid {
        grid-template-columns: 1fr;
    }
}

.idea-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.15s;
    display: flex;
    flex-direction: column;
}

.idea-card:hover {
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.idea-card-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: #f1f5f9;
}

.idea-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.idea-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-type {
    color: #fff;
}

.badge-difficulty {
    color: #fff;
}

.idea-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.idea-card-title a {
    color: inherit;
    text-decoration: none;
}

.idea-card-title a:hover {
    color: #2563eb;
}

.idea-card-excerpt {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0 0 1rem 0;
    flex: 1;
}

.idea-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.idea-card-cats {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.idea-card-cat {
    font-size: 0.75rem;
    color: #64748b;
    text-decoration: none;
    padding: 0.15rem 0.5rem;
    background: #f8fafc;
    border-radius: 4px;
    transition: background 0.15s;
}

.idea-card-cat:hover {
    background: #e2e8f0;
    color: #0f172a;
    text-decoration: none;
}

.idea-card-date {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* ─── Empty State ─── */

.search-empty {
    text-align: center;
    padding: 4rem 1.5rem;
}

.search-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.search-empty h2 {
    font-size: 1.5rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.search-empty p {
    color: #64748b;
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto 1.5rem;
}

.search-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.search-suggestions a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
}

.search-suggestions a:hover {
    background: #e2e8f0;
    color: #0f172a;
    text-decoration: none;
}

/* ─── Pagination ─── */

.search-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 0;
}

.search-pagination a,
.search-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s;
}

.search-pagination a:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.search-pagination .current {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    font-weight: 600;
}

/* ─── Browse Ideas Page ─── */

.browse-hero {
    text-align: center;
    padding: 3rem 1.5rem 2rem;
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border-bottom: 1px solid #e2e8f0;
}

.browse-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.browse-hero p {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
}

.browse-search-box {
    max-width: 560px;
    margin: 1.5rem auto 0;
}

.browse-search-box input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.browse-search-box input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.browse-filters {
    max-width: 1140px;
    margin: 0 auto;
    padding: 1.5rem;
}

.browse-results-count {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1rem;
}

/* ─── Quick Topic Chips (on homepage/search) ─── */

.topic-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 1rem 0;
}

.topic-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s;
}

.topic-chip:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    text-decoration: none;
}

.topic-chip .emoji {
    font-size: 0.95rem;
}

/* ─── Sidebar Widgets ─── */

.sidebar-widget {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.sidebar-widget h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.tag-cloud-widget {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tag-cloud-widget a {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    background: #f1f5f9;
    color: #475569;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.15s;
}

.tag-cloud-widget a:hover {
    background: #2563eb;
    color: #fff;
}

.popular-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.popular-list li:last-child {
    border-bottom: none;
}

.popular-list a {
    font-size: 0.9rem;
    color: #334155;
    text-decoration: none;
    transition: color 0.15s;
}

.popular-list a:hover {
    color: #2563eb;
}

/* ─── Category Archive Header ─── */

.category-header {
    padding: 2rem 0 1rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.category-header h1 {
    font-size: 1.75rem;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
}

.category-header .category-desc {
    font-size: 1rem;
    color: #64748b;
    max-width: 700px;
}

/* ─── No-Results Suggestions ─── */

.no-results-help {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    margin: 1.5rem 0;
}

.no-results-help h3 {
    font-size: 1.1rem;
    color: #0f172a;
    margin: 0 0 1rem 0;
}

.no-results-help ul {
    padding-left: 1.25rem;
    margin: 0;
}

.no-results-help li {
    margin-bottom: 0.5rem;
    color: #475569;
    font-size: 0.95rem;
}

.no-results-help a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.no-results-help a:hover {
    text-decoration: underline;
}

/* ─── Related Ideas (on single idea pages) ─── */

.related-ideas-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
}

.related-ideas-section h2 {
    font-size: 1.3rem;
    color: #0f172a;
    margin-bottom: 1rem;
}
