/* Глобално: всички елементи да броят бордъра в размерите */
* {
  box-sizing: border-box;
}

/* Основно тяло – dark theme фон + базов шрифт */
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #e2e8f0;
}

/* Централният „контейнер“ на приложението (макс. ширина като телефон) */
.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

/* Хедърът с заглавието и бутона за настройки */
.app-header {
  text-align: center;
  margin-bottom: 16px;
}

h1 {
  margin: 0;
  font-size: 1.6rem;
}

.subtitle {
  margin: 8px 0 12px;
  color: #94a3b8;
}

.accent {
  color: #38bdf8;
}

/* Етикет над полето за сума */
.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: #cbd5f5;
}

/* Поле за въвеждане на сумата */
#amount-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
  font-size: 1rem;
}

#amount-input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px #38bdf8;
}

/* ---------------- Резултат (основен панел) ---------------- */

.results {
  margin-top: 16px;
  padding: 12px;
  border-radius: 12px;
  background: #020617;
  min-height: 60px;
}

/* Текст за обяснения / съобщения */
.hint {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}

/* Един ред от резултата (иконка + текст + цена за 1 бр.) */
.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

/* Лявата част – иконка + текст */
.result-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

/* Иконка на котвата */
.result-icon {
  font-size: 1.2rem;
  width: 1.5rem;
}

/* Текстова част (брой + име на котвата) */
.result-text {
  font-size: 0.98rem;
}

/* Акцент върху броя (1, 5, ~1 и т.н.) */
.result-em {
  color: #fbbf24;
  font-weight: 600;
}

/* Дясната част – цената на 1 единица (~1.50 €) */
.result-unit-price {
  font-size: 0.8rem;
  color: #475569; /* по-тихо от основния текст */
}

/* ---------------- Панел с настройки ---------------- */

.settings {
  margin-top: 20px;
  padding: 12px;
  border-radius: 12px;
  background: #020617;
}

.settings.hidden {
  display: none;
}

.settings h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.settings-help {
  margin-top: 4px;
  margin-bottom: 12px;
  color: #64748b;
  font-size: 0.9rem;
}

/* Контейнер за списъка с котви */
.anchors-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

/* ---------- Заглавен ред над котвите (табличен стил) ---------- */

/* Редът с „Име на котвата | €/единица | Ползвай“ */
.anchors-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 6px;
  font-size: 0.75rem;
  color: #64748b;
}

/* Празна колонка за иконката – същата ширина като .anchor-icon */
.anchors-header-icon {
  width: 1.5rem;
}

/* Колона за името на котвата – заема цялата ширина */
.anchors-header-name {
  flex: 1;
}

/* Колона за цената – фиксирана ширина, да подравнява числата */
.anchors-header-price {
  width: 80px;
}

/* Колона за чекбокса „ползвай“ – по-малка */
.anchors-header-use {
  width: 60px;
}

/* ---------- Ред за една котва ---------- */

.anchor-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  background: #020617;
  border: 1px solid #1f2937;
}

/* Иконка на котвата (в настройките) */
.anchor-icon {
  font-size: 1.2rem;
  width: 1.5rem;
}

/* Контейнер за input-а с името на котвата */
.anchor-name {
  flex: 1;
}

/* Поле за име на котвата (в настройките) */
.anchor-name-input {
  width: 100%;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.9rem;
}

.anchor-name-input:focus {
  outline: none;
  border-color: #38bdf8;
}

/* Контейнер за цената – фиксирана ширина, за да съвпада с колоната */
.anchor-price {
  width: 80px;
}

/* Поле за цена в евро на единица */
.anchor-input {
  width: 100%;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.9rem;
}

.anchor-input:focus {
  outline: none;
  border-color: #38bdf8;
}

/* Остатък от стария етикет – засега не се ползва, но може да остане */
.anchor-euro-label {
  font-size: 0.75rem;
  color: #64748b;
}

/* Чекбоксът „ползвай“ + текст */
.anchor-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: #cbd5f5;
  width: 60px;
}

/* ---------------- Бутони ---------------- */

.primary-button,
.secondary-button {
  border-radius: 999px;
  border: none;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
}

.primary-button {
  background: #38bdf8;
  color: #0f172a;
  font-weight: 600;
}

.secondary-button {
  background: transparent;
  color: #e5e7eb;
  border: 1px solid #334155;
}

/* ---------------- Повторно дефиниране на основни блокове (подсилване) ---------------- */

.results,
.settings,
.anchor-row {
  background: #020617;
  border: 1px solid #1f2937;
  border-radius: 12px;
}

/* ---------------- Анимация при обновяване на резултатите ---------------- */

@keyframes results-fade-in {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Клас, който се добавя временно при обновяване */
.results-updated {
  animation: results-fade-in 0.18s ease-out;
}
