/* Button Components
 * 
 * Standard button variants:
 * - .btn-primary        Outlined primary button (default for most actions)
 * - .btn-primary-solid  Legacy alias for the primary outlined treatment
 * - .btn-primary-sm     Smaller primary outlined button
 * - .btn-secondary      Neutral outlined button (cancel, back actions)
 * - .btn-ghost          Pure ghost with no background until hover
 * - .btn-danger         Outlined red for destructive actions
 * - .btn-danger-ghost   Alias for outlined red actions
 * - .btn-success        Outlined green for positive actions
 */

/* Base button styles */
.btn-primary,
.btn-primary-solid,
.btn-primary-sm,
.btn-secondary,
.btn-ghost,
.btn-danger,
.btn-danger-ghost,
.btn-success,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    cursor: pointer;
    background-color: transparent;
    border: 1px solid transparent;
    color: var(--text);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn:focus-visible,
.btn-primary:focus-visible,
.btn-primary-solid:focus-visible,
.btn-primary-sm:focus-visible,
.btn-secondary:focus-visible,
.btn-ghost:focus-visible,
.btn-danger:focus-visible,
.btn-danger-ghost:focus-visible,
.btn-success:focus-visible {
    outline: none;
}

.btn:not(:disabled):hover,
.btn-primary:not(:disabled):hover,
.btn-primary-solid:not(:disabled):hover,
.btn-primary-sm:not(:disabled):hover,
.btn-secondary:not(:disabled):hover,
.btn-ghost:not(:disabled):hover,
.btn-danger:not(:disabled):hover,
.btn-danger-ghost:not(:disabled):hover,
.btn-success:not(:disabled):hover {
    transform: translateY(-1px);
}

.btn:not(:disabled):active,
.btn-primary:not(:disabled):active,
.btn-primary-solid:not(:disabled):active,
.btn-primary-sm:not(:disabled):active,
.btn-secondary:not(:disabled):active,
.btn-ghost:not(:disabled):active,
.btn-danger:not(:disabled):active,
.btn-danger-ghost:not(:disabled):active,
.btn-success:not(:disabled):active {
    transform: translateY(0);
}

/* Primary outlined button - default for most actions */
.btn-primary,
.btn-primary-solid,
.btn.btn-primary {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-primary:hover,
.btn-primary-solid:hover,
.btn.btn-primary:hover {
    background-color: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.btn-primary:focus,
.btn-primary-solid:focus,
.btn.btn-primary:focus {
    box-shadow: 0 0 0 3px var(--focus);
    outline: none;
}

.btn-primary:disabled,
.btn-primary-solid:disabled,
.btn.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Primary Small Button */
.btn-primary-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-primary-sm:hover {
    background-color: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.btn-primary-sm:focus {
    box-shadow: 0 0 0 3px var(--focus);
    outline: none;
}

/* Secondary button - neutral outline */
.btn-secondary,
.btn.btn-secondary {
    background-color: transparent;
    color: var(--text-2);
    border: 1px solid var(--divider);
}

.btn-secondary:hover,
.btn.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-color: var(--text-2);
    box-shadow: 0 10px 24px rgba(15, 19, 25, 0.3);
}

.btn-secondary:focus,
.btn.btn-secondary:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    outline: none;
}

/* Ghost Button - Minimal styling */
.btn-ghost {
    background-color: transparent;
    color: var(--text-2);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.btn-ghost:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    outline: none;
}

/* Danger button - destructive actions, same outlined treatment */
.btn-danger,
.btn-danger-ghost {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover,
.btn-danger-ghost:hover {
    background-color: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.48);
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.14);
}

.btn-danger:focus,
.btn-danger-ghost:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
    outline: none;
}

.btn-danger:disabled,
.btn-danger-ghost:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Success button - positive actions, same outlined treatment */
.btn-success {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.32);
}

.btn-success:hover {
    background-color: rgba(34, 197, 94, 0.16);
    border-color: rgba(34, 197, 94, 0.46);
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.14);
}

.btn-success:focus {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
    outline: none;
}

.btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Icon-only button variant */
.btn-icon {
    padding: 0.5rem;
    min-width: 2.25rem;
    min-height: 2.25rem;
}

.btn-icon-sm {
    padding: 0.375rem;
    min-width: 1.75rem;
    min-height: 1.75rem;
}

/* Button with larger size for important CTAs */
.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}
