/* ================================================================
   iOS TIMER CSS v4 — iOS 17/18 faithful replica
================================================================ */

#ios-timer {
  background: #000;
  display: none;
  flex-direction: column;
  height: 100%;
}
#ios-timer.active-ui { display: flex; }

/* ── Safe area spacer (replaces removed title row) ──────── */
.ios-safe-top {
  height: calc(env(safe-area-inset-top) + 12px);
  flex-shrink: 0;
}

/* ── iOS Slots container ────────────────────────────────── */
.ios-slots-container {
  display: flex;
  align-items: stretch;
  height: 216px;     /* exactly 3 × 72px — but we use 58px items × 3 + label */
  margin-top: 8px;
  position: relative;
  flex-shrink: 0;
}

/* Center highlight lines */
.ios-highlight-bar {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 44px;
  border-top: 0.5px solid rgba(255,255,255,0.2);
  border-bottom: 0.5px solid rgba(255,255,255,0.2);
  pointer-events: none;
  z-index: 10;
}

/* ── Per-slot column ────────────────────────────────────── */
.ios-slot-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* height fills parent */
}

.ios-slot {
  flex: 1;
  width: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  position: relative;
}
.ios-slot:active { cursor: grabbing; }

/* Fade masks */
.ios-slot::before,
.ios-slot::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 60px;
  pointer-events: none;
  z-index: 3;
}
.ios-slot::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.95) 0%, transparent 100%);
}
.ios-slot::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, transparent 100%);
}

.ios-slot-track {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

/* Item height for iOS = 44px so 3 items = 132px inside 216px container
   (remaining space = label below) */
.ios-slot-item {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 300;
  color: rgba(255,255,255,0.3);
  font-family: -apple-system, 'SF Pro Display', sans-serif;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.ios-slot-item.selected {
  color: #fff;
  font-size: 24px;
  font-weight: 400;
}

.ios-unit-label {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  margin-top: 6px;
  font-family: -apple-system, 'SF Pro Text', sans-serif;
  flex-shrink: 0;
  height: 20px;
  line-height: 20px;
}

/* ── Actions ────────────────────────────────────────────── */
.ios-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 28px 20px;   /* more top margin from slots */
  flex-shrink: 0;
}
.ios-btn {
  width: 76px; height: 76px;
  border-radius: 50%;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: -apple-system, 'SF Pro Text', sans-serif;
  transition: opacity 0.15s;
}
.ios-btn:active { opacity: 0.7; }
.ios-btn.cancel { background: #1c1c1e; color: #fff; }
.ios-btn.start  { background: #1d4a2e; color: #30d158; }

/* ── Fields (label / when timer ends) ───────────────────── */
.ios-fields {
  margin: 0 16px;
  background: #1c1c1e;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}
.ios-field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  font-family: -apple-system, 'SF Pro Text', sans-serif;
  font-size: 16px;
  color: #fff;
  border-bottom: 0.5px solid rgba(255,255,255,0.08);
}
.ios-field-row:last-child { border-bottom: none; }
.ios-field-value { color: #888; }

/* ── Recents ────────────────────────────────────────────── */
.ios-recents-title {
  font-family: -apple-system, 'SF Pro Display', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  padding: 20px 16px 8px;
}
.ios-recents {
  padding: 0 16px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.ios-recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0;
}
.ios-recent-time { font-size: 32px; font-weight: 300; font-family: -apple-system; }
.ios-recent-label { font-size: 13px; color: #888; font-family: -apple-system; }
.ios-recent-play {
  width: 38px; height: 38px;
  background: #1d4a2e; border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center;
  color: #30d158; font-size: 13px; cursor: pointer;
}

/* ── iOS Tab Bar — faithful to Clock app ────────────────── */
.ios-tab-bar {
  display: flex;
  background: rgba(20,20,20,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid rgba(255,255,255,0.12);
  padding: 6px 0 0;
  padding-bottom: calc(env(safe-area-inset-bottom) + 2px);
  flex-shrink: 0;
}
.ios-tab {
  flex: 1;
  background: none;
  border: none;
  color: #636366;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 4px 0 6px;
  font-family: -apple-system, 'SF Pro Text', sans-serif;
}
.ios-tab .tab-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.ios-tab .tab-icon svg { width: 24px; height: 24px; fill: currentColor; }
.ios-tab span { font-size: 10px; font-weight: 500; color: inherit; }
.ios-tab.active { color: #ff9f0a; }
