/* search.css - Futuristic Search Hub Styles */

.search-hub-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #121c33;
    z-index: 2000;
    /* Set high to be definitely above everything */
    display: flex;
    flex-direction: column;
    padding: 0;
    /* Changed to 0 to prevent padding shifts */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    will-change: opacity;
}

/* Ensure Top Nav shows above search, and Bottom Nav disappears */
body.search-hub-active .top-nav {
    z-index: 3000 !important;
}

body.search-hub-active .bottom-nav {
    display: none !important;
}


.search-hub-overlay.active {
    opacity: 1;
    visibility: visible;
}

@keyframes searchFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.search-hub-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 85px 20px 20px 20px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

@keyframes searchSlideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.search-hub-input-wrapper {
    flex: 1;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    /* Slightly darker, no blur */
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    padding: 0 25px;
    height: 58px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-hub-input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.08);
    border-color: #00A651;
    box-shadow: 0 0 30px rgba(0, 166, 81, 0.25);
    transform: scale(1.01);
}

.search-hub-input-wrapper i {
    color: #00A651;
    font-size: 18px;
    margin-right: 15px;
}

.search-hub-input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    width: 100%;
    outline: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
}

.search-hub-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.search-hub-close {
    width: 55px;
    height: 55px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.search-hub-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    transform: rotate(180deg) scale(1.1);
}

.search-hub-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px calc(60px + env(safe-area-inset-bottom)) 20px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.search-section {
    margin-bottom: 30px;
    opacity: 1;
}

.search-section:nth-child(2) {
    animation-delay: 0.1s;
}

.search-section:nth-child(3) {
    animation-delay: 0.2s;
}

.search-section:nth-child(4) {
    animation-delay: 0.3s;
}

@keyframes searchFadeUp {
    from {
        transform: translateY(15px) translateZ(0);
        opacity: 0;
    }

    to {
        transform: translateY(0) translateZ(0);
        opacity: 1;
    }
}

.search-section-title {
    color: #00A651;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-section-title i {
    color: #00A651;
}

.search-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(0, 166, 81, 0.3), transparent);
}

/* Chips/Tags - Horizontal Scrolling */
.search-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    padding: 5px 0 15px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.search-tags::-webkit-scrollbar {
    display: none;
}

.search-tag {
    flex-shrink: 0;
    padding: 10px 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.search-tag:hover {
    background: rgba(0, 166, 81, 0.15);
    border-color: #00A651;
    color: #fff;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 166, 81, 0.3);
}

/* Result Items */
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Sub-container for grouped results */
.search-results-horizontal {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    overflow-x: auto;
    padding: 5px 0 15px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.search-results-horizontal::-webkit-scrollbar {
    display: none;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    gap: 12px;
    position: relative;
    overflow: hidden;
    min-width: 140px;
    max-width: 140px;
    text-align: center;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 166, 81, 0.4);
}

.search-result-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #00A651;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.search-result-item:hover::before {
    transform: scaleX(1);
}

.search-result-image {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.4s ease;
}

.search-result-item:hover .search-result-image {
    transform: scale(1.1);
    border-color: #00A651;
}

.search-result-image.is-nursery {
    border-radius: 50%;
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.search-result-type {
    font-size: 10px;
    color: #00A651;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 2px;
}

.search-result-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.no-results-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.4);
}

.no-results-state i {
    font-size: 48px;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.1);
}

.search-result-arrow {
    display: none;
    /* Removed arrow for cleaner horizontal card look */
}

/* Scrollbar */
.search-hub-content::-webkit-scrollbar {
    width: 4px;
}

.search-hub-content::-webkit-scrollbar-thumb {
    background: rgba(0, 166, 81, 0.3);
    border-radius: 10px;
}