/* Reset & base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: #20201F;
  color: #FFFFFF;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App container – exact iPhone 15 Pro proportions */
.app {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 430px; /* slight headroom for larger phones */
  margin: 0 auto;
  background-color: #20201F;
  display: flex;
  flex-direction: column;
  /* Safe area support */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Header */
.header {
  padding-top: 8px;           /* tighter to better match mock visual on device */
  padding-left: 16px;
  padding-right: 16px;
  flex-shrink: 0;
}

.date {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #DDDDDD;
  line-height: 1.2;
  margin-bottom: 2px;
}

.title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  line-height: 1.15;
  margin: 0;
}

/* Main content – empty as in design */
.content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* empty */
}

/* Bottom bar */
.bottom-bar {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 26px 12px 31px; /* exact measured margins from design */
  /* extra space for home indicator already covered by safe-area */
}

/* Select button – pill */
.btn-select {
  appearance: none;
  border: none;
  background-color: #3B3B3A;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  height: 49px;
  min-width: 87px;
  padding: 0 20px;
  border-radius: 24.5px; /* fully rounded pill */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-select:active {
  background-color: #4A4A49;
  transform: scale(0.97);
}

/* Add (+) button – circle */
.btn-add {
  appearance: none;
  border: none;
  background-color: #3B3B3A;
  color: #FFFFFF;
  width: 49px;
  height: 49px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.1s ease;
  flex-shrink: 0;
}

.btn-add:active {
  background-color: #4A4A49;
  transform: scale(0.97);
}

.btn-add svg {
  display: block;
}

/* ========== Context Menu (View 2) ========== */

.menu-backdrop {
  position: absolute;
  inset: 0;
  background: transparent; /* no dim in the original design */
  z-index: 40;
}

.context-menu {
  position: absolute;
  /* Positioned to match View 2: above bottom bar, right-aligned near the + button */
  right: 26px;
  bottom: calc(12px + 49px + 16px + env(safe-area-inset-bottom, 0px)); /* above the bottom bar + gap */
  width: 168px;
  background-color: #2C2C2B;
  border-radius: 16px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 50;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  transform-origin: bottom right;
  animation: menuIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1) forwards;
}

.context-menu[hidden],
.menu-backdrop[hidden] {
  display: none !important;
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.menu-item {
  appearance: none;
  border: none;
  background-color: #3B3B3A;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  height: 44px;
  width: 100%;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.12s ease, transform 0.08s ease;
}

.menu-item:active {
  background-color: #4A4A49;
  transform: scale(0.98);
}

.menu-item-cancel {
  color: #FF453A; /* iOS system red */
}

/* Ensure full-screen look on iOS when installed */
@media (display-mode: standalone) {
  .app {
    /* already using safe-area */
  }
}

/* Desktop preview centering */
@media (min-width: 431px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
  }
  .app {
    height: 852px;
    width: 393px;
    border-radius: 47px; /* iPhone-like corners for preview */
    box-shadow: 0 0 0 12px #1a1a1a, 0 25px 50px rgba(0,0,0,0.5);
    overflow: hidden;
  }
}

