/* Modern Button Styles */
.btn, button.btn, a.btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    padding: 0.75rem 1.5rem !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
    text-align: center !important;
    text-decoration: none !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease-in-out !important;
    position: relative !important;
    overflow: hidden !important;
    min-height: 44px !important;
    font-family: inherit !important;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

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

/* Primary Button */
.btn-primary, button.btn-primary, a.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
    color: white !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

.btn-primary:hover, button.btn-primary:hover, a.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af) !important;
    border-color: #2563eb !important;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4) !important;
    transform: translateY(-1px) !important;
}

.btn-primary:active, button.btn-primary:active, a.btn-primary:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3) !important;
}

/* Secondary Button */
.btn-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    border-color: #6b7280;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    border-color: #4b5563;
    box-shadow: 0 6px 16px rgba(107, 114, 128, 0.4);
    transform: translateY(-1px);
}

/* Success Button */
.btn-success, button.btn-success, a.btn-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
    border-color: #10b981 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.btn-success:hover, button.btn-success:hover, a.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
    border-color: #059669 !important;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4) !important;
    transform: translateY(-1px) !important;
}

/* Warning Button */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    border-color: #d97706;
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

/* Danger Button */
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border-color: #dc2626;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

/* Outline Buttons */
.btn-outline {
    background: transparent !important;
    color: #3b82f6 !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1) !important;
}

.btn-outline:hover {
    background: #3b82f6 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
    transform: translateY(-1px) !important;
}

.btn-outline-success {
    background: transparent;
    color: #10b981;
    border-color: #10b981;
}

.btn-outline-success:hover {
    background: #10b981;
    color: white;
    transform: translateY(-1px);
}

.btn-outline-danger {
    background: transparent;
    color: #ef4444;
    border-color: #ef4444;
}

.btn-outline-danger:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-1px);
}

/* Button Sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    min-height: 36px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    min-height: 52px;
}

.btn-xl {
    padding: 1.25rem 2.5rem;
    font-size: 1.2rem;
    min-height: 60px;
}

/* Link Button */
.btn-link {
    background: transparent;
    color: #3b82f6;
    border: none;
    text-decoration: underline;
    box-shadow: none;
    padding: 0.5rem 0.75rem;
    min-height: auto;
}

.btn-link:hover {
    background: transparent;
    color: #1d4ed8;
    transform: none;
    box-shadow: none;
}

/* Icon Buttons */
.btn-icon {
    padding: 0.75rem;
    min-width: 44px;
    min-height: 44px;
}

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

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

/* 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;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Persian Font Support */
.PF .btn {
    font-family: 'Vazir', 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
}

/* RTL Support */
[dir="rtl"] .btn {
    direction: rtl;
}

[dir="rtl"] .btn svg {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .btn-outline {
        color: #60a5fa;
        border-color: #60a5fa;
    }
    
    .btn-outline:hover {
        background: #60a5fa;
        color: #1f2937;
    }
    
    .btn-link {
        color: #60a5fa;
    }
    
    .btn-link:hover {
        color: #93c5fd;
    }
}
