/* Search Modal CSS */
.bb-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.bb-search-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.bb-search-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(43, 85, 114, 0.9); /* Dark blue overlay */
    backdrop-filter: blur(5px);
}

.bb-search-modal__content {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin-top: 10vh;
    background: transparent;
    padding: 20px;
    z-index: 100001;
    color: #fff;
    font-family: inherit;
}

.bb-search-modal__close {
    position: absolute;
    top: -40px;
    right: 0;
    background: #fff;
    color: #000;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.bb-search-modal__close:hover {
    transform: rotate(90deg);
}

.bb-search-modal__title {
    font-size: 2.5rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 30px;
    color: #fff;
    letter-spacing: 0.05em;
}

/* Input Area */
.bb-search-modal__input-wrap {
    position: relative;
    margin-bottom: 30px;
}

.bb-search-modal__input {
    width: 100%;
    font-size: 1.5rem;
    padding: 20px 60px 20px 30px;
    border-radius: 50px; /* Pill shape */
    border: none;
    outline: none;
    background: #fff;
    color: #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.bb-search-modal__submit {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: #000;
    border: none;
    color: #fff;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.bb-search-modal__submit:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Filters */
.bb-search-modal__filters {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.bb-search-filter {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-transform: uppercase;
}

.bb-search-filter:hover, .bb-search-filter.is-active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* Results */
.bb-search-modal__results {
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 10px;
    /* Scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.bb-search-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 15px;
}

.bb-search-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s;
}

.bb-search-item:hover {
    transform: translateY(-2px);
}

.bb-search-item__link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    gap: 15px;
}

.bb-search-item__tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 6px;
    background: #eee;
    color: #555;
    white-space: nowrap;
}

/* Tag colors */
.bb-tag-publication { background: #e3f2fd; color: #1565c0; }
.bb-tag-event { background: #f3e5f5; color: #7b1fa2; }
.bb-tag-page { background: #e8f5e9; color: #2e7d32; }

.bb-search-item__title {
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
}

.bb-search-item__title strong {
    background: rgba(255, 235, 59, 0.4);
    padding: 0 2px;
}

/* Utils */
.bb-search-spinner {
    display: none;
    position: absolute;
    right: 70px; /* Left of button */
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0,0,0,0.1);
    border-top-color: #333;
    border-radius: 50%;
    animation: bb-spin 0.8s linear infinite;
}

.bb-search-modal.is-loading .bb-search-spinner {
    display: block;
}

@keyframes bb-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}
