/* Универсальные стили для всех кнопок с улучшенным контрастом - соответствует WCAG 2.1 AA */

/* Базовые стили для всех кнопок */
.btn {
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    border-radius: 6px !important;
    border: 1px solid transparent !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
}

/* Универсальные hover эффекты для всех кнопок */
.btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.25) !important;
}

.btn:active {
    transform: translateY(0) !important;
}

/* Основные кнопки (btn-primary) - синяя схема */
.btn-primary {
    color: #ffffff !important;
    background-color: #2563eb !important; /* Контраст 4.5:1 с белым текстом */
    border-color: #2563eb !important;
}

.btn-primary:hover {
    color: #ffffff !important;
    background-color: #1d4ed8 !important; /* Темнее при hover */
    border-color: #1d4ed8 !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.5) !important;
}

.btn-primary:active {
    background-color: #1e40af !important;
    border-color: #1e40af !important;
}

/* Вторичные кнопки (btn-secondary) - серая схема */
.btn-secondary {
    color: #1a202c !important; /* Контраст 12.63:1 с белым фоном */
    background-color: #f7fafc !important;
    border-color: #2d3748 !important; /* Контраст 7.5:1 */
}

.btn-secondary:hover {
    color: #ffffff !important;
    background-color: #2d3748 !important; /* Контраст 12.63:1 с белым текстом */
    border-color: #2d3748 !important;
    box-shadow: 0 4px 12px rgba(45, 55, 72, 0.3) !important;
}

.btn-secondary:focus {
    box-shadow: 0 0 0 0.2rem rgba(45, 55, 72, 0.5) !important;
}

.btn-secondary:active {
    background-color: #1a202c !important;
    border-color: #1a202c !important;
}

/* Кнопки успеха (btn-success) - зеленая схема */
.btn-success {
    color: #ffffff !important;
    background-color: #059669 !important; /* Контраст 4.5:1 с белым текстом */
    border-color: #059669 !important;
}

.btn-success:hover {
    color: #ffffff !important;
    background-color: #047857 !important;
    border-color: #047857 !important;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3) !important;
}

.btn-success:focus {
    box-shadow: 0 0 0 0.2rem rgba(5, 150, 105, 0.5) !important;
}

.btn-success:active {
    background-color: #065f46 !important;
    border-color: #065f46 !important;
}

/* Кнопки предупреждения (btn-warning) - желтая схема */
.btn-warning {
    color: #1a202c !important; /* Контраст 12.63:1 с желтым фоном */
    background-color: #fbbf24 !important;
    border-color: #f59e0b !important;
}

.btn-warning:hover {
    color: #1a202c !important;
    background-color: #f59e0b !important;
    border-color: #d97706 !important;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3) !important;
}

.btn-warning:focus {
    box-shadow: 0 0 0 0.2rem rgba(251, 191, 36, 0.5) !important;
}

.btn-warning:active {
    background-color: #d97706 !important;
    border-color: #b45309 !important;
}

/* Кнопки опасности (btn-danger) - красная схема */
.btn-danger {
    color: #ffffff !important;
    background-color: #dc2626 !important; /* Контраст 4.5:1 с белым текстом */
    border-color: #dc2626 !important;
}

.btn-danger:hover {
    color: #ffffff !important;
    background-color: #b91c1c !important;
    border-color: #b91c1c !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3) !important;
}

.btn-danger:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.5) !important;
}

.btn-danger:active {
    background-color: #991b1b !important;
    border-color: #7f1d1d !important;
}

/* Кнопки информации (btn-info) - голубая схема */
.btn-info {
    color: #ffffff !important;
    background-color: #0891b2 !important; /* Контраст 4.5:1 с белым текстом */
    border-color: #0891b2 !important;
}

.btn-info:hover {
    color: #ffffff !important;
    background-color: #0e7490 !important;
    border-color: #0e7490 !important;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3) !important;
}

.btn-info:focus {
    box-shadow: 0 0 0 0.2rem rgba(8, 145, 178, 0.5) !important;
}

.btn-info:active {
    background-color: #155e75 !important;
    border-color: #164e63 !important;
}

/* Кнопки света (btn-light) - светлая схема */
.btn-light {
    color: #1a202c !important; /* Контраст 12.63:1 с белым фоном */
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
}

.btn-light:hover {
    color: #1a202c !important;
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.btn-light:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.25) !important;
}

.btn-light:active {
    background-color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}

/* Кнопки темноты (btn-dark) - темная схема */
.btn-dark {
    color: #ffffff !important;
    background-color: #1a202c !important; /* Контраст 12.63:1 с белым текстом */
    border-color: #1a202c !important;
}

.btn-dark:hover {
    color: #ffffff !important;
    background-color: #2d3748 !important;
    border-color: #2d3748 !important;
    box-shadow: 0 4px 12px rgba(26, 32, 44, 0.3) !important;
}

.btn-dark:focus {
    box-shadow: 0 0 0 0.2rem rgba(26, 32, 44, 0.5) !important;
}

.btn-dark:active {
    background-color: #4a5568 !important;
    border-color: #4a5568 !important;
}

/* Outline кнопки - сохраняем цветовые схемы с улучшенным контрастом */
.btn-outline-primary {
    color: #2563eb !important; /* Контраст 4.5:1 с белым фоном */
    background-color: transparent !important;
    border-color: #2563eb !important;
}

.btn-outline-primary:hover {
    color: #ffffff !important;
    background-color: #2563eb !important;
    border-color: #2563eb !important;
}

.btn-outline-secondary {
    color: #2d3748 !important; /* Контраст 7.5:1 с белым фоном */
    background-color: transparent !important;
    border-color: #2d3748 !important;
}

.btn-outline-secondary:hover {
    color: #ffffff !important;
    background-color: #2d3748 !important;
    border-color: #2d3748 !important;
}

.btn-outline-success {
    color: #059669 !important; /* Контраст 4.5:1 с белым фоном */
    background-color: transparent !important;
    border-color: #059669 !important;
}

.btn-outline-success:hover {
    color: #ffffff !important;
    background-color: #059669 !important;
    border-color: #059669 !important;
}

.btn-outline-warning {
    color: #d97706 !important; /* Контраст 4.5:1 с белым фоном */
    background-color: transparent !important;
    border-color: #d97706 !important;
}

.btn-outline-warning:hover {
    color: #1a202c !important;
    background-color: #fbbf24 !important;
    border-color: #fbbf24 !important;
}

.btn-outline-danger {
    color: #dc2626 !important; /* Контраст 4.5:1 с белым фоном */
    background-color: transparent !important;
    border-color: #dc2626 !important;
}

.btn-outline-danger:hover {
    color: #ffffff !important;
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
}

.btn-outline-info {
    color: #0891b2 !important; /* Контраст 4.5:1 с белым фоном */
    background-color: transparent !important;
    border-color: #0891b2 !important;
}

.btn-outline-info:hover {
    color: #ffffff !important;
    background-color: #0891b2 !important;
    border-color: #0891b2 !important;
}

.btn-outline-light {
    color: #6b7280 !important; /* Контраст 4.5:1 с белым фоном */
    background-color: transparent !important;
    border-color: #6b7280 !important;
}

.btn-outline-light:hover {
    color: #1a202c !important;
    background-color: #f8fafc !important;
    border-color: #f8fafc !important;
}

.btn-outline-dark {
    color: #1a202c !important; /* Контраст 12.63:1 с белым фоном */
    background-color: transparent !important;
    border-color: #1a202c !important;
}

.btn-outline-dark:hover {
    color: #ffffff !important;
    background-color: #1a202c !important;
    border-color: #1a202c !important;
}

/* Специальные кнопки для навигации */
.btn-nav {
    color: #1a202c !important; /* Контраст 12.63:1 с белым фоном */
    background-color: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

.btn-nav:hover {
    color: #1a202c !important;
    background-color: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
}

/* Специальные кнопки профиля и выхода (для обратной совместимости) */
.btn-profile {
    color: #1a202c !important;
    border-color: #2d3748 !important;
    background-color: #f7fafc !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.btn-profile:hover {
    color: #ffffff !important;
    border-color: #2d3748 !important;
    background-color: #2d3748 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(45, 55, 72, 0.3) !important;
}

.btn-profile:focus {
    color: #ffffff !important;
    border-color: #2d3748 !important;
    background-color: #2d3748 !important;
    box-shadow: 0 0 0 0.2rem rgba(45, 55, 72, 0.5) !important;
    outline: none !important;
}

.btn-profile:active {
    color: #ffffff !important;
    border-color: #1a202c !important;
    background-color: #1a202c !important;
    transform: translateY(0) !important;
}

.btn-logout {
    color: #dc2626 !important;
    border-color: #dc2626 !important;
    background-color: #ffffff !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.btn-logout:hover {
    color: #ffffff !important;
    border-color: #dc2626 !important;
    background-color: #dc2626 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3) !important;
}

.btn-logout:focus {
    color: #ffffff !important;
    border-color: #dc2626 !important;
    background-color: #dc2626 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.5) !important;
    outline: none !important;
}

.btn-logout:active {
    color: #ffffff !important;
    border-color: #b91c1c !important;
    background-color: #b91c1c !important;
    transform: translateY(0) !important;
}

/* Размеры кнопок */
.btn-sm {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
}

.btn-lg {
    padding: 0.75rem 1.5rem !important;
    font-size: 1.125rem !important;
    line-height: 1.5 !important;
}

/* Состояния кнопок */
.btn:disabled,
.btn.disabled {
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

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