/* ════════════════════════════════════════════════════════════════════
   vitonella-ds-wellness-supplement.css
   ────────────────────────────────────────────────────────────────────
   PURPOSE:
     hydration-card.js ve energy-check-in.js custom element'leri,
     `.v-hydration-card__quick-btn`, `.v-hydration-card__add`,
     `.v-energy-card__level` gibi class isimleri yazıyor. Eğer
     vitonella-ds.css'te bu class'lar tanımlı değilse, browser bunları
     default native button olarak render ediyor (gri border, sistem
     font'u) — Vitonella tasarımıyla uyumsuz.

     Bu dosya o eksik kuralları, mobil app_theme.dart'taki accent
     palette'i (#4ee3b2) ile birebir uyumlu olarak ekler.

   WHERE:
     vitonella_deploy/backend/static/css/vitonella-ds-wellness.css

   HOW TO LOAD:
     dashboard.html, raporlar.html, consultations.html'de mevcut
     vitonella-ds.css link'inin HEMEN ALTINA ekle:

       <link rel="stylesheet" href="static/css/vitonella-ds.css">
       <link rel="stylesheet" href="static/css/vitonella-ds-wellness.css">

   NOTES:
     - Mevcut vitonella-ds.css'teki CSS değişkenlerini (--v-accent,
       --v-bg-elevated, --v-border, --v-text-*) bekler. Yoksa fallback
       renkler kullanılır.
     - Reduced-motion ve mobile breakpoint'leri eklenmiştir.
   ════════════════════════════════════════════════════════════════════ */

/* ── Color fallbacks (vitonella-ds.css yoksa bile çalışsın diye) ─── */
:root {
  --v-accent:           #4ee3b2;            /* mobil app_theme.dart accent */
  --v-accent-strong:    #3dcfa0;
  --v-accent-subtle:    rgba(78, 227, 178, 0.12);
  --v-accent-faint:     rgba(78, 227, 178, 0.04);
  --v-bg-elevated:      rgba(255, 255, 255, 0.04);
  --v-bg-surface:       rgba(255, 255, 255, 0.06);
  --v-border:           rgba(255, 255, 255, 0.08);
  --v-border-strong:    rgba(255, 255, 255, 0.16);
  --v-text-primary:     #F1F5F9;
  --v-text-secondary:   #94A3B8;
  --v-text-tertiary:    #64748B;
  --v-radius-sm:        10px;
  --v-radius:           14px;
  --v-radius-lg:        20px;
}

/* ════════════════════════════════════════════════════════════════════
   HYDRATION CARD
   ════════════════════════════════════════════════════════════════════ */

.v-hydration-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.v-hydration-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.v-hydration-card__info {
  background: transparent;
  border: 1px solid var(--v-border);
  color: var(--v-text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  font-family: inherit;
}
.v-hydration-card__info:hover {
  color: var(--v-accent);
  border-color: var(--v-accent);
  background: var(--v-accent-subtle);
}

.v-hydration-card__ring {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}

.v-hydration-card__reason,
.v-hydration-card__safety {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--v-text-secondary);
  padding: 10px 12px;
  border-radius: var(--v-radius-sm);
  background: var(--v-accent-faint);
  border: 1px solid var(--v-border);
}
.v-hydration-card__safety {
  background: rgba(251, 191, 36, 0.06);
  border-color: rgba(251, 191, 36, 0.18);
  color: #fcd34d;
}

/* ── Quick-add buttons (+100ml, +200ml, +250ml, +500ml) ──────────── */
.v-hydration-card__quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.v-hydration-card__quick-btn {
  /* Reset native */
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  cursor: pointer;

  /* Pill style — matches mobile hydration_card.dart accent pills */
  padding: 10px 4px;
  background: var(--v-bg-elevated);
  border: 1px solid var(--v-border);
  border-radius: var(--v-radius-sm);
  color: var(--v-text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.18s ease;
  text-align: center;
}
.v-hydration-card__quick-btn:hover {
  background: var(--v-accent-subtle);
  border-color: var(--v-accent);
  color: var(--v-accent);
  transform: translateY(-1px);
}
.v-hydration-card__quick-btn:active {
  transform: translateY(0);
  background: var(--v-accent);
  color: #042b1d;
}
.v-hydration-card__quick-btn:focus-visible {
  outline: 2px solid var(--v-accent);
  outline-offset: 2px;
}

/* ── Custom amount row (input + Add) ──────────────────────────────── */
.v-hydration-card__custom {
  display: flex;
  gap: 8px;
}

.v-hydration-card__custom-input {
  /* Reset native */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  font-family: inherit;

  flex: 1;
  padding: 10px 14px;
  background: var(--v-bg-elevated);
  border: 1px solid var(--v-border);
  border-radius: var(--v-radius-sm);
  color: var(--v-text-primary);
  font-size: 0.9rem;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.v-hydration-card__custom-input:focus {
  outline: none;
  border-color: var(--v-accent);
  background: var(--v-accent-faint);
}
.v-hydration-card__custom-input::placeholder {
  color: var(--v-text-tertiary);
}
/* Hide number-input spinners (cleaner look) */
.v-hydration-card__custom-input::-webkit-inner-spin-button,
.v-hydration-card__custom-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.v-hydration-card__add {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  cursor: pointer;
  padding: 10px 18px;
  background: var(--v-accent);
  border: 1px solid var(--v-accent);
  border-radius: var(--v-radius-sm);
  color: #042b1d;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.18s ease;
}
.v-hydration-card__add:hover {
  background: var(--v-accent-strong);
  border-color: var(--v-accent-strong);
}

/* ── Today's logs list ────────────────────────────────────────────── */
.v-hydration-card__logs {
  margin-top: 4px;
}
.v-hydration-card__logs-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--v-text-tertiary);
  margin-bottom: 8px;
}
.v-hydration-card__logs-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 120px;
  overflow-y: auto;
}
.v-hydration-card__log {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 0.82rem;
}

/* ════════════════════════════════════════════════════════════════════
   ENERGY CHECK-IN CARD
   ════════════════════════════════════════════════════════════════════ */

.v-energy-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.v-energy-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.v-energy-card__sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--v-text-secondary);
}

.v-energy-card__levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 4px;
}

/* ── Level buttons (full / okay / rest_day) ──────────────────────── */
.v-energy-card__level {
  /* Reset native */
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  cursor: pointer;

  /* Card-like pill button */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--v-bg-elevated);
  border: 1px solid var(--v-border);
  border-radius: var(--v-radius);
  color: var(--v-text-primary);
  transition: all 0.2s ease;
  min-height: 88px;
}
.v-energy-card__level:hover {
  border-color: var(--lvl-color, var(--v-accent));
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}
.v-energy-card__level:focus-visible {
  outline: 2px solid var(--lvl-color, var(--v-accent));
  outline-offset: 2px;
}
.v-energy-card__level.is-selected {
  background: var(--v-accent-subtle);
  border-color: var(--lvl-color, var(--v-accent));
  border-width: 2px;
  /* Compensate for the +1px border so layout doesn't shift */
  padding: 13px 7px;
}
.v-energy-card__level.is-selected .v-energy-card__label {
  color: var(--lvl-color, var(--v-accent));
  font-weight: 700;
}

.v-energy-card__emoji {
  font-size: 1.6rem;
  line-height: 1;
}
.v-energy-card__label {
  font-size: 0.78rem;
  text-align: center;
  line-height: 1.25;
  color: var(--v-text-secondary);
  font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════════
   TOAST (used by both hydration + energy on save)
   ════════════════════════════════════════════════════════════════════ */

.v-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--v-accent);
  color: #042b1d;
  padding: 10px 20px;
  border-radius: var(--v-radius);
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  animation: v-toast-pop 0.3s ease-out;
}
.v-toast--error {
  background: #ef4444;
  color: #fff;
}

@keyframes v-toast-pop {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ════════════════════════════════════════════════════════════════════
   MODAL (used by hydration explainer)
   ════════════════════════════════════════════════════════════════════ */

.v-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.v-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.v-modal__panel {
  position: relative;
  z-index: 1;
}

/* ════════════════════════════════════════════════════════════════════
   REPORTS — segmented control (7 days / 30 days / 3 months)
   ────────────────────────────────────────────────────────────────────
   raporlar.html'de muhtemelen 3 native button var, segment olarak
   stillenmemiş. Aşağıdaki kurallar `.v-segment` parent'ı altındaki
   button'ları segment haline getirir. raporlar.html'i gönderdiğinde
   doğru class'ları HTML'e eklerim.
   ════════════════════════════════════════════════════════════════════ */

.v-segment {
  display: inline-flex;
  background: var(--v-bg-elevated);
  border: 1px solid var(--v-border);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.v-segment > button {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  cursor: pointer;
  padding: 8px 18px;
  background: transparent;
  border: none;
  border-radius: 999px;
  color: var(--v-text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}
.v-segment > button:hover {
  color: var(--v-text-primary);
}
.v-segment > button.is-active,
.v-segment > button[aria-pressed="true"] {
  background: var(--v-accent);
  color: #042b1d;
}

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE — mobile breakpoints
   ════════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .v-hydration-card__quick {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .v-hydration-card__quick-btn {
    font-size: 0.78rem;
    padding: 9px 2px;
  }
  .v-hydration-card__custom {
    flex-direction: column;
  }
  .v-hydration-card__add {
    width: 100%;
  }
  .v-energy-card__level {
    min-height: 76px;
    padding: 10px 6px;
  }
  .v-energy-card__emoji { font-size: 1.4rem; }
  .v-energy-card__label { font-size: 0.72rem; }
}

/* Stack the wellness row on small screens (matches mobile single-column) */
@media (max-width: 760px) {
  .v-wellness-row {
    grid-template-columns: 1fr !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
   ACCESSIBILITY — reduced motion
   ════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .v-hydration-card__quick-btn,
  .v-hydration-card__add,
  .v-energy-card__level,
  .v-segment > button,
  .v-toast {
    transition: none;
    animation: none;
  }
}

/* ════════════════════════════════════════════════════════════════════
   RTL support (ar, fa)
   ════════════════════════════════════════════════════════════════════ */

[dir="rtl"] .v-hydration-card__custom {
  flex-direction: row-reverse;
}
[dir="rtl"] .v-hydration-card__log {
  flex-direction: row-reverse;
}
