/* static/css/modules/search.css */

/* ==========================================
   1. FULL-PAGE SEARCH (Journal/Mentor Lists)
   ========================================== */
   .page-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem; 
    margin-bottom: 3rem; 
    text-align: center;
    width: 100%; 
    position: relative;
    z-index: 10;
}

.search-container {
    width: 100%;
    max-width: 480px; 
    margin: 0 auto;
    display: block; 
}

.search-form {
    width: 100%;
}

.search-bar-wrapper {
    position: relative;
    width: 100%;
    transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.search-bar-wrapper:focus-within {
    transform: scale(1.02); 
}

/* ==========================================
   2. FILTER TAGS (Horizontally Scrollable)
   ========================================== */
.filter-tags {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 4px;
    padding-bottom: 12px;
    width: 100%; 
    max-width: 100%;
    margin: 0 auto; 
    -webkit-overflow-scrolling: touch;
    
    scrollbar-width: none;
    -ms-overflow-style: none;
    
    /* Elegant fade mask to show scrollability */
    mask-image: linear-gradient(to right, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
}

.filter-tags::-webkit-scrollbar {
    display: none;
}

/* ==========================================
   3. EMPTY STATE (No Results Found)
   ========================================== */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 6rem 2rem;
    background: var(--color-surface); 
    border-radius: 24px;
    border: 1px solid var(--color-border); 
    width: 100%; 
    max-width: 600px;
    margin: 3rem auto;
    animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    box-shadow: var(--shadow-md);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.empty-state-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.15), rgba(var(--color-primary-rgb), 0.05));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    box-shadow: 0 15px 30px -10px rgba(var(--color-primary-rgb), 0.2);
}

.empty-state-icon svg {
    width: 54px;
    height: 54px;
}

.no-results h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.no-results p {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    font-size: 1.15rem;
    line-height: 1.6;
}

/* ==========================================
   4. SEARCH WIDGET (Expanding Bubble)
   ========================================== */
.search-widget {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 40px;
    z-index: 100;
}

.search-trigger-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: rgba(var(--color-surface-rgb), 0.6);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

.search-widget.active .search-form-container {
    width: 300px;
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

/* ==========================================
   5. TOOLBAR ROW & FILTER PILLS (New Standard)
   ========================================== */
.toolbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center; 
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 20;
    min-height: 48px; 
    /* Sticky Header */
    position: sticky;
    top: 0;
    background: rgba(var(--color-background-rgb, 252, 251, 249), 0.95); /* Semi-transparent */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding-top: 1rem; 
    margin-top: -1rem; 
    padding-bottom: 1rem;
    z-index: 50;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.toolbar-row.is-pinned {
    border-bottom-color: var(--color-border);
}

.filter-row {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding-bottom: 0;
    margin-bottom: 0;
    scrollbar-width: none; 
    flex-grow: 1; 
    align-items: center;
    height: 48px; 
    white-space: nowrap; 
    min-width: 0; 
}
.filter-row::-webkit-scrollbar { display: none; }

.filter-pill {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 0 1.2rem;
    height: 38px; 
    border-radius: 50px;
    background: rgba(var(--color-surface-rgb), 0.6);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    flex-shrink: 0; 
    cursor: pointer;
}

.filter-pill:hover, .filter-pill.active {
    background: var(--color-surface);
    color: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* ==========================================
   6. MOBILE TWEAKS
   ========================================== */
@media (max-width: 768px) {
    .page-header {
        margin-bottom: 1.5rem; 
        gap: 1rem;
    }

    .search-container {
        width: 100%;
        max-width: 100%;
        margin-top: 0.5rem;
    }

    .no-results {
        padding: 3rem 1.5rem;
        margin: 1.5rem auto;
        width: 100%;
    }

    .search-widget.active .search-form-container {
        width: calc(100vw - 4rem);
        max-width: 280px;
    }

    /* Toolbar Mobile Tweaks */
    .toolbar-row {
        display: flex; /* Keep flex */
        transform: translateY(-1rem);
    }

    /* Re-enable horizontal scroll for pills on Mobile only */
    .filter-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 0.5rem;
        /* Mobile Bleed */
        margin-left: -1rem; 
        width: calc(100% + 2rem);
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Hide search controls on mobile toolbar if desire is to match Activities */
    .toolbar-row .header-controls {
       display: none;
    }
}
