/* frontend/css/base.css */
/* ═══════════════════════════════════════════════════════════════════════════
   Plateby — Base Layer
   Reset, element defaults, layout, scrollbar, a11y floor, empty states.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Paper Texture (global) ─────────────────────────────────────────────── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input { font-family: inherit; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── Main Content ─────────────────────────────────────────────────────────── */
#main-content {
  padding: 40px 48px;
  overflow-y: auto;
}

/* ── Empty States ─────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
  gap: 12px;
}
.empty-icon { font-size: 56px; }
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-1);
}
.empty-state p { font-size: 15px; color: var(--text-3); max-width: 300px; line-height: 1.6; }
.empty-state .btn-primary { margin-top: 8px; }

.empty-msg { color: var(--text-3); font-size: 14px; padding: 16px 0; }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 56px; }
  #app { grid-template-columns: var(--sidebar-w) 1fr; }
  .logo-text, .nav-item span:last-child, .sidebar-plans { display: none; }
  .sidebar-logo-img { width: 32px; padding: 4px; border-radius: 6px; }
  .sidebar-logo { padding: 14px 10px; }
  .nav-item { justify-content: center; padding: 12px; }
  #main-content { padding: 24px 20px; }
  .meal-slot { min-width: min(180px, 80vw); }
  .meal-slot:last-child { border-bottom: none; }
  .planner-header { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
}

/* ── A11y floor (PB-104c) ─────────────────────────────────────────────────── */
/* UI2: hareket azaltma tercihi (WCAG 2.3.3) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* UI2: her etkileşimli öğede tutarlı odak halkası */
:focus-visible {
  outline: 2px solid var(--primary, #C4622D);
  outline-offset: 2px;
}
