/* ============================================
   WaveWay x CHILL — Компоненты UI
   ============================================ */

/* === Карточки (Glassmorphism) === */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border var(--transition-base);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border: var(--glass-border-hover);
}

.card--flat {
  backdrop-filter: none;
  background: var(--bg-card);
}

.card--interactive {
  cursor: pointer;
}

.card--interactive:hover {
  box-shadow: var(--shadow-glow);
}

/* === Кнопки === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  line-height: 1;
  transition: all var(--transition-fast);
  white-space: nowrap;
  min-height: 40px;
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-amber));
  color: var(--text-inverse);
}
.btn--primary:hover {
  box-shadow: var(--shadow-glow-strong);
  transform: translateY(-1px);
}

.btn--secondary {
  background: var(--bg-glass);
  border: var(--glass-border);
  color: var(--text-primary);
  backdrop-filter: blur(8px);
}
.btn--secondary:hover {
  border: var(--glass-border-hover);
  background: var(--bg-card-hover);
}

.btn--ghost {
  color: var(--text-secondary);
}
.btn--ghost:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.btn--danger {
  background: var(--accent-red);
  color: #fff;
}
.btn--danger:hover {
  background: var(--accent-red-soft);
}

.btn--sm {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--fs-xs);
  min-height: 32px;
}

.btn--lg {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--fs-base);
  min-height: 48px;
}

.btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* === Формы === */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-input);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--fs-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  min-height: 120px;
  line-height: var(--lh-relaxed);
}

.form-input--error {
  border-color: var(--color-error);
}

.form-hint {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.form-hint--error {
  color: var(--color-error);
}

/* === Модальное окно === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-tertiary);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 560px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-base);
  position: relative;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
  color: var(--text-muted);
  border-radius: var(--radius-full);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.modal__close:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
}

/* === Toast-уведомления === */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-tertiary);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: var(--fs-sm);
  pointer-events: auto;
  animation: toastIn var(--transition-base) ease forwards;
  max-width: 380px;
  border-left: 3px solid var(--color-info);
}

.toast--success { border-left-color: var(--color-success); }
.toast--warning { border-left-color: var(--color-warning); }
.toast--error   { border-left-color: var(--color-error); }

.toast.removing {
  animation: toastOut var(--transition-base) ease forwards;
}

.toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast__message {
  flex: 1;
}

.toast__close {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: var(--fs-lg);
  cursor: pointer;
  padding: 0 var(--space-xs);
}
.toast__close:hover {
  color: var(--text-primary);
}

/* === Шкала настроения === */
.mood-scale {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}

.mood-scale__item {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-md);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  border: 2px solid transparent;
}

.mood-scale__item:hover {
  transform: scale(1.2);
}

.mood-scale__item.active {
  transform: scale(1.25);
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-glow);
}

/* === Прогресс-бар === */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-amber));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.progress-bar--lg {
  height: 12px;
}

/* Круговой прогресс */
.progress-circle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-circle__text {
  position: absolute;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

/* === Теги === */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 2px var(--space-sm);
  background: var(--bg-glass);
  border: var(--glass-border);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.tag:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.tag--active {
  background: rgba(212, 165, 116, 0.15);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.tag__remove {
  cursor: pointer;
  font-size: var(--fs-sm);
  line-height: 1;
  opacity: 0.6;
}
.tag__remove:hover { opacity: 1; }

/* === Пустое состояние === */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--text-muted);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state__title {
  font-size: var(--fs-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

/* === Подтверждение (confirm dialog) === */
.confirm-dialog {
  text-align: center;
}

.confirm-dialog__title {
  font-size: var(--fs-lg);
  margin-bottom: var(--space-sm);
}

.confirm-dialog__text {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.confirm-dialog__actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

/* === Разделитель === */
.divider {
  height: 1px;
  background: var(--bg-glass-border);
  margin: var(--space-lg) 0;
}

/* === Декоративная акцент-линия === */
.accent-line {
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    var(--accent-rasta-green) 20%,
    var(--accent-rasta-gold) 50%,
    var(--accent-rasta-red) 80%,
    transparent
  );
  opacity: 0.6;
}

/* === Карточка с мягким свечением === */
.card--glow:hover {
  box-shadow:
    var(--shadow-lg),
    0 0 40px rgba(212, 165, 116, 0.08);
}

[data-theme="light"] .card--glow:hover {
  box-shadow:
    var(--shadow-lg),
    0 0 40px rgba(139, 94, 60, 0.06);
}

/* === Переключатель темы (стиль) === */
#theme-toggle-btn {
  width: 100%;
  text-align: left;
  border: none;
  background: none;
}

#theme-toggle-btn:hover {
  color: var(--accent-gold);
}
