/* Common Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 0.5rem;
    white-space: nowrap;
    min-width: fit-content;
}

.btn-primary {
    background-color: var(--primary-main);
    color: var(--bg-paper);
}

.btn-primary:hover {
    background-color: #1976d2;
    color: white;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--divider);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
}

.btn-error {
    background-color: #f44336;
    color: white;
}

.btn-error:hover {
    background-color: #d32f2f;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Button Group and Dropdown Styles */
.btn-group {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
    z-index: 1;
}

/* Ensure parent containers don't clip dropdown */
.bulk-action-buttons,
.bulk-actions {
    overflow: visible !important;
}

.card-body {
    overflow: visible !important;
}

.btn-group > .btn {
    position: relative;
    flex: 1 1 auto;
}

.btn-group > .btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group > .btn:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
}

/* Dropdown toggle with arrow */
.dropdown-toggle::after {
    content: '';
    display: inline-block;
    margin-left: 0.5rem;
    vertical-align: middle;
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
    transition: transform 0.2s ease;
}

.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* Dropdown menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 2px);
    right: 0;
    background: var(--bg-paper);
    border: 2px solid var(--primary-main);
    border-radius: 4px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.8);
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 10000;
    display: none;
}

.dropdown-menu.show {
    display: block !important;
    animation: dropdownFadeIn 0.2s ease;
}

/* Dropdown menu positioned upward when near bottom of screen */
.dropdown-menu.dropdown-menu-up {
    top: auto;
    bottom: calc(100% + 2px);
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 1rem;
    clear: both;
    font-weight: 500;
    color: var(--text-primary);
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--bg-paper);
    background-color: var(--primary-main);
}

.dropdown-item:active {
    background-color: #1976d2;
}

.dropdown-item .material-icons {
    font-size: 1.25rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

