/* Search Bar Styles */
.btn-icon {
    color: var(--text-main);
    font-size: 1.2rem;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
}

/* Popup Search Bar Container */
.search-bar {
    position: absolute;
    top: 80px;
    /* Below the navbar */
    right: 10%;
    /* Aligned roughly with the search icon */
    width: 350px;
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2000;

    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active State (Shown) */
.search-bar.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(10, 10, 18, 0.6);
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    height: 50px;
    padding: 0 1rem;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
    background: rgba(10, 10, 18, 0.9);
}

.search-input-wrapper i {
    color: var(--text-muted);
    font-size: 1rem;
}

.search-input-wrapper input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1rem;
    padding: 0.5rem;
    outline: none;
    font-family: var(--font-body);
    font-weight: 500;
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.search-input-wrapper .btn-icon {
    width: 30px;
    height: 30px;
    color: var(--text-muted);
    font-size: 1rem;
}

.search-input-wrapper .btn-icon:hover {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.1);
}

/* Error message styling */
.error-msg {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-size: 1.2rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .search-bar {
        right: 5%;
        left: 5%;
        width: 90%;
        top: 70px;
    }
}