/* =====================================================================
   POLISH V3 — дизајнерско доведување: еден фонт (Manrope), униформна
   типографија, стрелки како икони, редови со икони, копчиња.
   Само изглед. За исклучување: отстрани polish-v3.css / polish-v3.js.
   ===================================================================== */
:root {
  --pp-font: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --pp-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E");
  --pp-r-card: 18px;
  --pp-r-btn: 14px;
}

/* ---------- 1. Еден фонт насекаде ---------- */
html body,
html body button,
html body input,
html body select,
html body textarea,
html body label,
html body h1, html body h2, html body h3, html body h4, html body h5 {
  font-family: var(--pp-font) !important;
  font-feature-settings: 'ss01' on, 'cv11' on;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html body h1, html body h2, html body h3, html body h4 { letter-spacing: -0.015em; }

/* наслови на екраните */
html body.pp-shell .pp-screen-heading h1,
html body.pp-shell .pp-screen-heading h2 {
  font-size: 28px !important; font-weight: 800 !important; line-height: 1.12 !important; letter-spacing: -0.025em !important;
}
html body.pp-shell .pp-screen-heading p {
  font-size: 14px !important; font-weight: 500 !important; color: var(--nv-mut, #8B9AB5) !important; letter-spacing: 0 !important;
}

/* ---------- 2. Стрелки › → икона ---------- */
html body .pp-arrow {
  font-size: 0 !important; width: 18px; height: 18px; flex: 0 0 18px;
  display: inline-block; opacity: .55;
  background: currentColor;
  -webkit-mask: var(--pp-chev) center / 18px no-repeat; mask: var(--pp-chev) center / 18px no-repeat;
}

/* ---------- 3. Редови (launcher) — униформни ---------- */
html body.pp-shell .pp-launcher {
  border-radius: var(--pp-r-card) !important; min-height: 68px;
}
html body.pp-shell .pp-launcher strong { font-size: 15.5px !important; font-weight: 700 !important; letter-spacing: -0.01em; }
html body.pp-shell .pp-launcher small { font-size: 12.5px !important; font-weight: 500 !important; opacity: 1 !important; color: var(--nv-mut, #8B9AB5) !important; }

/* Профил: линковите претворени во редови со икони */
html body.pp-shell .pp-profile-actions { display: grid !important; gap: 10px !important; }
html body.pp-shell .pp-profile-link.p3-row {
  display: flex !important; align-items: center; gap: 14px; width: 100%;
  min-height: 68px; padding: 12px 14px !important; text-align: left;
  background: var(--nv-s1, #111F35) !important; border: 1px solid rgba(255,255,255,.06) !important;
  border-radius: var(--pp-r-card) !important; color: var(--nv-tx, #F2F4F8) !important; box-shadow: none !important;
}
.p3-ic {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px; display: grid; place-items: center;
  background: rgba(212,175,95,.12); color: var(--nv-gold, #D4AF5F);
}
.p3-ic svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.p3-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.p3-txt b { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.p3-txt small { font-size: 12.5px; font-weight: 500; color: var(--nv-mut, #8B9AB5); }

/* ---------- 4. <details> — без ▸ триаголник, чиста лента со стрелка ---------- */
html body.pp-shell #clientMainViewport details > summary {
  list-style: none !important; cursor: pointer; position: relative;
  display: flex !important; align-items: center; gap: 12px;
  font-size: 15.5px !important; font-weight: 700 !important; letter-spacing: -0.01em;
  padding-right: 34px !important;
}
html body.pp-shell #clientMainViewport details > summary[hidden] { display: none !important; }
html body.pp-shell #clientMainViewport details > summary::-webkit-details-marker { display: none !important; }
html body.pp-shell #clientMainViewport details > summary::marker { content: '' !important; }
html body.pp-shell #clientMainViewport details > summary::before { display: none !important; content: none !important; }
html body.pp-shell #clientMainViewport details > summary::after {
  content: '' !important; position: absolute; right: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  background: currentColor; opacity: .55; border: 0 !important;
  -webkit-mask: var(--pp-chev) center / 18px no-repeat; mask: var(--pp-chev) center / 18px no-repeat;
  transform: rotate(90deg); transition: transform .2s ease;
}
html body.pp-shell #clientMainViewport details[open] > summary::after { transform: rotate(-90deg); }
/* иконата пред насловот (додадена од JS) */
html body.pp-shell #clientMainViewport details > summary .p3-ic { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
html body.pp-shell #clientMainViewport details > summary .p3-ic svg { width: 19px; height: 19px; }

/* мали details во картичка (пр. „Поврзување со тренерот“) */
html body.pp-shell .pp-push-panel details > summary {
  font-size: 13.5px !important; font-weight: 600 !important; color: var(--nv-mut, #8B9AB5) !important; padding: 6px 30px 6px 0 !important;
}
html body.pp-shell .pp-push-panel details > summary::after { right: 0 !important; }

/* ---------- 5. Одјава — најдолу, смирена ---------- */
.p3-logout-wrap { margin: 18px 0 8px !important; }
html body.pp-shell #logoutBtn.p3-logout {
  display: flex !important; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 52px; border-radius: var(--pp-r-card) !important;
  background: transparent !important; border: 1px solid rgba(239,107,107,.28) !important;
  color: #F08A8A !important; font-size: 15px !important; font-weight: 700 !important; box-shadow: none !important;
}
#logoutBtn.p3-logout svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 6. Копчиња — една висина, тежина, радиус ---------- */
html body.pp-shell #clientMainViewport .btn-gold,
html body.pp-shell #clientMainViewport .btn-navy {
  border-radius: var(--pp-r-btn) !important; font-weight: 700 !important; letter-spacing: 0 !important;
  text-transform: none !important; min-height: 44px;
}
html body.pp-shell .live-workout-session-bar .btn-gold,
html body.pp-shell .live-workout-session-bar .btn-navy { font-size: 13.5px !important; }
html body.pp-shell .live-workout-session-bar div:has(> #toggleLiveWorkoutSessionBtn) { flex-wrap: wrap !important; gap: 8px !important; }
html body.pp-shell #toggleLiveWorkoutSessionBtn { flex: 1 1 100% !important; min-height: 50px !important; font-size: 15px !important; }
html body.pp-shell #finishAndSaveWorkoutBtn, html body.pp-shell #resetTodaySetsBtn { flex: 1 1 0 !important; white-space: nowrap; }
html body.pp-shell #liveWorkoutHeaderTitle { font-size: 17px !important; font-weight: 800 !important; }

/* ---------- 7. Картички — ист радиус и рамка ---------- */
html body.pp-shell #clientMainViewport .pp-push-panel {
  border-radius: 20px !important; border: 1px solid rgba(255,255,255,.06) !important;
}
html body.pp-shell #clientMainViewport .pp-push-panel h3 { font-size: 17px !important; font-weight: 800 !important; }
html body.pp-shell #clientMainViewport .pp-push-panel p { font-size: 13.5px !important; line-height: 1.45; }

/* Поздрав — без емоџи, чиста типографија */
html body.pp-shell .v2-hello b { font-weight: 800 !important; letter-spacing: -0.02em; }

/* бројки — табеларни за мирен изглед */
html body.pp-shell .v2-stat b, html body.pp-shell .v2-ring b, html body.pp-shell #liveWorkoutTimer,
html body.pp-shell .pp-profile-stat b { font-variant-numeric: tabular-nums; }

/* ---------- 8. Странично мени и Студио — ист фонт и ред ---------- */
html body #ppDrawer { font-family: var(--pp-font) !important; }

/* ---------- 9. Исхрана ---------- */
/* насловот на оброкот да не оди под копчето › */
html body.pp-shell .app-meal-card .meal-title-col { padding-right: 34px !important; }
html body.pp-shell .app-meal-card .meal-dish-title { font-weight: 800 !important; letter-spacing: -0.015em; line-height: 1.25 !important; }
/* лента „Избран оброк“ — смирена ознака */
html body.pp-shell #ppSelectedMeals {
  display: flex !important; align-items: center; gap: 10px;
  background: rgba(212,175,95,.08) !important; border: 1px solid rgba(212,175,95,.22) !important;
  border-radius: 14px !important; padding: 12px 14px !important;
  color: var(--nv-tx, #F2F4F8) !important; font-size: 14px !important; font-weight: 700 !important;
}
html body.pp-shell #ppSelectedMeals::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--nv-gold, #D4AF5F); flex: 0 0 8px;
}
/* „Замена на намирници“ и „Пазарење“ — две еднакви копчиња */
html body.pp-shell .pp-nutrition-tools { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px !important; }
html body.pp-shell .pp-nutrition-tools > button,
html body.pp-shell .pp-nutrition-tools > label,
html body.pp-shell .pp-nutrition-tools > a {
  min-height: 54px !important; padding: 10px 12px !important; border-radius: 16px !important;
  background: var(--nv-s1, #111F35) !important; border: 1px solid rgba(255,255,255,.08) !important;
  color: var(--nv-tx, #F2F4F8) !important; font-size: 14px !important; font-weight: 700 !important;
  display: flex !important; align-items: center; justify-content: center; gap: 8px; line-height: 1.2 !important; box-shadow: none !important;
}
html body.pp-shell .pp-nutrition-tools svg { color: var(--nv-gold, #D4AF5F); stroke: var(--nv-gold, #D4AF5F); flex: 0 0 auto; }

/* ---------- 10. Известувања — тивко зачувување, премиум изглед ---------- */
/* успешно зачувување не се прикажува; само грешка */
html body .pp-save-status:not(.is-error) { display: none !important; }
html body .pp-save-status.is-error {
  background: rgba(17,31,53,.96) !important; border: 1px solid rgba(240,138,138,.35) !important;
  color: #F6D3D3 !important; border-radius: 16px !important; box-shadow: 0 12px 32px rgba(0,0,0,.45) !important;
  font-size: 13.5px !important; font-weight: 600 !important; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
}
html body .pp-save-status.is-error button { color: var(--nv-gold, #D4AF5F) !important; text-decoration: none !important; }
html body .pwa-toast {
  background: rgba(17,31,53,.96) !important; color: #F2F4F8 !important;
  border: 1px solid rgba(212,175,95,.28) !important; border-radius: 16px !important;
  box-shadow: 0 14px 34px rgba(0,0,0,.5) !important; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 14px !important; font-weight: 600 !important; padding: 13px 18px 13px 44px !important;
  bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important; top: auto !important;
  width: max-content !important; max-width: calc(100vw - 32px) !important; white-space: normal !important; text-align: left !important;
}
html body .pwa-toast::before {
  content: ''; position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  background: var(--nv-gold, #D4AF5F);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17l9-10'/%3E%3C/svg%3E") center/18px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17l9-10'/%3E%3C/svg%3E") center/18px no-repeat;
}
