/**
 * Button Component Styles
 * ========================
 */

/* Base Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all var(--duration-fast) var(--ease-default);
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn:active {
    transform: scale(0.98);
}

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

.btn:disabled:active {
    transform: none;
}

/* Primary Button */
.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.btn-primary svg {
    fill: currentColor;
    stroke: none;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-secondary);
    box-shadow: var(--shadow-md), 0 0 20px var(--accent-glow);
}

/* Secondary Button */
.btn-secondary {
    background: var(--accent-soft);
    color: var(--accent-primary);
}

.btn-secondary svg {
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.btn-secondary:hover:not(:disabled) svg {
    fill: currentColor;
    stroke: none;
}

/* Ghost Button */
.btn-ghost {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.btn-ghost svg {
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.btn-outline svg {
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.btn-outline:hover:not(:disabled) {
    background: var(--accent-soft);
}

/* Danger Button */
.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger);
    color: white;
}

/* Success Button */
.btn-success {
    background: var(--success-soft);
    color: var(--success);
}

.btn-success:hover:not(:disabled) {
    background: var(--success);
    color: white;
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    border-radius: var(--radius-md);
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-base);
    border-radius: var(--radius-xl);
}

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

.btn-xl {
    padding: var(--space-5) var(--space-8);
    font-size: var(--text-lg);
    border-radius: var(--radius-xl);
}

.btn-xl svg {
    width: 24px;
    height: 24px;
}

/* Icon Only Button */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-lg);
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
}

.btn-icon.btn-lg {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-xl);
}

/* Full Width Button */
.btn-full {
    width: 100%;
}

/* Button Group */
.btn-group {
    display: inline-flex;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.btn-group .btn:not(:last-child) {
    border-right: 1px solid var(--border-subtle);
}

/* Loading State */
.btn-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: var(--radius-full);
    animation: spin 0.6s linear infinite;
}

.btn-primary.btn-loading::after {
    border-color: var(--bg-primary);
    border-right-color: transparent;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Link Button */
.btn-link {
    background: none;
    color: var(--accent-primary);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

.btn-link:hover:not(:disabled) {
    background: var(--accent-softer);
    text-decoration: underline;
}
