/* Professional Button System - Accessibility First */

/* =================================
   BASE BUTTON STYLES
   ================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Button Icons */
.btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* =================================
   PRIMARY BUTTONS - Blue Theme
   ================================= */

.btn-primary {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    text-decoration: none;
}

.btn-primary:active {
    background: #1e40af;
    border-color: #1e40af;
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

/* =================================
   SECONDARY BUTTONS - Light Blue
   ================================= */

.btn-secondary {
    background: #eff6ff;
    color: #1e40af;
    border-color: #dbeafe;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: #dbeafe;
    border-color: #bfdbfe;
    color: #1e3a8a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    text-decoration: none;
}

.btn-secondary:active {
    background: #bfdbfe;
    border-color: #93c5fd;
    transform: translateY(0);
}

/* =================================
   OUTLINE BUTTONS - Border Style
   ================================= */

.btn-outline {
    background: #ffffff;
    color: #2563eb;
    border-color: #2563eb;
}

.btn-outline:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    text-decoration: none;
}

.btn-outline:active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
    transform: translateY(0);
}

/* =================================
   GHOST BUTTONS - Minimal Style
   ================================= */

.btn-ghost {
    background: #f8fafc !important;
    color: #374151 !important;
    border: 2px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-ghost:hover {
    background: #e2e8f0 !important;
    color: #1f2937 !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-1px);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-ghost:active {
    background: #cbd5e1 !important;
    color: #1f2937 !important;
    transform: translateY(0);
}

/* =================================
   SUCCESS BUTTONS - Green Theme
   ================================= */

.btn-success {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: #059669;
    border-color: #059669;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    text-decoration: none;
}

.btn-success:active {
    background: #047857;
    border-color: #047857;
    transform: translateY(0);
}

/* =================================
   WARNING BUTTONS - Orange Theme
   ================================= */

.btn-warning {
    background: #f59e0b;
    color: #ffffff;
    border-color: #f59e0b;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    text-decoration: none;
}

.btn-warning:active {
    background: #b45309;
    border-color: #b45309;
    transform: translateY(0);
}

/* =================================
   DANGER BUTTONS - Red Theme
   ================================= */

.btn-danger {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    text-decoration: none;
}

.btn-danger:active {
    background: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(0);
}

/* =================================
   BUTTON SIZES
   ================================= */

.btn-xs {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
}

.btn-md {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 8px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 8px;
}

.btn-xl {
    padding: 16px 32px;
    font-size: 18px;
    border-radius: 10px;
    font-weight: 700;
}

/* =================================
   BUTTON GROUPS
   ================================= */

.btn-group {
    display: inline-flex;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-group .btn {
    border-radius: 0;
    border-right-width: 1px;
}

.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-width: 2px;
}

.btn-group .btn:not(:last-child) {
    border-right-color: rgba(255, 255, 255, 0.2);
}

/* =================================
   LOADING STATES
   ================================= */

.btn-loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: btn-spin 1s linear infinite;
}

.btn-loading .btn-text {
    opacity: 0;
}

@keyframes btn-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =================================
   RESPONSIVE & MOBILE
   ================================= */

@media (max-width: 768px) {
    .btn {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px; /* Touch-friendly */
    }
    
    .btn-xs {
        padding: 8px 14px;
        min-height: 36px;
    }
    
    .btn-sm {
        padding: 10px 18px;
        min-height: 40px;
    }
    
    .btn-lg {
        padding: 14px 26px;
        min-height: 48px;
    }
    
    .btn-xl {
        padding: 18px 34px;
        min-height: 52px;
    }
}

/* =================================
   HIGH CONTRAST MODE SUPPORT
   ================================= */

@media (prefers-contrast: high) {
    .btn {
        border-width: 3px;
    }
    
    .btn-primary:hover {
        background: #1e3a8a;
        border-color: #1e3a8a;
    }
    
    .btn-outline {
        border-width: 3px;
    }
    
    .btn-outline:hover {
        background: #1e3a8a;
        border-color: #1e3a8a;
    }
}

/* =================================
   DARK MODE SUPPORT
   ================================= */

@media (prefers-color-scheme: dark) {
    .btn-ghost {
        color: #d1d5db;
    }
    
    .btn-ghost:hover {
        background: #374151;
        color: #f9fafb;
        border-color: #4b5563;
    }
    
    .btn-secondary {
        background: #1f2937;
        color: #60a5fa;
        border-color: #374151;
    }
    
    .btn-secondary:hover {
        background: #111827;
        color: #93c5fd;
        border-color: #4b5563;
    }
} 