/* ============================================
   Кнопки и ссылки-кнопки
   ============================================ */

/* Базовые кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.5;
  min-height: 44px;
  min-width: 44px;
}

/* Первичная (основная) */
.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: white;
}

.btn-primary:active {
  transform: translateY(0);
}

/* Вторичная */
.btn-secondary {
  background: var(--bg-light);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-white);
  border-color: var(--primary);
  color: var(--primary);
}

/* Контурная */
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Успех (зелёная) */
.btn-success {
  background: #22c55e;
  color: white;
}

.btn-success:hover {
  background: #16a34a;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: white;
}

/* Опасность (красная) */
.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: white;
}

/* Предупреждение (жёлтая) */
.btn-warning {
  background: #f59e0b;
  color: white;
}

.btn-warning:hover {
  background: #d97706;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: white;
}

/* Маленькая кнопка */
.btn-sm {
  padding: 6px 16px;
  font-size: 0.8rem;
  min-height: 34px;
  min-width: 34px;
}

/* Большая кнопка */
.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
  min-height: 54px;
  min-width: 54px;
}

/* Кнопка с иконкой */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

.btn-icon.btn-sm {
  width: 34px;
  height: 34px;
}

.btn-icon.btn-lg {
  width: 54px;
  height: 54px;
}

/* Кнопка на всю ширину */
.btn-block {
  display: flex;
  width: 100%;
}

/* Отключённая кнопка */
.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

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

/* Кнопка с загрузкой */
.btn.loading {
  position: relative;
  color: transparent !important;
}

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

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

/* Ссылки как кнопки */
a.btn {
  text-decoration: none;
}

/* Группа кнопок */
.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-group .btn {
  flex: 0 1 auto;
}

/* Кнопки с бейджем */
.btn .badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.btn-primary .badge {
  background: rgba(255, 255, 255, 0.25);
}

.btn-outline .badge {
  background: var(--primary-bg);
  color: var(--primary);
}

/* Адаптивность */
@media (max-width: 480px) {
  .btn {
    padding: 8px 18px;
    font-size: 0.85rem;
    min-height: 38px;
    min-width: 38px;
  }
  
  .btn-lg {
    padding: 12px 24px;
    font-size: 0.95rem;
    min-height: 46px;
  }
  
  .btn-sm {
    padding: 4px 12px;
    font-size: 0.75rem;
    min-height: 30px;
    min-width: 30px;
  }
}
