/* ==========================================
   Modern Button Styles
   Uses CSS variables from theme.css
   ========================================== */

/* Base button */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
    font-family: var(--font-stack);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

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

.btn i {
    font-size: 16px;
}

/* ==========================================
   Add New Button (Config Pages)
   Purple gradient button with + icon - CTA/Primary action
   ========================================== */

.btn-add-new {
    padding: 10px 18px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    background: var(--accent-gradient, linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%));
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-add-new:hover {
    background: linear-gradient(135deg, #5558e3 0%, #7c3aed 100%);
    background: var(--accent-gradient-hover, linear-gradient(135deg, #5558e3 0%, #7c3aed 100%));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-add-new:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.btn-add-new:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-add-new span {
    font-size: 16px;
    font-weight: 700;
}

/* Light theme - same purple look */
[data-theme="light"] .btn-add-new {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

[data-theme="light"] .btn-add-new:hover {
    background: linear-gradient(135deg, #5558e3 0%, #7c3aed 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ==========================================
   Filter Buttons (Toggle/Pill Style)
   Used in config pages for status filtering
   Grey/neutral default, purple when active
   ========================================== */

.filter-btn {
    padding: 8px 16px;
    background: #374151;
    background: var(--bg-neutral-dark, #374151);
    color: #e5e7eb;
    color: var(--text-secondary, #e5e7eb);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-color: var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    background: #4b5563;
    background: var(--bg-hover, #4b5563);
    color: #ffffff;
    color: var(--text-primary, #ffffff);
}

.filter-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    background: var(--accent-gradient, linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%));
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.filter-btn.active:hover {
    background: linear-gradient(135deg, #5558e3 0%, #7c3aed 100%);
    background: var(--accent-gradient-hover, linear-gradient(135deg, #5558e3 0%, #7c3aed 100%));
}

/* Light theme - grey for inactive, purple for active */
[data-theme="light"] .filter-btn {
    background: #e2e8f0;
    color: #475569;
    border-color: #cbd5e1;
}

[data-theme="light"] .filter-btn:hover {
    background: #cbd5e1;
    color: #1e293b;
}

[data-theme="light"] .filter-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    border-color: transparent;
}

/* ==========================================
   Modal Buttons
   Save/Cancel/Delete buttons for modals
   Purple for save/confirm, grey for cancel, red for delete
   ========================================== */

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    border: none;
}

/* Cancel - Grey/Secondary (No, Cancel, Close) */
.modal-btn.cancel {
    background: #4b5563;
    background: var(--bg-neutral-dark, #4b5563);
    color: #ffffff;
    color: var(--text-primary, #ffffff);
}

.modal-btn.cancel:hover {
    background: #6b7280;
    filter: brightness(1.1);
}

/* Save - Purple/Primary (OK, Save, Confirm, Add, Yes) */
.modal-btn.save {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    background: var(--accent-gradient, linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%));
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.modal-btn.save:hover {
    background: linear-gradient(135deg, #5558e3 0%, #7c3aed 100%);
    background: var(--accent-gradient-hover, linear-gradient(135deg, #5558e3 0%, #7c3aed 100%));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.modal-btn.save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Delete - Red/Danger */
.modal-btn.delete {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    background: var(--danger-gradient, linear-gradient(135deg, #e74c3c 0%, #c0392b 100%));
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.modal-btn.delete:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    background: var(--danger-gradient-hover, linear-gradient(135deg, #c0392b 0%, #a93226 100%));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Light theme adjustments */
[data-theme="light"] .modal-btn.cancel {
    background: #e2e8f0;
    color: #1e293b;
}

[data-theme="light"] .modal-btn.cancel:hover {
    background: #cbd5e1;
}

[data-theme="light"] .modal-btn.save {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
}

[data-theme="light"] .modal-btn.delete {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #ffffff;
}

/* ==========================================
   Add Modifier Button
   Purple button for adding modifiers in groups
   ========================================== */

.add-modifier-btn {
    padding: 8px 14px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    background: var(--accent-gradient, linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%));
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
    margin-top: 8px;
}

.add-modifier-btn:hover {
    background: linear-gradient(135deg, #5558e3 0%, #7c3aed 100%);
    background: var(--accent-gradient-hover, linear-gradient(135deg, #5558e3 0%, #7c3aed 100%));
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}

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

/* Light theme */
[data-theme="light"] .add-modifier-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
}

/* ==========================================
   Inline Add Button
   Small purple button for inline actions
   ========================================== */

.inline-add-btn {
    padding: 10px 14px;
    background: #6366f1;
    background: var(--accent-primary, #6366f1);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
}

.inline-add-btn:hover {
    background: #8b5cf6;
    background: var(--accent-secondary, #8b5cf6);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

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

/* Light theme */
[data-theme="light"] .inline-add-btn {
    background: #6366f1;
    color: #ffffff;
}

[data-theme="light"] .inline-add-btn:hover {
    background: #5558e3;
}

/* ==========================================
   Icon / Action Buttons
   ========================================== */

.action-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-btn.edit {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
}

.action-btn.edit:hover {
    background: rgba(99, 102, 241, 0.3);
}

.action-btn.delete {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.3);
}

.action-btn.mask {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.action-btn.mask:hover {
    background: rgba(234, 179, 8, 0.3);
}

.action-btn.unmask {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.action-btn.unmask:hover {
    background: rgba(34, 197, 94, 0.3);
}

.action-btn.view {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

.action-btn.view:hover {
    background: rgba(107, 114, 128, 0.3);
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: transparent;
}

.icon-btn.sm {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 14px;
}

.icon-btn:hover {
    background: var(--bg-card);
}

.icon-btn.edit {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.icon-btn.edit:hover {
    background: rgba(59, 130, 246, 0.3);
    transform: scale(1.05);
}

.icon-btn.delete {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.icon-btn.delete:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: scale(1.05);
}

.icon-btn.warning {
    color: var(--warning, #f59e0b);
}

.icon-btn.warning:hover {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning, #f59e0b);
    border-color: var(--warning, #f59e0b);
}

.icon-btn.success {
    color: var(--success, #22c55e);
}

.icon-btn.success:hover {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success, #22c55e);
    border-color: var(--success, #22c55e);
}

.section-action-btn {
    padding: 6px 12px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.section-action-btn:hover {
    background: var(--accent-primary-dark);
    transform: translateY(-1px);
}

/* ==========================================
   Button Color Variants
   ========================================== */

/* Primary - Purple/Indigo gradient (main action, CTA, OK, Add, Save) */
.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    background: var(--accent-gradient, linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%));
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5558e3 0%, #7c3aed 100%);
    background: var(--accent-gradient-hover, linear-gradient(135deg, #5558e3 0%, #7c3aed 100%));
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-primary:active:not(:disabled) {
    background: linear-gradient(135deg, #5558e3 0%, #7c3aed 100%);
    background: var(--accent-gradient-hover, linear-gradient(135deg, #5558e3 0%, #7c3aed 100%));
}

/* Accent - Solid purple (alternative primary) */
.btn-accent {
    background: #6366f1;
    background: var(--accent-primary, #6366f1);
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-accent:hover:not(:disabled) {
    background: #5558e3;
    background: var(--accent-primary-hover, #5558e3);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Secondary - Gray (Cancel, No, Close, Back) */
.btn-secondary {
    background: #4b5563;
    background: var(--bg-neutral-dark, #4b5563);
    color: #ffffff;
    border: none;
}

.btn-secondary:hover:not(:disabled) {
    background: #6b7280;
    filter: brightness(1.1);
}

/* Light mode secondary */
[data-theme="light"] .btn-secondary {
    background: #e2e8f0;
    color: #1e293b;
}

[data-theme="light"] .btn-secondary:hover:not(:disabled) {
    background: #cbd5e1;
}

/* Outline button */
.btn-outline {
    background: transparent;
    border: 2px solid #6366f1;
    border-color: var(--accent-primary, #6366f1);
    color: #6366f1;
    color: var(--accent-primary, #6366f1);
}

.btn-outline:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.1);
    background: var(--bg-hover, rgba(99, 102, 241, 0.1));
}

/* Success - Green gradient */
.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    background: var(--success-gradient, linear-gradient(135deg, #27ae60 0%, #229954 100%));
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
    background: var(--success-gradient-hover, linear-gradient(135deg, #229954 0%, #1e8449 100%));
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* Danger - Red gradient */
.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    background: var(--danger-gradient, linear-gradient(135deg, #e74c3c 0%, #c0392b 100%));
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    background: var(--danger-gradient-hover, linear-gradient(135deg, #c0392b 0%, #a93226 100%));
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Warning - Orange gradient */
.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    background: var(--warning-gradient, linear-gradient(135deg, #f39c12 0%, #e67e22 100%));
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    background: var(--warning-gradient-hover, linear-gradient(135deg, #e67e22 0%, #d35400 100%));
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Action variants used across admin/manager */
.btn-edit {
    background: var(--accent-primary);
    color: white;
}

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

.btn-view {
    background: #8b5cf6;
    color: white;
}

.btn-view:hover:not(:disabled) {
    filter: brightness(0.95);
}

.btn-locations {
    background: #0ea5e9;
    color: white;
}

.btn-locations:hover:not(:disabled) {
    filter: brightness(0.95);
}

.btn-roles {
    background: #8b5cf6;
    color: white;
}

.btn-roles:hover:not(:disabled) {
    filter: brightness(0.95);
}

.btn-wage {
    background: #3b82f6;
    color: white;
}

.btn-wage:hover:not(:disabled) {
    filter: brightness(0.95);
}

.btn-positions {
    background: #06b6d4;
    color: white;
}

.btn-positions:hover:not(:disabled) {
    filter: brightness(0.95);
}

.btn-deactivate {
    background: #f59e0b;
    color: white;
}

.btn-deactivate:hover:not(:disabled) {
    filter: brightness(0.95);
}

.btn-activate {
    background: #10b981;
    color: white;
}

.btn-activate:hover:not(:disabled) {
    filter: brightness(0.95);
}

.btn-save {
    background: var(--success);
    color: white;
}

.btn-save:hover:not(:disabled) {
    filter: brightness(0.95);
}

.btn-cancel {
    background: var(--text-muted);
    color: white;
}

.btn-cancel:hover:not(:disabled) {
    filter: brightness(0.95);
}

/* ==========================================
   Button Sizes
   ========================================== */

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-small {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

/* ==========================================
   Button Groups
   ========================================== */

.btn-group {
    display: inline-flex;
    gap: 8px;
}

.btn-group .btn {
    margin: 0;
    border-radius: 6px;
}

/* ==========================================
   Special Button Variants
   ========================================== */

/* Complete button (same as success) */
.btn-complete {
    background: var(--success-gradient);
    color: white;
    border: none;
}

.btn-complete:hover:not(:disabled) {
    background: var(--success-gradient-hover);
}

/* Cancel button (same as secondary) */
.btn-cancel {
    background: var(--secondary-gradient);
    color: white;
    border: none;
}

.btn-cancel:hover:not(:disabled) {
    background: var(--secondary-gradient-hover);
}

/* Add button */
.btn-add {
    background: var(--success-gradient);
    color: white;
}

.btn-add:hover {
    background: var(--success-gradient-hover);
    transform: translateY(-1px);
}

/* Remove button */
.btn-remove {
    background: var(--danger-gradient);
    color: white;
}

.btn-remove:hover {
    background: var(--danger-gradient-hover);
    transform: translateY(-1px);
}

/* ==========================================
   Quantity & Action Buttons
   Uses purple accent to match primary branding
   ========================================== */

.qty-btn, .qty-btn-modal {
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
}

.qty-btn:hover {
    background: var(--accent-gradient-hover);
    transform: translateY(-1px);
}

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

.qty-btn-modal {
    width: 40px;
    height: 40px;
    font-size: 18px;
}

.qty-btn-modal:hover {
    background: var(--accent-gradient-hover);
    transform: translateY(-2px);
}

/* Remove button (small, danger) */
.remove-btn {
    background: var(--danger-gradient);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.remove-btn:hover {
    background: var(--danger-gradient-hover);
    transform: translateY(-1px);
}

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

/* Reorder button (small, accent colored) */
.reorder-btn {
    font-size: 11px;
    font-weight: 700;
    min-width: 32px;
}

/* ==========================================
   Close Buttons
   ========================================== */

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s ease;
    color: var(--text-primary);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    transform: scale(1.2);
}

/* ==========================================
   Mobile Responsive Styles
   ========================================== */

@media (max-width: 768px) {
    .btn {
        padding: 8px 16px;
        font-size: 13px;
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn:hover:not(:disabled) {
        transform: translateY(-1px);
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 6px 12px;
        font-size: 12px;
        min-height: 40px;
        min-width: 40px;
        border-radius: 4px;
    }

    .btn-small {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    .btn:active:not(:disabled) {
        transform: scale(0.98);
    }
}
