/* ===========================
   components.css
   In-page UI blocks: quick actions, summary cards, timeline list.
   =========================== */

/* ---- Quick Actions ---- */
.quick-actions {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 20px 18px;
  box-shadow: var(--shadow-card);
}

.qa-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-mid);
  letter-spacing: 1.3px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.action-btn {
  aspect-ratio: 1;
  border: none;
  border-radius: var(--radius-btn);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  touch-action: manipulation;
  position: relative;
  padding: 12px 8px;
  transition: all 0.2s;
  box-shadow: var(--shadow-btn);
}

.action-btn:active {
  transform: scale(0.95);
}

.btn-milk    { background: var(--milk);    color: var(--milk-ink); }
.btn-pee     { background: var(--pee);     color: var(--pee-ink); }
.btn-poop    { background: var(--poop);    color: var(--poop-ink); }
.btn-sleep   { background: var(--sleep);   color: var(--sleep-ink); }
.btn-bath    { background: var(--bath);    color: var(--bath-ink); }
.btn-weight  { background: var(--weight);  color: var(--weight-ink); }
.btn-height  { background: var(--height);  color: var(--height-ink); }
.btn-vitamin { background: var(--vitamin); color: var(--vitamin-ink); }
.btn-tummy   { background: var(--tummy);   color: var(--tummy-ink); }
.btn-note    { background: var(--note);    color: var(--note-ink); }

.action-icon {
  flex-shrink: 0;
}

.action-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.action-count,
.action-latest {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(0,0,0,.1);
  color: inherit;
  border-radius: 10px;
  padding: 2px 7px;
  line-height: 1.4;
  min-width: 20px;
  text-align: center;
}

.action-latest {
  font-size: 9px;
  padding: 2px 5px;
}

.action-status {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 16px;
  background: transparent;
  padding: 0;
  min-width: auto;
}

.sleep-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  opacity: 0;
  transition: opacity 0.3s;
}

.sleep-indicator.active {
  opacity: 1;
  background: var(--sleep-ink);
  animation: sleepBlink 2s ease-in-out infinite;
}

@keyframes sleepBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.3; transform: scale(0.85); }
}

.btn-sleep.sleeping {
  background: #b8a3d9;
}

.btn-vitamin.taken {
  opacity: 0.6;
}

/* ---- Summary Section ---- */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.summary-card {
  border-radius: var(--radius-btn);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-sleep { background: var(--c2); }
.card-avg   { background: var(--c1); }
.card-next  { background: var(--c4); }

.sc-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.card-sleep .sc-icon { color: var(--sleep-ink); }
.card-avg .sc-icon   { color: var(--vitamin-ink); }
.card-next .sc-icon  { color: var(--pee-ink); }

.sc-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-mid);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sc-value {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  letter-spacing: -0.5px;
  color: var(--ink);
  line-height: 1.1;
}

/* ---- Timeline ---- */
.timeline-section {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 20px 18px;
  box-shadow: var(--shadow-card);
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.timeline-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-mid);
  letter-spacing: 1.3px;
  text-transform: uppercase;
}

.timeline-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-select {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237a6e76' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

.filter-select:hover {
  background-color: var(--white);
  border-color: var(--ink-light);
}

.filter-select:focus {
  outline: none;
  border-color: var(--ink-mid);
}

.clear-day-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--ink-mid);
  cursor: pointer;
  touch-action: manipulation;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.15s;
}

.clear-day-btn:active {
  background: var(--c5);
  color: var(--ink);
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 20px;
  color: var(--ink-light);
  font-size: 13px;
}

.timeline-empty svg {
  opacity: 0.3;
}

/* ---- Timeline Item ---- */
.timeline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 12px;
  animation: slideIn 0.2s ease;
}

.tl-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tl-icon svg {
  width: 20px;
  height: 20px;
}

.tl-milk    .tl-icon { background: var(--milk);    color: var(--milk-ink); }
.tl-pee     .tl-icon { background: var(--pee);     color: var(--pee-ink); }
.tl-poop    .tl-icon { background: var(--poop);    color: var(--poop-ink); }
.tl-sleep   .tl-icon { background: var(--sleep);   color: var(--sleep-ink); }
.tl-wake    .tl-icon { background: #fef3e8;        color: #e89b3c; }
.tl-bath    .tl-icon { background: var(--bath);    color: var(--bath-ink); }
.tl-weight  .tl-icon { background: var(--weight);  color: var(--weight-ink); }
.tl-height  .tl-icon { background: var(--height);  color: var(--height-ink); }
.tl-vitamin .tl-icon { background: var(--vitamin); color: var(--vitamin-ink); }
.tl-tummy   .tl-icon { background: var(--tummy);   color: var(--tummy-ink); }
.tl-note    .tl-icon { background: var(--note);    color: var(--note-ink); }

.tl-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tl-type {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.1px;
}

.tl-detail {
  font-size: 12px;
  color: var(--ink-mid);
}

.tl-time {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mid);
  letter-spacing: -0.2px;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 4px;
}

.tl-edit,
.tl-delete {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0,0,0,.05);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--ink-mid);
  line-height: 1;
  flex-shrink: 0;
  margin-left: 4px;
}

.tl-edit svg,
.tl-delete svg {
  display: block;
}

.tl-edit:active,
.tl-delete:active {
  background: rgba(0,0,0,.15);
}

/* ---- Responsive ---- */
@media (max-width: 360px) {
  .action-grid {
    gap: 8px;
  }

  .action-btn {
    padding: 10px 6px;
  }

  .action-label {
    font-size: 11px;
  }
}
