/*
    buttons.css — every clickable control: text buttons, icon-only buttons and
    the compact cluster a table row uses for its actions.
*/

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 7px var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    line-height: 1.5;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease),
                border-color var(--duration-fast) var(--ease),
                color var(--duration-fast) var(--ease),
                box-shadow var(--duration-fast) var(--ease);
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: .55;
    cursor: not-allowed;
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.btn-sm {
    padding: 4px var(--space-3);
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 10px var(--space-5);
    font-size: var(--text-md);
}

.btn-block {
    width: 100%;
}

/* Primary — the one action a screen wants you to take. */
.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--text-on-brand);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--brand-strong);
    border-color: var(--brand-strong);
    color: var(--text-on-brand);
}

/* Ghost — bordered, for secondary navigation such as Cancel. */
.btn-ghost {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-ghost:hover {
    background: var(--surface-hover);
    border-color: var(--brand);
    color: var(--brand);
}

/* Quiet — no chrome until hovered; for filters and inline helpers. */
.btn-quiet {
    background: var(--surface-sunken);
    color: var(--text-muted);
}

.btn-quiet:hover {
    background: var(--brand-soft);
    color: var(--brand);
}

/* Accent — the logo gold, reserved for highlights such as an empty state. */
.btn-accent {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-accent:hover {
    background: var(--accent);
    color: var(--accent-contrast);
}

.btn-outline-danger {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
    color: var(--danger);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--neutral-0);
}

.btn-danger:hover {
    filter: brightness(.92);
    color: var(--neutral-0);
}

/* ---- Icon-only buttons ---- */

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: var(--text-base);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.icon-btn:hover {
    background: var(--surface-hover);
    color: var(--brand);
}

.icon-btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.icon-btn .icon {
    font-size: 1.3rem;
}

/* The theme toggle shows the palette it would switch to, not the current one. */
.theme-toggle .icon-light-mode,
[data-theme="dark"] .theme-toggle .icon-dark-mode {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-light-mode {
    display: inline-flex;
}

/* The language switch is an icon button that also shows its label when there is room. */
.lang-btn {
    width: auto;
    padding-inline: var(--space-2);
}

.lang-label {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
}

@media (max-width: 575.98px) {
    .lang-label {
        display: none;
    }
}

/* ---- Row actions ---- */

.row-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.row-actions form {
    display: contents;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-subtle);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease),
                color var(--duration-fast) var(--ease),
                border-color var(--duration-fast) var(--ease);
}

.action-btn .icon {
    font-size: 1.1rem;
}

.action-btn:hover {
    background: var(--brand-soft);
    border-color: var(--border-brand);
    color: var(--brand);
}

.action-btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.action-btn-danger:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
    color: var(--danger);
}
