/**
 * Components CSS - Compiled Version
 * Переиспользуемые компоненты (без @apply директив)
 */

/* ========================================
   КНОПКИ (Buttons)
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: var(--motion-medium);
  touch-action: manipulation;
  height: 2.5rem;
  padding: 0 1rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--ring) / 1);
}

.btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

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

/* Размеры кнопок */
.btn-sm {
  height: 2.25rem;
  padding: 0 0.75rem;
  font-size: var(--text-sm);
}

.btn-lg {
  height: 2.75rem;
  padding: 0 2rem;
  font-size: var(--text-lg);
}

.btn-icon {
  height: 2.5rem;
  width: 2.5rem;
  padding: 0;
}

/* Варианты кнопок */
.btn-primary {
  background: linear-gradient(to right, hsl(var(--primary)), hsl(var(--primary) / 0.9));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
  box-shadow: 0 0 20px hsl(var(--primary) / 0.4);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  border: 2px solid hsl(var(--primary));
  background: transparent;
  color: hsl(var(--primary));
}

.btn-outline:hover {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  box-shadow: var(--shadow-md);
}

.btn-outline:active {
  background: hsl(var(--primary) / 0.9);
}

.btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.btn-secondary:hover {
  background: hsl(var(--secondary) / 0.8);
  box-shadow: var(--shadow-md);
}

.btn-secondary:active {
  background: hsl(var(--secondary) / 0.7);
}

.btn-ghost {
  background: transparent;
}

.btn-ghost:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-ghost:active {
  background: hsl(var(--accent) / 0.8);
}

.btn-destructive {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.btn-destructive:hover {
  background: hsl(var(--destructive) / 0.9);
  box-shadow: var(--shadow-md);
}

.btn-destructive:active {
  background: hsl(var(--destructive) / 0.8);
}

.btn-link {
  color: hsl(var(--primary));
  text-underline-offset: 4px;
  background: transparent;
  padding: 0;
  height: auto;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Полная ширина кнопки */
.btn-block {
  width: 100%;
}

/* ========================================
   КАРТОЧКИ (Cards)
   ======================================== */

.card {
  border-radius: var(--radius-xl);
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
}

.card-glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(14, 116, 144, 0.12);
  border-radius: var(--radius-xl);
  box-shadow: 
    0 8px 32px rgba(14, 116, 144, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  padding: var(--space-6);
}

.card-header {
  padding-bottom: var(--space-4);
}

.card-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-heading);
}

.card-description {
  font-size: var(--text-sm);
  color: hsl(var(--muted-foreground));
}

.card-content {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

.card-footer {
  padding-top: var(--space-4);
}

/* ========================================
   ИНПУТЫ (Inputs)
   ======================================== */

.input {
  display: flex;
  width: 100%;
  height: 2.5rem;
  border-radius: var(--radius-md);
  border: 1px solid hsl(var(--input));
  background: hsl(var(--background));
  padding: 0.5rem 0.75rem;
  font-size: var(--text-base);
  transition-property: border-color, box-shadow;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: var(--motion-fast);
}

.input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.1);
}

.input::placeholder {
  color: hsl(var(--muted-foreground));
}

.input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.input-lg {
  height: 3rem;
  padding: 0.75rem 1rem;
  font-size: var(--text-lg);
}

/* ========================================
   БЕЙДЖИ (Badges)
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  padding: 0.125rem 0.625rem;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  transition-property: color, background-color, border-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: var(--motion-fast);
}

.badge-default {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.badge-default:hover {
  background: hsl(var(--primary) / 0.8);
}

.badge-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.badge-secondary:hover {
  background: hsl(var(--secondary) / 0.8);
}

.badge-outline {
  border-color: currentColor;
  background: transparent;
  color: hsl(var(--foreground));
}

.badge-destructive {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.badge-destructive:hover {
  background: hsl(var(--destructive) / 0.8);
}

/* ========================================
   ТАБЛИЦЫ (Tables)
   ======================================== */

.table {
  width: 100%;
  caption-side: bottom;
  font-size: var(--text-sm);
  border-collapse: collapse;
}

.table th {
  height: 3rem;
  padding: 0.5rem 1rem;
  text-align: left;
  vertical-align: middle;
  font-weight: var(--font-weight-medium);
  color: hsl(var(--muted-foreground));
  border-bottom: 1px solid hsl(var(--border));
}

.table td {
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid hsl(var(--border));
}

.table tbody tr:hover {
  background: hsl(var(--muted) / 0.5);
}

/* ========================================
   КОНТЕЙНЕРЫ (Containers)
   ======================================== */

.quiz-container {
  width: 100%;
  min-height: 100vh;
  padding: var(--space-4);
}

@media (min-width: 768px) {
  .quiz-container {
    padding: var(--space-6);
  }
}

/* ========================================
   АНИМАЦИИ (Animations)
   ======================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

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

.animate-fade-in {
  animation: fadeIn var(--motion-medium) ease-out;
}

.animate-fade-up {
  animation: fadeUp var(--motion-medium) ease-out;
}

.animate-slide-in {
  animation: slideIn var(--motion-medium) ease-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ========================================
   УТИЛИТЫ (Utilities)
   ======================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Focus ring utility */
.focus-ring:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

/* Glow effect for buttons */
.shadow-glow {
  box-shadow: 0 0 20px hsl(var(--primary) / 0.4);
}

/* Glass morphism backdrop */
.backdrop-blur-glass {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
