/* DealGram - Button Components */

/* ===== BASE BUTTON ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    user-select: none;
}

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

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== BUTTON VARIANTS ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.35);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(239, 68, 68, 0.35);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: white;
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(245, 158, 11, 0.35);
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.btn-link {
    background: transparent;
    color: var(--primary-500);
    padding: 0;
    box-shadow: none;
}

.btn-link:hover {
    color: var(--primary-600);
    text-decoration: underline;
    transform: none;
}

/* ===== BUTTON SIZES ===== */
.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.813rem;
}

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

.btn-xl {
    padding: var(--space-lg) var(--space-2xl);
    font-size: 1.125rem;
}

/* ===== BUTTON STATES ===== */
.btn-loading {
    color: transparent;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ===== BUTTON GROUPS ===== */
.btn-group {
    display: inline-flex;
    gap: var(--space-xs);
}

.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

/* ===== ICON BUTTONS ===== */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

.btn-icon.btn-lg {
    width: 48px;
    height: 48px;
}

/* ===== FLOATING ACTION BUTTON ===== */
.btn-fab {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: var(--z-fixed);
}

.btn-fab:hover {
    transform: translateY(-4px) rotate(90deg);
}

/* ===== BUTTON WITH RIPPLE EFFECT ===== */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::before {
    width: 300px;
    height: 300px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .btn-fab {
        bottom: var(--space-md);
        right: var(--space-md);
    }
}

/* ===== DARK MODE ===== */
.dark-mode .btn-secondary {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
}

.dark-mode .btn-ghost:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
}