/**
 * Professional Button Design System
 */

/* Base button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 44px;
    white-space: nowrap;
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover:before {
    left: 100%;
}

/* Primary button */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary, #1167b1), var(--accent-secondary, #0d4f8c));
    color: white;
    box-shadow: 0 4px 15px rgba(17, 103, 177, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 103, 177, 0.4);
    background: linear-gradient(135deg, var(--accent-secondary, #0d4f8c), var(--accent-primary, #1167b1));
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(17, 103, 177, 0.3);
}

/* Secondary button */
.btn-secondary {
    background: var(--bg-secondary, #f8f9fa);
    color: var(--text-primary, #333);
    border: 2px solid var(--border-color, #e5e7eb);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: var(--bg-tertiary, #e9ecef);
    border-color: var(--accent-primary, #1167b1);
    color: var(--accent-primary, #1167b1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Success button */
.btn-success {
    background: linear-gradient(135deg, var(--success, #28a745), #1e7e34);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    background: linear-gradient(135deg, #1e7e34, var(--success, #28a745));
}

/* Danger button */
.btn-danger {
    background: linear-gradient(135deg, var(--danger, #dc3545), #c82333);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
    background: linear-gradient(135deg, #c82333, var(--danger, #dc3545));
}

/* Warning button */
.btn-warning {
    background: linear-gradient(135deg, var(--warning, #ffc107), #e0a800);
    color: #212529;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
    background: linear-gradient(135deg, #e0a800, var(--warning, #ffc107));
}

/* Info button */
.btn-info {
    background: linear-gradient(135deg, var(--info, #17a2b8), #138496);
    color: white;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
    background: linear-gradient(135deg, #138496, var(--info, #17a2b8));
}

/* Outline button variants */
.btn-outline-primary {
    background: transparent;
    color: var(--accent-primary, #1167b1);
    border: 2px solid var(--accent-primary, #1167b1);
    box-shadow: 0 2px 8px rgba(17, 103, 177, 0.1);
}

.btn-outline-primary:hover {
    background: var(--accent-primary, #1167b1);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 103, 177, 0.3);
}

/* Ghost button */
.btn-ghost {
    background: transparent;
    color: var(--text-primary, #333);
    border: 2px solid transparent;
}

.btn-ghost:hover {
    background: var(--bg-secondary, #f8f9fa);
    border-color: var(--border-color, #e5e7eb);
    transform: translateY(-1px);
}

/* Button sizes */
.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    min-height: 36px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
    min-height: 52px;
}

.btn-xl {
    padding: 20px 40px;
    font-size: 18px;
    min-height: 60px;
}

/* Icon buttons */
.btn-icon {
    padding: 12px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
}

.btn-icon.btn-sm {
    padding: 8px;
    min-width: 36px;
    min-height: 36px;
}

.btn-icon.btn-lg {
    padding: 16px;
    min-width: 52px;
    min-height: 52px;
}

/* Floating action button */
.btn-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-primary, #1167b1);
    color: white;
    box-shadow: 0 4px 20px rgba(17, 103, 177, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.btn-fab:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 25px rgba(17, 103, 177, 0.5);
}

/* Button groups */
.btn-group {
    display: inline-flex;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-group .btn {
    border-radius: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-group .btn:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.btn-group .btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    border-right: none;
}

/* Disabled state */
.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn:disabled:hover,
.btn.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Loading state */
.btn.loading {
    position: relative;
    color: transparent;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .btn {
        padding: 10px 20px;
        font-size: 13px;
        min-height: 40px;
    }
    
    .btn-fab {
        width: 48px;
        height: 48px;
        bottom: 20px;
        right: 20px;
        font-size: 20px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 0;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .btn-group .btn:first-child {
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
        border-bottom-left-radius: 0;
    }
    
    .btn-group .btn:last-child {
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
        border-top-right-radius: 0;
        border-bottom: none;
    }
}

/* Dark mode button adjustments */
[data-theme="dark"] .btn-secondary {
    background: var(--bg-tertiary, #404040);
    color: var(--text-primary, #ffffff);
    border-color: var(--border-color, #404040);
}

[data-theme="dark"] .btn-outline-primary {
    color: var(--accent-primary, #4dabf7);
    border-color: var(--accent-primary, #4dabf7);
}

[data-theme="dark"] .btn-ghost {
    color: var(--text-primary, #ffffff);
}

[data-theme="dark"] .btn-ghost:hover {
    background: var(--bg-tertiary, #404040);
    border-color: var(--border-color, #404040);
}
