/* Professional Button Styling with Icons */
/* Compact and Professional Design - Bootstrap 3 Compatible */

/* Base Button Styles - Slightly Larger Uniform Size */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 11px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
    gap: 4px;
    min-height: 24px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    line-height: 1.0;
}

/* Button Sizes - Slightly Larger Uniform with !important */
.btn-xs {
    padding: 5px 10px !important;
    font-size: 11px !important;
    min-height: 22px !important;
    gap: 4px !important;
    line-height: 1.0 !important;
}

.btn-sm {
    padding: 6px 12px !important;
    font-size: 11px !important;
    min-height: 24px !important;
    gap: 4px !important;
    line-height: 1.0 !important;
}

.btn-lg {
    padding: 12px 20px !important;
    font-size: 14px !important;
    min-height: 45px !important;
    gap: 6px !important;
    line-height: 1.2 !important;
}

/* Primary Buttons */
.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    background-color: #007bff !important;
    color: white !important;
    border: 1px solid #0056b3 !important;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%) !important;
    background-color: #0056b3 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
    color: white !important;
    text-decoration: none;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

/* Success Buttons */
.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%) !important;
    background-color: #28a745 !important;
    color: white !important;
    border: 1px solid #1e7e34 !important;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%) !important;
    background-color: #1e7e34 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
    color: white !important;
    text-decoration: none;
}

/* Warning Buttons */
.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
    background-color: #ffc107 !important;
    color: #212529 !important;
    border: 1px solid #e0a800 !important;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e0a800 0%, #d39e00 100%) !important;
    background-color: #e0a800 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.4);
    color: #212529 !important;
    text-decoration: none;
}

/* Danger Buttons */
.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    background-color: #dc3545 !important;
    color: white !important;
    border: 1px solid #c82333 !important;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%) !important;
    background-color: #c82333 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
    color: white !important;
    text-decoration: none;
}

/* Info Buttons */
.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
    background-color: #17a2b8 !important;
    color: white !important;
    border: 1px solid #138496 !important;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

.btn-info:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%) !important;
    background-color: #138496 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.4);
    color: white !important;
    text-decoration: none;
}

/* Secondary Buttons */
.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
    background-color: #6c757d !important;
    color: white !important;
    border: 1px solid #5a6268 !important;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #545b62 100%) !important;
    background-color: #5a6268 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.4);
    color: white !important;
    text-decoration: none;
}

/* Light Buttons */
.btn-light {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    background-color: #f8f9fa !important;
    color: #495057 !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 2px 4px rgba(248, 249, 250, 0.3);
}

.btn-light:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%) !important;
    background-color: #e9ecef !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(248, 249, 250, 0.4);
    color: #495057 !important;
    text-decoration: none;
}

/* Dark Buttons */
.btn-dark {
    background: linear-gradient(135deg, #343a40 0%, #23272b 100%) !important;
    background-color: #343a40 !important;
    color: white !important;
    border: 1px solid #23272b !important;
    box-shadow: 0 2px 4px rgba(52, 58, 64, 0.3);
}

.btn-dark:hover {
    background: linear-gradient(135deg, #23272b 0%, #1d2124 100%) !important;
    background-color: #23272b !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 58, 64, 0.4);
    color: white !important;
    text-decoration: none;
}

/* Icon Styling - Slightly Larger Uniform with !important */
.btn i {
    font-size: 9px !important;
    line-height: 1 !important;
    opacity: 0.9 !important;
}

.btn-xs i {
    font-size: 9px !important;
}

.btn-sm i {
    font-size: 9px !important;
}

.btn-lg i {
    font-size: 16px !important;
}

/* Button Groups - Slightly Larger Uniform with !important */
.btn-group {
    display: inline-flex;
    gap: 2px;
}

.btn-group .btn {
    border-radius: 0 !important;
    padding: 6px 12px !important;
    font-size: 11px !important;
    min-height: 24px !important;
}

.btn-group .btn:first-child {
    border-top-left-radius: 4px !important;
    border-bottom-left-radius: 4px !important;
}

.btn-group .btn:last-child {
    border-top-right-radius: 4px !important;
    border-bottom-right-radius: 4px !important;
}

.btn-group-vertical {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
}

.btn-group-vertical .btn {
    border-radius: 0 !important;
    padding: 6px 12px !important;
    font-size: 11px !important;
    min-height: 24px !important;
    width: 100% !important;
}

.btn-group-vertical .btn:first-child {
    border-top-left-radius: 4px !important;
    border-top-right-radius: 4px !important;
}

.btn-group-vertical .btn:last-child {
    border-bottom-left-radius: 4px !important;
    border-bottom-right-radius: 4px !important;
}

/* Button Group Sizes - Slightly Larger Uniform with !important */
.btn-group-xs .btn {
    padding: 5px 10px !important;
    font-size: 11px !important;
    min-height: 22px !important;
}

.btn-group-sm .btn {
    padding: 6px 12px !important;
    font-size: 11px !important;
    min-height: 24px !important;
}

.btn-group-lg .btn {
    padding: 6px 12px !important;
    font-size: 11px !important;
    min-height: 24px !important;
}

/* Table Actions - Slightly Larger Uniform with !important */
.table-actions {
    display: flex;
    gap: 2px;
    justify-content: center;
    align-items: center;
}

.table-actions .btn {
    padding: 5px 10px !important;
    font-size: 11px !important;
    min-height: 22px !important;
    gap: 4px !important;
    border-radius: 4px !important;
}

/* Action Button Variants */
.btn-view {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border: 1px solid #138496;
}

.btn-edit {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
    border: 1px solid #e0a800;
}

.btn-delete {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: 1px solid #c82333;
}

.btn-manage {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
    color: white;
    border: 1px solid #5a32a3;
}

.btn-toggle {
    background: linear-gradient(135deg, #fd7e14 0%, #e55a00 100%);
    color: white;
    border: 1px solid #e55a00;
}

/* Floating Action Buttons */
.btn-fab {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Form Actions - Slightly Larger Uniform with !important */
.form-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    margin-top: 15px;
}

.form-actions .btn {
    min-width: 70px !important;
    padding: 6px 12px !important;
    font-size: 11px !important;
}

/* Block Buttons - Moderate Size for Search/Reset buttons */
.btn-block {
    display: block !important;
    width: 100% !important;
    padding: 12px 18px !important;
    font-size: 13px !important;
    min-height: 42px !important;
    margin-bottom: 6px !important;
}

.btn-block i {
    font-size: 14px !important;
    margin-right: 6px !important;
}

/* Custom Navigation Buttons - Slightly Larger Uniform with !important */
.btn-nav {
    padding: 6px 12px !important;
    font-size: 11px !important;
    min-height: 24px !important;
    border-radius: 4px !important;
}

.btn-prev {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
    background-color: #6c757d !important;
    color: white !important;
    border: 1px solid #5a6268 !important;
}

.btn-next {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    background-color: #007bff !important;
    color: white !important;
    border: 1px solid #0056b3 !important;
}

.btn-nav:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-nav i {
    font-size: 9px;
    margin-right: 3px;
}

/* Default Button Styling - Bootstrap 3 Compact */
.btn-default {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    background-color: #f8f9fa !important;
    color: #495057 !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-default:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%) !important;
    background-color: #e9ecef !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    color: #495057 !important;
    text-decoration: none;
}

.btn-status-inactive {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.btn-status-pending {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

/* Responsive Design - Slightly Larger Uniform with !important */
@media (max-width: 768px) {
    .btn {
        padding: 6px 12px !important;
        font-size: 11px !important;
        min-height: 24px !important;
    }
    
    .btn-block {
        padding: 10px 15px !important;
        font-size: 12px !important;
        min-height: 40px !important;
    }
    
    .btn-block i {
        font-size: 13px !important;
        margin-right: 5px !important;
    }
    
    .btn-xs {
        padding: 5px 10px !important;
        font-size: 11px !important;
        min-height: 22px !important;
    }
    
    .btn-sm {
        padding: 6px 12px !important;
        font-size: 11px !important;
        min-height: 24px !important;
    }
    
    .btn-lg {
        padding: 10px 18px !important;
        font-size: 13px !important;
        min-height: 42px !important;
    }
    
    .btn-lg i {
        font-size: 14px !important;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 2px;
    }
    
    .table-actions .btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 5px 10px !important;
        font-size: 11px !important;
        min-height: 22px !important;
    }
}

/* Animation Effects */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-pulse {
    animation: pulse 2s infinite;
}

/* Loading State */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.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;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Bootstrap 3 Compatibility Enhancements */
.btn {
    /* Ensure Bootstrap 3 compatibility */
    vertical-align: middle;
    touch-action: manipulation;
    user-select: none;
    white-space: nowrap;
    text-align: center;
}

/* Focus states for accessibility */
.btn:focus,
.btn.focus {
    outline: thin dotted;
    outline: 5px auto -webkit-focus-ring-color;
    outline-offset: -2px;
}

/* Active states */
.btn:active,
.btn.active {
    background-image: none;
    outline: 0;
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

/* Disabled states */
.btn[disabled],
.btn.disabled,
fieldset[disabled] .btn {
    cursor: not-allowed;
    opacity: 0.65;
    filter: alpha(opacity=65);
    box-shadow: none;
}

/* Button loading state */
.btn .fa-spinner {
    animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
