/**
 * Unified Button Component System
 * Extracted from send.blade.php and standardized for the entire admin system
 *
 * Usage:
 * - .system-action-btn (base class for all action buttons)
 * - .btn-save (green gradient for save/submit actions)
 * - .btn-test (cyan gradient for test/reset actions)
 * - .btn-cancel / .btn-secondary (white with border for cancel actions)
 * - .btn-danger (red gradient for dangerous actions)
 * - .btn-primary (pink gradient for primary actions)
 */

/* ===== BASE SYSTEM ACTION BUTTON ===== */
.system-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-family: inherit;
    outline: none;
    font-size: 14px;
}

.system-action-btn i {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.system-action-btn .action-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

.system-action-btn .action-desc {
    font-size: 12px;
    opacity: 0.7;
    margin: 0;
}

.system-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== BUTTON VARIANTS ===== */

/* Save Button - Green Gradient */
.btn-save {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: 2px solid #28a745;
}

.btn-save:hover:not(:disabled) {
    background: linear-gradient(135deg, #20c997, #1eb885);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Test/Reset Button - Cyan Gradient */
.btn-test {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    border: 2px solid #17a2b8;
}

.btn-test:hover:not(:disabled) {
    background: linear-gradient(135deg, #138496, #117a8b);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

/* Cancel/Secondary Button - White with Border */
.btn-cancel,
.btn-secondary {
    background: white;
    color: #264143;
    border: 2px solid #264143;
    box-shadow: 2px 2px 0px 1px #E99F4C;
}

.btn-cancel:hover:not(:disabled),
.btn-secondary:hover:not(:disabled) {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 3px 3px 0px 1px #E99F4C;
}

/* Success Button - Green Gradient (alias for btn-save) */
.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: 2px solid #28a745;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #20c997, #1eb885);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Danger Button - Red Gradient */
.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: 2px solid #dc3545;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #c82333, #a71e2a);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* ===== BUTTON SIZES ===== */

.system-action-btn.btn-sm {
    padding: 10px 16px;
    font-size: 13px;
    gap: 8px;
}

.system-action-btn.btn-sm i {
    font-size: 16px;
    width: 20px;
}

.system-action-btn.btn-sm .action-title {
    font-size: 13px;
}

.system-action-btn.btn-sm .action-desc {
    font-size: 11px;
}

.system-action-btn.btn-lg {
    padding: 18px 28px;
    font-size: 16px;
    gap: 16px;
}

.system-action-btn.btn-lg i {
    font-size: 24px;
    width: 28px;
}

.system-action-btn.btn-lg .action-title {
    font-size: 16px;
}

.system-action-btn.btn-lg .action-desc {
    font-size: 14px;
}

/* ===== BUTTON STATES ===== */

/* Loading State */
.system-action-btn.loading {
    position: relative;
    pointer-events: none;
}

.system-action-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    right: 15px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Active State */
.system-action-btn:active:not(:disabled) {
    transform: scale(0.98);
}

/* Focus State */
.system-action-btn:focus {
    outline: 2px solid rgba(222, 84, 153, 0.4);
    outline-offset: 2px;
}

/* ===== BUTTON GROUPS ===== */

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.button-group .system-action-btn {
    flex: 1;
    min-width: 120px;
}

/* ===== OUTLINE BUTTON VARIANTS ===== */

.btn-outline {
    background: transparent;
    border: 2px solid #264143;
    color: #264143;
    box-shadow: 2px 2px 0px 1px #E99F4C;
}

.btn-outline:hover:not(:disabled) {
    background: #264143;
    color: #EDDCD9;
    transform: translateY(-2px);
    box-shadow: 3px 3px 0px 1px #E99F4C;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid #DE5499;
    color: #DE5499;
}

.btn-outline-primary:hover:not(:disabled) {
    background: #DE5499;
    color: white;
}

.btn-outline-success {
    background: transparent;
    border: 2px solid #28a745;
    color: #28a745;
}

.btn-outline-success:hover:not(:disabled) {
    background: #28a745;
    color: white;
}

.btn-outline-danger {
    background: transparent;
    border: 2px solid #dc3545;
    color: #dc3545;
}

.btn-outline-danger:hover:not(:disabled) {
    background: #dc3545;
    color: white;
}

/* ===== RESPONSIVE STYLES ===== */

@media (max-width: 768px) {
    .system-action-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }

    .button-group {
        flex-direction: column;
        gap: 10px;
    }

    .button-group .system-action-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .system-action-btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .system-action-btn i {
        font-size: 18px;
        width: 22px;
    }

    .system-action-btn .action-title {
        font-size: 13px;
    }

    .system-action-btn .action-desc {
        font-size: 11px;
    }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
    .system-action-btn {
        transition: none;
    }

    .system-action-btn:hover:not(:disabled) {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .system-action-btn {
        border-width: 3px;
    }
}
