/**
 * Button Dropdown - Frontend Styles
 */

/* Container */
.bb-dropdown {
    position: relative;
    display: inline-block;
}

.bb-dropdown--full {
    display: block;
    width: 100%;
}

/* Button */
.bb-dropdown-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5em;
    padding: 12px 24px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    background-color: #fafafa;
    color: #333333;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    line-height: 18px;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.bb-dropdown-btn:hover {
    background-color: #f0f0f0;
}

.bb-dropdown-btn:focus {
    outline: 2px solid #333;
    outline-offset: 2px;
}

.bb-dropdown-btn:focus:not(:focus-visible) {
    outline: none;
}

.bb-dropdown-btn:focus-visible {
    outline: 2px solid #333;
    outline-offset: 2px;
}

/* Full width button */
.bb-dropdown--full .bb-dropdown-btn {
    width: 100%;
}

/* Button icon */
.bb-dropdown-btn__icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.bb-dropdown-btn__icon i {
    font-size: 1em;
    line-height: 1;
}

/* Button text */
.bb-dropdown-btn__text {
    flex-shrink: 0;
}

/* Dropdown menu */
.bb-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    margin: 4px 0 0;
    padding: 8px 0;
    list-style: none;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(0);
}

/* Show menu when open */
.bb-dropdown.is-open .bb-dropdown-menu {
    display: block;
    animation: bb-dropdown-fade-in 0.15s ease-out forwards;
}

/* Menu item wrapper */
.bb-dropdown-menu__item {
    margin: 0;
    padding: 0;
}

/* Menu item link */
.bb-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5em;
    width: 100%;
    padding: 10px 16px;
    color: #333333;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.bb-dropdown-item:hover,
.bb-dropdown-item:focus {
    background-color: #f5f5f5;
    text-decoration: none;
    outline: none;
}

.bb-dropdown-item:focus-visible {
    outline: 2px solid #333333;
    outline-offset: -2px;
}

/* Item icon */
.bb-dropdown-item__icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.bb-dropdown-item__icon i {
    font-size: 1em;
    line-height: 1;
}

/* Item text */
.bb-dropdown-item__text {
    flex-grow: 1;
}

/* Animation for dropdown */
@keyframes bb-dropdown-fade-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}