/* Mette — podstawowe style uzupełniające Tailwind */

:root {
  --accent:       #d54c3c;
  --accent-dark:  #bf3e30;
  --bg:           #0d1929;
  --bg-card:      #162236;
  --text:         #f1f5f9;
  --text-muted:   #94a3b8;
  --border:       #243450;
  --danger:       #ef4444;
  --warning:      #f59e0b;
  --brand-navy:   #1e2c4a;
  --brand-cream:  #f0e3c7;
  --brand-red:    #d54c3c;
  --brand-brown:  #5a4a30;
}

* { -webkit-tap-highlight-color: transparent; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  min-height: 100dvh;
  overscroll-behavior: none;
}

/* PWA safe areas */
.safe-top    { padding-top: env(safe-area-inset-top, 0); }
.safe-bottom { padding-bottom: env(safe-area-inset-bottom, 0); }

/* Karta */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
}

/* Przycisk główny */
.btn-primary {
  background: var(--accent);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
}
.btn-primary:hover  { background: var(--accent-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Przycisk drugorzędny */
.btn-secondary {
  background: transparent;
  color: var(--text);
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 500;
  font-size: 1rem;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
}
.btn-secondary:hover { background: rgba(255,255,255,0.05); }

/* Input */
.input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  color: var(--text);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus   { border-color: var(--accent); }
.input::placeholder { color: var(--text-muted); }

/* Label */
.label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  display: block;
}

/* Nawigacja dolna */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 50;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.25rem;
  cursor: pointer;
  transition: color 0.15s;
  color: var(--text-muted);
  font-size: 0.7rem;
  gap: 0.2rem;
}
.nav-item.active { color: var(--accent); }
.nav-item svg { width: 1.5rem; height: 1.5rem; }

/* Posiłek kafelek */
.meal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  transition: border-color 0.15s;
  cursor: pointer;
}
.meal-card.done   { opacity: 0.5; border-color: var(--accent); }
.meal-card.skipped { opacity: 0.35; }

/* Badge */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-green  { background: rgba(213,76,60,0.15); color: var(--accent); }
.badge-yellow { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-red    { background: rgba(239,68,68,0.15);  color: var(--danger); }

/* Toast powiadomienie */
#toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0) + 1rem);
  left: 50%;
  transform: translateX(-50%) translateY(-5rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  z-index: 200;
  transition: transform 0.3s;
  white-space: nowrap;
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.success { border-color: var(--accent); color: var(--accent); }
#toast.error   { border-color: var(--danger); color: var(--danger); }

/* Loader */
.spinner {
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  width: 1.5rem; height: 1.5rem;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Progress kroki onboardingu */
.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 9999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 9999px;
  transition: width 0.3s;
}

/* Zdjęcie preview */
.photo-preview {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 1rem;
  border: 1px solid var(--border);
}

/* Animacja wejścia */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(1rem); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: slideUp 0.3s ease both; }

/* Feedback thumbs */
.thumb-btn {
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.15s;
  background: transparent;
}
.thumb-btn:hover      { background: rgba(255,255,255,0.1); }
.thumb-btn.active-up  { background: rgba(213,76,60,0.2); border-color: var(--accent); }
.thumb-btn.active-down { background: rgba(239,68,68,0.2); border-color: var(--danger); }

/* ========== METTE BRAND ========== */

/* Splash screen */
#splash {
  position: fixed; inset: 0;
  background: var(--brand-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0;
  z-index: 999;
  transition: opacity 0.4s;
}

.splash-logo {
  width: min(30vh, 180px);
  height: min(30vh, 180px);
  object-fit: contain;
  margin-bottom: 1.5rem;
}

/* Nazwa marki */
.brand-name {
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 700;
  font-size: 32px;
  letter-spacing: 0.18em;
  color: var(--brand-cream);
  text-transform: uppercase;
  text-align: center;
}

/* Tagline marki */
.brand-tagline {
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: #d4c39a;
  text-align: center;
  margin-top: 8px;
}

/* Header mini logo w aplikacji */
.app-header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.app-header-brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.app-header-brand-text {
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.1em;
  color: var(--brand-cream);
  text-transform: uppercase;
}

/* Auth screen logo */
.auth-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
}
.auth-logo-wrap img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin-bottom: 1rem;
}

/* Light mode overrides (jeśli user ma jasny motyw systemowy) */
@media (prefers-color-scheme: light) {
  .brand-name { color: var(--brand-navy); }
  .brand-tagline { color: var(--brand-brown); }
}
