/* Header search styles */

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-search {
    position: relative;
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

#globalBookSearch {
    width: 100%;
    padding: 0.5rem 1rem;
    padding-left: 2.5rem;
    border: 2px solid transparent;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

#globalBookSearch:focus {
    outline: none;
    background: #fff;
    color: var(--text-primary, #333);
    border-color: var(--primary-color, #3498db);
}

#globalBookSearch::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#globalBookSearch:focus::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

/* Search icon */
.header-search::before {
    content: '🔍';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0.6;
}

/* Search dropdown */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-top: 0.5rem;
    overflow: hidden;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.search-dropdown.hidden {
    display: none;
}

.search-result-item {
    display: flex;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: var(--text-primary, #333);
    transition: background 0.2s ease;
    align-items: flex-start;
    gap: 0.75rem;
}

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

.search-result-item:hover {
    background: #f5f5f5;
}

.search-result-item img {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: #eee;
}

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

.search-result-info h4 {
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-info p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-loading,
.search-no-results {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-secondary, #666);
}

.search-see-all {
    display: block;
    padding: 0.75rem 1rem;
    text-align: center;
    background: #f8f9fa;
    color: var(--primary-color, #3498db);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease;
}

.search-see-all:hover {
    background: #e9ecef;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .header-search {
        max-width: none;
        margin: 0 0.5rem;
        flex: 1;
    }

    #globalBookSearch {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
        padding-left: 2rem;
    }

    .header-search::before {
        font-size: 0.8rem;
        left: 0.5rem;
    }
}
