/* ========================================
   Shared Button Extensions
   Bootstrap 5 button additions
   ======================================== */

/* === Ghost Button === */
.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-medium);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-high);
}

.btn-ghost:focus-visible {
    box-shadow: 0 0 0 2px var(--border-focus);
}

/* === Icon-Only Button === */
.btn-icon-only {
    padding: var(--space-sm);
    line-height: 1;
}

.btn-icon-only svg {
    width: 20px;
    height: 20px;
}

.btn-icon-only.btn-sm svg {
    width: 16px;
    height: 16px;
}

.btn-icon-only.btn-lg svg {
    width: 24px;
    height: 24px;
}

/* === Text Danger (ghost danger) === */
.btn-ghost.text-danger {
    color: var(--error);
}

.btn-ghost.text-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* === Button Sizes (Bootstrap overrides with tokens) === */
.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
}

/* === Quick Assign Buttons (image gallery) === */
.quick-assign-buttons {
    display: flex;
    gap: 4px;
}

.quick-assign-btn {
    position: relative;
    min-width: 28px;
    height: 28px;
    padding: 0 var(--space-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    border-radius: var(--radius-md);
    border: 1.5px solid rgba(255,255,255,0.12);
    cursor: pointer;
    opacity: 0.9;
    transition: opacity var(--transition-fast),
                transform var(--transition-fast),
                box-shadow var(--transition-fast);
}

.quick-assign-btn:hover {
    opacity: 1;
    transform: scale(1.08);
    box-shadow: 0 2px var(--space-sm) rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.25);
}

.quick-assign-btn.active {
    opacity: 1;
    border-color: var(--text-high);
    box-shadow: 0 0 0 1px var(--text-high),
                0 2px var(--space-sm) rgba(0,0,0,0.4);
}

/* Keyboard shortcut hint (visible on gallery item hover) */
.gallery-item:hover .quick-assign-btn::after {
    content: attr(data-key);
    position: absolute;
    top: -6px;
    right: -4px;
    font-size: 9px;
    background: var(--bg-app);
    color: var(--text-subtle);
    border-radius: var(--radius-full);
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-divider);
}

/* === Mobile adjustments === */
@media (max-width: 768px) {
    /* Touch targets */
    .btn-icon-only {
        padding: var(--space-xs);
        min-width: 44px;
        min-height: 44px;
    }

    .quick-assign-btn {
        min-width: 36px;
        min-height: 36px;
        padding: var(--space-xs) var(--space-sm);
        font-size: var(--font-size-sm);
    }
}

/* Touch devices: larger targets */
@media (hover: none) {
    .quick-assign-btn {
        min-width: 44px;
        min-height: 44px;
        padding: var(--space-sm);
        font-size: var(--font-size-sm);
    }
}

/* Small screens: buttons must fit in gallery cells */
@media (max-width: 767px) {
    .quick-assign-btn {
        min-width: 0;
        min-height: 32px;
        padding: 4px 6px;
        font-size: 11px;
        flex: 1 1 0;
    }

    .gallery-item-actions {
        overflow: hidden;
        gap: 3px;
        padding: 4px;
    }
}
