/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #20201F;
  --surface: #272727;
  --text: #FFFFFF;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

/* ===== App Shell ===== */
.app {
  position: relative;
  height: 100%;
  width: 100%;
  max-width: 393px; /* Figma Frame Breite */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding-top: var(--safe-top);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* ===== Header ===== */
/* Figma: Datum startet bei ~72px vom oberen Rand, left 16px */
.header {
  padding: 72px 16px 0;
  flex-shrink: 0;
}

.date {
  font-size: 17px;
  font-weight: 500; /* Medium */
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 21px; /* entspricht der gemessenen Höhe ~21 */
  margin: 0;
}

/* Figma: Dashboard bei ~100px vom oberen Rand → Abstand vom Datum ~7px */
.title {
  font-size: 34px;
  font-weight: 700; /* Bold */
  letter-spacing: -0.03em;
  line-height: 41px; /* entspricht der gemessenen Höhe ~41 */
  color: var(--text);
  margin: 7px 0 0;
}

/* ===== Content ===== */
.content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px;
  /* Platz für Bottom-Bar freilassen */
  padding-bottom: calc(48px + 28px + var(--safe-bottom) + 16px);
}

/* ===== Bottom Bar ===== */
/* Figma: Buttons 28px vom unteren Rand, left/right 28px */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 393px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  padding-bottom: calc(28px + var(--safe-bottom));
  height: calc(48px + 28px + var(--safe-bottom));
  background: transparent;
  z-index: 100;
  pointer-events: none;
}

.bottom-bar > * {
  pointer-events: auto;
}

/* Select Button – Figma: 116 × 48, left 28 */
.btn-select {
  appearance: none;
  border: none;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 17px;
  font-weight: 500; /* Medium */
  letter-spacing: -0.01em;
  height: 48px;
  width: 116px;
  padding: 0;
  border-radius: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),
              background 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
}

.btn-select:active {
  transform: scale(0.94);
  background: #323232;
}

/* Add Button (+) – Figma: 48 × 48, right 28 */
.btn-add {
  appearance: none;
  border: none;
  background: var(--surface);
  color: var(--text);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),
              background 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
}

.btn-add:active {
  transform: scale(0.90);
  background: #323232;
}

.btn-add svg {
  display: block;
}

/* ===== Subtle entrance animation ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header {
  animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bottom-bar {
  animation: fadeInUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
