/* MoneyTrack — кастомные стили поверх Tailwind */

html { color-scheme: dark; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* запрет зума по двойному тапу */
}

/* Карточки */
.card {
  background: #1e293b;
  border-radius: 1rem; /* rounded-xl */
  box-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.08);
}

/* Экраны: плавные переходы */
.screen {
  animation: screenIn 0.25s ease;
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Поля ввода */
.input {
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.75rem;
  padding: 0.625rem 0.875rem;
  color: #f1f5f9;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}
.label {
  display: block;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.375rem;
}

/* Переключатель типа */
.type-btn {
  padding: 0.6rem 0;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #94a3b8;
  transition: all 0.2s ease;
}
.type-btn.active-expense { background: #ef4444; color: #fff; }
.type-btn.active-income  { background: #10b981; color: #fff; }
.type-btn.active-transfer { background: #3b82f6; color: #fff; }
.type-btn.active-saving  { background: #f59e0b; color: #fff; }
.type-btn.active-invest  { background: #8b5cf6; color: #fff; }

/* Кнопки */
.btn-accent {
  background: #3b82f6;
  border-radius: 0.75rem;
  padding: 0.7rem 0;
  font-weight: 600;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.btn-accent:hover { filter: brightness(1.1); }
.btn-accent:active { transform: scale(0.98); }
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 0.75rem;
  padding: 0.7rem 0;
  font-weight: 600;
  color: #cbd5e1;
  transition: background 0.15s ease;
}
.btn-ghost:hover { background: rgba(148, 163, 184, 0.1); }

/* Нижний таб-бар */
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.55rem 0 0.4rem;
  font-size: 0.7rem;
  color: #94a3b8;
  transition: color 0.15s ease;
}
.tab.active { color: #3b82f6; }

/* Строки истории */
.tx-row {
  animation: screenIn 0.2s ease;
}
.tx-row .delete-btn {
  opacity: 0.75;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.tx-row .delete-btn:hover { opacity: 1; transform: scale(1.1); }

/* Кнопки выбора источника */
.source-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.75rem;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  color: #e2e8f0;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.source-btn:hover { border-color: #3b82f6; background: rgba(59, 130, 246, 0.08); }
.source-btn:active { transform: scale(0.98); }

/* Заглушка диаграммы */
.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.85rem;
  text-align: center;
  padding: 0 1.5rem;
}

/* Поздравление: эмодзи-конфетти */
.celebrate-pop { animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.6); }
  100% { opacity: 1; transform: scale(1); }
}
.confetti-emoji {
  position: fixed;
  top: -40px;
  font-size: 24px;
  z-index: 60;
  animation: confettiFall linear forwards;
  pointer-events: none;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(360deg); opacity: 0.8; }
}

/* Блоки «Расходы / Доходы» на статистике */
.stat-block {
  border-radius: 1rem;
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.12);
}
.stat-expense {
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.22), rgba(127, 29, 29, 0.28));
  border-color: rgba(239, 68, 68, 0.35);
}
.stat-income {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.22), rgba(6, 78, 59, 0.28));
  border-color: rgba(16, 185, 129, 0.35);
}
.stat-label {
  font-size: 0.72rem;
  color: #cbd5e1;
  opacity: 0.85;
  margin-bottom: 0.375rem;
}
.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.stat-expense .stat-value { color: #fca5a5; }
.stat-income .stat-value { color: #6ee7b7; }
.stat-saving {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.22), rgba(120, 53, 15, 0.28));
  border-color: rgba(245, 158, 11, 0.35);
}
.stat-saving .stat-value { color: #fcd34d; }
.stat-invest {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.22), rgba(76, 29, 149, 0.28));
  border-color: rgba(139, 92, 246, 0.35);
}
.stat-invest .stat-value { color: #c4b5fd; }
.stat-hint {
  font-size: 0.62rem;
  color: #94a3b8;
  margin-top: 0.5rem;
  opacity: 0.7;
}
.chart-toggle { cursor: pointer; transition: transform 0.12s ease, filter 0.15s ease; }
.chart-toggle:hover { filter: brightness(1.15); }
.chart-toggle:active { transform: scale(0.98); }

/* Видео в инструкции */
.help-video {
  width: 100%;
  border-radius: 0.75rem;
  background: #0f172a;
  aspect-ratio: 16 / 9;
}

/* Модал */
#confirm-modal > div { animation: screenIn 0.2s ease; }
