/**
 * buttons.css
 * Extracted from inline styles and components.css across EnigmAPI frontend
 * Contains all reusable button component styles
 * Found in 58+ files across all portals
 */

/* ========================================
   BASE BUTTON STYLES
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ========================================
   BUTTON VARIANTS
   ======================================== */

/* Primary Button - Most used (58 files) */
.btn-primary {
    background: var(--accent, #6366f1);
    color: var(--text-on-accent, #ffffff);
    border-color: var(--accent, #6366f1);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover, #4f46e5);
    border-color: var(--accent-hover, #4f46e5);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.15));
}

.btn-primary:active:not(:disabled) {
    background: var(--accent-active, #4338ca);
    transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
    background: transparent;
    color: var(--text-primary, #ffffff);
    border-color: var(--border-default, rgba(148, 163, 184, 0.2));
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover, rgba(99, 102, 241, 0.1));
    border-color: var(--accent, #6366f1);
    color: var(--accent, #6366f1);
}

/* Success Button */
.btn-success {
    background: var(--success, #10b981);
    color: var(--text-on-success, #ffffff);
    border-color: var(--success, #10b981);
}

.btn-success:hover:not(:disabled) {
    background: var(--success-hover, #059669);
    border-color: var(--success-hover, #059669);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Danger Button */
.btn-danger {
    background: var(--danger, #ef4444);
    color: var(--text-on-danger, #ffffff);
    border-color: var(--danger, #ef4444);
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-hover, #dc2626);
    border-color: var(--danger-hover, #dc2626);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Warning Button */
.btn-warning {
    background: var(--warning, #f59e0b);
    color: var(--text-on-warning, #ffffff);
    border-color: var(--warning, #f59e0b);
}

.btn-warning:hover:not(:disabled) {
    background: var(--warning-hover, #d97706);
    border-color: var(--warning-hover, #d97706);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary, #94a3b8);
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-hover, rgba(99, 102, 241, 0.1));
    color: var(--accent, #6366f1);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--accent, #6366f1);
    border-color: var(--accent, #6366f1);
}

.btn-outline:hover:not(:disabled) {
    background: var(--accent, #6366f1);
    color: var(--text-on-accent, #ffffff);
    transform: translateY(-1px);
}

/* Link Button */
.btn-link {
    background: transparent;
    color: var(--accent, #6366f1);
    border-color: transparent;
    padding: 0.5rem 1rem;
    text-decoration: underline;
}

.btn-link:hover:not(:disabled) {
    color: var(--accent-hover, #4f46e5);
    text-decoration: none;
}

/* ========================================
   BUTTON SIZES
   ======================================== */

.btn-xs {
    padding: 0.25rem 0.75rem;
    font-size: 12px;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 13px;
}

.btn-md {
    padding: 0.75rem 1.5rem;
    font-size: 14px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 16px;
}

.btn-xl {
    padding: 1.25rem 2.5rem;
    font-size: 18px;
}

/* ========================================
   BUTTON STATES
   ======================================== */

.btn-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-active {
    transform: scale(0.95);
}

/* ========================================
   BUTTON GROUPS
   ======================================== */

.btn-group {
    display: inline-flex;
    gap: 0;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: var(--radius-md, 8px);
    border-bottom-left-radius: var(--radius-md, 8px);
}

.btn-group .btn:last-child {
    border-top-right-radius: var(--radius-md, 8px);
    border-bottom-right-radius: var(--radius-md, 8px);
}

.btn-group .btn:not(:last-child) {
    border-right: none;
}

/* ========================================
   ICON BUTTONS
   ======================================== */

.btn-icon {
    padding: 0.75rem;
    aspect-ratio: 1;
}

.btn-icon.btn-sm {
    padding: 0.5rem;
}

.btn-icon.btn-lg {
    padding: 1rem;
}

/* ========================================
   FULL WIDTH BUTTON
   ======================================== */

.btn-block {
    display: flex;
    width: 100%;
}

/* ========================================
   GRADIENT BUTTONS
   ======================================== */

.btn-gradient {
    background: linear-gradient(135deg, var(--accent, #6366f1) 0%, var(--accent-secondary, #8b5cf6) 100%);
    color: #ffffff;
    border: none;
}

.btn-gradient:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-hover, #4f46e5) 0%, var(--accent-secondary, #7c3aed) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-gradient-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
}

.btn-gradient-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    border: none;
}

/* ========================================
   GLASSMORPHIC BUTTONS
   ======================================== */

.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #ffffff);
}

.btn-glass:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 13px;
    }

    .btn-lg {
        padding: 0.875rem 1.75rem;
        font-size: 15px;
    }

    .btn-xl {
        padding: 1rem 2rem;
        font-size: 16px;
    }

    .btn-block-mobile {
        display: flex;
        width: 100%;
    }
}

/* ========================================
   SPECIAL BUTTON EFFECTS
   ======================================== */

.btn-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.btn-glow {
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

.btn-glow:hover:not(:disabled) {
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.7);
}
