/* ═══════════════════════════════════════════════
   НАСТАВНИК PWA — components.css
   Компоненты интерфейса
═══════════════════════════════════════════════ */

/* ── ВЕРХНИЙ ХЕДЕР ───────────────────────────── */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-top);
  background: var(--white);
  border-bottom: 1.5px solid var(--green-50);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 100;
  padding-top: var(--safe-top);
}

.header-back {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--green-50);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: background var(--ease);
  flex-shrink: 0;
}
.header-back:hover { background: var(--green-100); }

.header-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 900;
  color: var(--text-dark);
  flex: 1;
}

.header-action {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--green-50);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: background var(--ease);
  position: relative;
  flex-shrink: 0;
}
.header-action:hover { background: var(--green-100); }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--white);
}

/* ── НИЖНЯЯ НАВИГАЦИЯ ────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-bottom) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--white);
  border-top: 1.5px solid var(--green-50);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--ease);
  flex: 1;
  max-width: 80px;
}

.nav-item:hover { background: var(--green-50); }

.nav-icon {
  font-size: 22px;
  line-height: 1;
  transition: transform var(--ease);
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.nav-item.active .nav-icon { transform: scale(1.1); }
.nav-item.active .nav-label { color: var(--green-700); }

/* ── КОНТЕНТ ОБЛАСТЬ ─────────────────────────── */
.app-content {
  padding-top: var(--nav-top);
  padding-bottom: calc(var(--nav-bottom) + var(--safe-bottom));
  min-height: 100dvh;
}

.screen {
  padding: 16px;
  max-width: 480px;
  margin: 0 auto;
}

/* ── МАСКОТ БЛОК ─────────────────────────────── */
.mascot-block {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 20px;
}

.mascot-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(8,80,65,.15));
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}

.mascot-img:hover { transform: scale(1.08) rotate(-3deg); }
.mascot-img.bounce { animation: mascotBounce .5s cubic-bezier(.34,1.56,.64,1); }

@keyframes mascotBounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.15) rotate(-5deg); }
  70%  { transform: scale(0.95) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}

.mascot-bubble-wrap {
  flex: 1;
  position: relative;
}

.mascot-bubble-wrap::before {
  content: '';
  position: absolute;
  left: -8px; bottom: 14px;
  border: 8px solid transparent;
  border-right-color: var(--amber-light);
}

.mascot-bubble {
  background: var(--amber-light);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
}

.mascot-bubble p {
  font-size: 13px;
  font-weight: 700;
  color: var(--amber-dark);
  line-height: 1.5;
}

.mascot-bubble.green {
  background: var(--green-50);
}
.mascot-bubble.green::before { border-right-color: var(--green-50); }
.mascot-bubble.green p { color: var(--green-800); }

/* Пара маскотов */
.mascot-duo {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.mascot-duo .mascot-img { width: 64px; height: 64px; }
.mascot-duo .mascot-img.main { width: 80px; height: 80px; }

/* ── КАРТОЧКА ЗАЯВКИ ─────────────────────────── */
.request-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--green-50);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 12px;
}

.request-card-header {
  padding: 16px 16px 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.subject-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--green-50);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.request-info { flex: 1; }
.request-subject { font-weight: 800; font-size: 15px; }
.request-meta { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-top: 2px; }

.request-card-body {
  padding: 0 16px 16px;
}

.request-comment {
  font-size: 13px;
  color: var(--text-mid);
  background: var(--green-50);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.request-card-actions {
  padding: 12px 16px;
  border-top: 1.5px solid var(--green-50);
  display: flex;
  gap: 8px;
}

.request-photo-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
}

.request-photo-strip::-webkit-scrollbar { display: none; }

.request-photo {
  width: 72px; height: 72px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid var(--green-100);
  flex-shrink: 0;
}

/* ── КАРТОЧКА НАСТАВНИКА ─────────────────────── */
.mentor-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--green-50);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.mentor-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--green-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  overflow: hidden;
}

.mentor-avatar img { width: 100%; height: 100%; object-fit: cover; }

.mentor-info { flex: 1; }
.mentor-name { font-weight: 800; font-size: 15px; }
.mentor-subjects { font-size: 12px; color: var(--text-muted); font-weight: 600; }

.mentor-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--amber-dark);
}

/* ── КАРТОЧКА РЕБЁНКА ────────────────────────── */
.child-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--green-50);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease);
}

.child-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.child-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.child-info { flex: 1; }
.child-name { font-weight: 800; font-size: 16px; }
.child-grade { font-size: 13px; color: var(--text-muted); font-weight: 600; }

/* ── СТАТУС ЗАЯВКИ ───────────────────────────── */
.status-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.status-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 0 0 20px;
  position: relative;
}

.status-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px; top: 32px;
  width: 2px;
  height: calc(100% - 12px);
  background: var(--green-50);
}

.status-step.done::after { background: var(--green-300); }

.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--green-50);
  border: 2px solid var(--green-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  z-index: 1;
}

.status-step.done .step-dot {
  background: var(--green-500);
  border-color: var(--green-500);
}

.status-step.active .step-dot {
  background: var(--amber);
  border-color: var(--amber);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,159,39,.4); }
  50%      { box-shadow: 0 0 0 8px rgba(239,159,39,0); }
}

.step-info { flex: 1; padding-top: 4px; }
.step-title { font-weight: 700; font-size: 14px; }
.step-time { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* ── МОНЕТЫ И ГЕЙМИФИКАЦИЯ ───────────────────── */
.coins-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--amber-light);
  border: 1.5px solid var(--amber);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 800;
  color: var(--amber-dark);
}

.coins-display .coin-icon { font-size: 16px; }

/* ── ФОТО ЗАГРУЗКА ───────────────────────────── */
.photo-upload-area {
  border: 2px dashed var(--green-300);
  border-radius: var(--radius-xl);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease);
  background: var(--green-50);
}

.photo-upload-area:hover {
  background: var(--green-100);
  border-color: var(--green-500);
}

.photo-upload-area .upload-icon { font-size: 40px; margin-bottom: 12px; }
.photo-upload-area p { font-size: 14px; font-weight: 700; color: var(--text-mid); }
.photo-upload-area span { font-size: 12px; color: var(--text-muted); }

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.photo-preview-item {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 2px solid var(--green-100);
}

.photo-preview-item img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.photo-preview-item .remove-photo {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: var(--red);
  color: white;
  border-radius: 50%;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* ── ОТЧЁТ ───────────────────────────────────── */
.report-card {
  background: var(--green-900);
  border-radius: var(--radius-xl);
  padding: 20px;
  color: var(--white);
  margin-bottom: 16px;
}

.report-card h3 {
  color: var(--green-100);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.report-card p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,.85);
}

.mood-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.mood-btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08);
  color: var(--white);
  font-size: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}

.mood-btn.selected {
  border-color: var(--amber);
  background: rgba(239,159,39,.2);
}

/* ── ПРОГРЕСС БАР ────────────────────────────── */
.progress-bar {
  height: 8px;
  background: var(--green-50);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-500), var(--green-300));
  border-radius: var(--radius-full);
  transition: width .5s ease;
}

/* ── СЕКЦИЯ ЗАГОЛОВОК ────────────────────────── */
.section-title {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 900;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 12px;
  margin-top: 24px;
}

/* ── ПУСТОЕ СОСТОЯНИЕ ────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-state .empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }

/* ── ТАРИФНЫЕ КАРТОЧКИ ───────────────────────── */
.pricing-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 2px solid var(--green-50);
  padding: 20px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color var(--ease), box-shadow var(--ease);
  position: relative;
}

.pricing-card.selected {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(29,158,117,.12);
}

.pricing-card.popular {
  border-color: var(--amber);
}

.pricing-popular-badge {
  position: absolute;
  top: -10px; right: 16px;
  background: var(--amber);
  color: var(--amber-dark);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: var(--radius-full);
}

.pricing-name { font-weight: 800; font-size: 16px; margin-bottom: 4px; }
.pricing-amount { font-family: var(--font-head); font-size: 28px; font-weight: 900; color: var(--green-800); }
.pricing-unit { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.pricing-save { font-size: 12px; color: var(--green-500); font-weight: 700; margin-top: 4px; }

/* ── БЕЗОПАСНАЯ СДЕЛКА ───────────────────────── */
.escrow-banner {
  background: var(--green-50);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--green-100);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.escrow-banner .icon { font-size: 24px; flex-shrink: 0; }
.escrow-banner h4 { font-size: 13px; margin-bottom: 3px; }
.escrow-banner p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ── УВЕДОМЛЕНИЕ БЛОКИРОВКИ ──────────────────── */
.block-alert {
  background: var(--red-light);
  border: 1.5px solid var(--red);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.block-alert .hvostik-mini {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.block-alert p {
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  line-height: 1.4;
}

/* ── ДОСКА ───────────────────────────────────── */
.board-tool {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,.1);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}

.board-tool:hover { background: rgba(255,255,255,.2); }
.board-tool.active { background: var(--amber); color: var(--amber-dark); }

/* ── ЧАТ ─────────────────────────────────────── */
.chat-message {
  margin-bottom: 8px;
}

.chat-bubble {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 12px;
  max-width: 85%;
  color: #fff;
  line-height: 1.4;
}

.chat-bubble.mine {
  background: var(--green-700);
  border-radius: 12px 12px 2px 12px;
}

.chat-bubble.theirs {
  background: rgba(255,255,255,.15);
  border-radius: 12px 12px 12px 2px;
}

.chat-sender {
  font-size: 10px;
  opacity: .6;
  margin-bottom: 2px;
}
