/* Единые глобальные стили для кнопок всего приложения */

/* Базовые стили для кнопок */
.btn {
    display: inline-flex;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 8px; /* Увеличили радиус закругления */
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Градиентная кнопка (основной тип) */
.btn-gradient {
    background: linear-gradient(135deg, #2563EB, #1E90FF);
    color: white;
    border: none;
}

.btn-gradient:hover {
    color: white;
    text-decoration: none;
}

/* Переопределяем стандартные стили Bootstrap с градиентом */
.btn-primary {
    background: linear-gradient(135deg, #2563EB, #1E90FF);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1E40AF, #0070E0);
    color: white;
    border: none;
}
/* Стилизуем успешные кнопки */
.btn-success {
    background: linear-gradient(135deg, #198754, #146c43);
    color: white;
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #157347, #115c39);
    color: white;
}

/* Кнопки удаления остаются красными */
.btn-danger {
    background: linear-gradient(135deg, #dc3545, #b02a37);
    color: white;
    border: none;
}

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

/* Outline кнопки */
.btn-outline-primary {
    color: #2563EB;
    border: 2px solid #2563EB;
    background-color: transparent;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #2563EB, #1E90FF);
    color: white;
    border-color: transparent;
}
/* Размеры кнопок */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 6px;
}

.btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    line-height: 1.5;
    border-radius: 10px;
}

/* Кнопки-иконки (для редактирования, просмотра и др.) */
.icon-btn {
    height: 32px;
    width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 0;
    background-color: white !important;
    border: none !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s ease;
}

.icon-btn i {
    color: #2563EB;
    font-size: 15px;
    margin: 0;
}

.icon-btn:hover {
    background-color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

.icon-btn:hover i {
    color: #1E40AF;
}

/* Группы кнопок */
.btn-group {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

.btn-group > .btn {
    position: relative;
    flex: 1 1 auto;
}

.btn-group > .btn:not(:first-child) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.btn-group > .btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Disabled состояние */
.btn:disabled, .btn.disabled {
    opacity: 0.65;
    pointer-events: none;
    transform: none !important;
    box-shadow: none !important;
}

/* Общие эффекты фокуса */
.btn:focus, .btn:active:focus {
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.25);
    outline: 0;
}

/* Кнопки с полной шириной */
.btn.w-100 {
    display: inline-flex;
    width: 100%;
}

/* Выравнивание иконок внутри кнопок */
.btn i, .btn svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    line-height: 1;
    height: 1em;
    width: 1em;
}

/* Классы margin для иконок, чтобы они были правильно выравнены */
.btn .me-1, 
.btn .me-2, 
.btn .me-3, 
.btn .ms-1, 
.btn .ms-2, 
.btn .ms-3 {
    display: inline-flex;
    align-items: center;
    /* Исправляем слишком большие отступы */
    margin-right: 0.25rem !important; /* Было 25rem */
    margin-left: 0.25rem !important;  /* Было 25rem */
}

/* Специфичные классы margins для уточнения */
.btn .me-1 { margin-right: 0.25rem !important; }
.btn .me-2 { margin-right: 0.5rem !important; }
.btn .me-3 { margin-right: 0.75rem !important; }
.btn .ms-1 { margin-left: 0.25rem !important; }
.btn .ms-2 { margin-left: 0.5rem !important; }
.btn .ms-3 { margin-left: 0.75rem !important; }

/* Специальный класс для выравнивания иконок в кнопках на странице деталей курса */
.course-detail-page .btn i,
.module-detail-page .btn i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    top: -0.03em; /* Тонкая настройка вертикального положения */
}
