/* ============================
   Baby Movement Tracker Styles
   Pink/Coral Theme - Mobile First
   ============================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --primary: #ff6b9d;
  --primary-dark: #e85a8a;
  --primary-light: #ffa0c4;
  --secondary: #6b5ce7;
  --success: #4ade80;
  --warning: #fbbf24;
  --bg-gradient: linear-gradient(135deg, #fff5f8 0%, #fce4ec 50%, #f8bbd9 100%);
  --card-bg: rgba(255, 255, 255, 0.9);
  --text-primary: #2d2d2d;
  --text-secondary: #666;
  --shadow: 0 4px 20px rgba(255, 107, 157, 0.2);
  --shadow-lg: 0 8px 40px rgba(255, 107, 157, 0.3);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #fff5f8; /* Core fallback color to prevent white spots */
  background: var(--bg-gradient);
  background-attachment: fixed; /* Ensures gradient fills background area during scroll */
  min-height: 100vh;
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

/* PWA Install Banner */
.pwa-install-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 107, 157, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  animation: slideDown 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.pwa-install-content {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-install-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: transparent;
  border-radius: 12px;
  padding: 4px;
}

.pwa-install-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.pwa-install-text {
  flex: 1;
}

.pwa-install-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.pwa-install-copy {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pwa-install-actions .close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top));
  padding-bottom: calc(100px + env(safe-area-inset-bottom));
}

/* Header */
.header {
  text-align: center;
  padding: 24px 0;
  position: relative;
}

.theme-toggle {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: rgba(255, 107, 157, 0.12);
  color: var(--primary-dark);
}

.theme-toggle:active {
  transform: scale(0.97);
}

.theme-toggle svg {
  stroke: currentColor;
}

.header-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header h1 {
  font-size: 1.75rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 4px;
}

/* Navigation Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: var(--card-bg);
  padding: 6px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.tab {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
}

/* Views */
.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Counter Card */
.counter-card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  margin-bottom: 20px;
}

.date-display {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.time-display {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 8px 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 107, 157, 0.1);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--primary-dark);
  margin-bottom: 24px;
}

.status-badge .status-icon {
  flex-shrink: 0;
}

.status-badge.completed {
  background: rgba(74, 222, 128, 0.15);
  color: #22c55e;
}

.status-badge.completed .status-icon {
  stroke: #22c55e;
}

/* Sync Indicator */
.sync-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 18px;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sync-indicator.pending {
  background: rgba(251, 191, 36, 0.15);
  color: #f59e0b;
}

.sync-indicator.offline {
  background: rgba(96, 165, 250, 0.15);
  color: #3b82f6;
  cursor: default;
}

.sync-indicator.syncing {
  background: rgba(107, 92, 231, 0.15);
  color: var(--secondary);
}

.sync-indicator:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Counter Circle */
.counter-circle {
  width: 160px;
  height: 160px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, #fff 0%, #fce4ec 100%);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 -4px 10px rgba(255, 107, 157, 0.2),
    0 8px 24px rgba(255, 107, 157, 0.3);
  position: relative;
}

.counter-circle::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  z-index: -1;
  opacity: 0.5;
}

.counter-number {
  font-size: 4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.counter-label {
  font-size: 1.25rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Kick Button */
.kick-button-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.kick-button {
  width: 100%;
  max-width: 280px;
  padding: 20px 40px;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(255, 107, 157, 0.4);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.kick-button:active {
  transform: scale(0.95);
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
}

.kick-button.disabled {
  background: linear-gradient(135deg, #ccc 0%, #aaa 100%);
  cursor: not-allowed;
  box-shadow: none;
}

.kick-button.pulse {
  animation: pulse 0.4s ease;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.kick-icon {
  display: flex;
  align-items: center;
}

/* Completion Info */
.completion-info {
  margin-top: 24px;
  padding: 20px;
  background: rgba(74, 222, 128, 0.1);
  border-radius: 16px;
  animation: celebrate 0.5s ease;
}

@keyframes celebrate {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.completion-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.completion-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #22c55e;
}

.completion-time {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Kicks Log */
.kicks-log {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.kicks-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.kicks-log h3 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
}

.undo-btn {
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.undo-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.undo-btn:not(:disabled):hover {
  background: rgba(255, 107, 157, 0.12);
  color: var(--primary-dark);
}

.kicks-log ul {
  list-style: none;
}

.kicks-log li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.kicks-log li:last-child {
  border-bottom: none;
}

.kick-badge {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.kick-time {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Dashboard */
.dashboard-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.dashboard-card h2 {
  font-size: 1.25rem;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-card h2 svg {
  stroke: var(--primary);
}

.baby-card {
  overflow: hidden;
}

.baby-card-compact {
  padding-top: 20px;
  padding-bottom: 20px;
}

.baby-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.secondary-btn,
.primary-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-btn {
  background: rgba(255, 107, 157, 0.12);
  color: var(--primary-dark);
}

.secondary-btn:hover {
  background: rgba(255, 107, 157, 0.2);
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 8px 18px rgba(255, 107, 157, 0.25);
}

.primary-btn:hover {
  transform: translateY(-1px);
}

.baby-empty-state {
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.08) 0%, rgba(107, 92, 231, 0.08) 100%);
  border-radius: 18px;
}

.baby-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.baby-empty-copy {
  margin-top: 6px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.baby-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.baby-summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.baby-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.baby-birthdate {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.baby-age-badge {
  padding: 8px 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.14) 0%, rgba(107, 92, 231, 0.14) 100%);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 0.84rem;
  white-space: nowrap;
}

.baby-age-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.baby-age-line {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
}

.baby-age-warning {
  color: #ef4444;
  font-weight: 700;
}

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

.stat-item {
  text-align: center;
  padding: 16px 8px;
  background: rgba(255, 107, 157, 0.08);
  border-radius: 16px;
}

.stat-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Calendar */
.calendar-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}

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

.calendar-header h3 {
  font-size: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.calendar-header h3 svg {
  stroke: var(--primary);
}

.calendar-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
  background: var(--primary);
  color: white;
}

.calendar-nav-btn:hover svg {
  stroke: white;
}

.calendar-nav-btn svg {
  stroke: var(--text-secondary);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-day.completed {
  background: linear-gradient(135deg, var(--success) 0%, #22c55e 100%);
  color: white;
}

.calendar-day.in-progress {
  background: linear-gradient(135deg, var(--warning) 0%, #f59e0b 100%);
  color: white;
}

.calendar-day.today {
  box-shadow: 0 0 0 2px var(--primary);
}

.calendar-day.empty {
  background: transparent;
  cursor: default;
}

.calendar-day.future {
  opacity: 0.4;
  cursor: default;
}

.calendar-day:not(.empty):not(.future):hover {
  transform: scale(1.1);
}

.pending-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  background: #f59e0b;
  border-radius: 50%;
  animation: pending-dot-pulse 1.5s infinite;
}

@keyframes pending-dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
}

.dot.completed {
  background: var(--success);
}

.dot.in-progress {
  background: var(--warning);
}

/* History */
#history-view h2 {
  margin-bottom: 16px;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

#history-view h2 svg {
  stroke: var(--primary);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item-wrapper {
  width: 100%;
}

.history-item {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.2s ease;
}

.history-item:hover {
  box-shadow: var(--shadow-lg);
}

.history-item-main {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.history-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.expand-icon {
  transition: transform 0.3s ease;
  stroke: var(--text-secondary);
}

.history-item.expanded .expand-icon {
  transform: rotate(180deg);
}

.history-date {
  font-weight: 600;
  color: var(--text-primary);
}

.history-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.history-status {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.history-status.completed {
  background: rgba(74, 222, 128, 0.15);
  color: #22c55e;
}

.history-status.incomplete {
  background: rgba(251, 191, 36, 0.15);
  color: #f59e0b;
}

/* History Details (Expandable) */
.history-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background: rgba(0, 0, 0, 0.02);
}

.history-item.expanded .history-details {
  max-height: 500px;
  padding: 0 20px 16px;
}

.kicks-detail-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.kick-detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--card-bg);
  border-radius: 8px;
  font-size: 0.85rem;
}

.kick-detail-item.pending {
  animation: pending-pulse 1s infinite ease-in-out;
  border: 1px dashed rgba(0, 0, 0, 0.08);
}

.kick-detail-number {
  font-weight: 700;
  color: var(--primary);
}

.kick-detail-time {
  color: var(--text-secondary);
}

.loading-spinner {
  text-align: center;
  padding: 16px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.no-kicks,
.error {
  text-align: center;
  padding: 16px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Sync Toast Notifications */
.sync-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 1000;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.sync-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.sync-toast-success {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  color: white;
}

.sync-toast-error {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  color: white;
}

.sync-toast-info {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  color: white;
}

/* Session Details Modal */
body.modal-open {
  overflow: hidden;
}

.session-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.session-modal.hidden {
  display: none;
}

.session-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.session-modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.session-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.session-modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.session-modal-meta {
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.session-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.session-modal-close:hover {
  background: rgba(255, 107, 157, 0.12);
  color: var(--primary-dark);
}

.session-modal-body {
  padding: 16px 18px 18px;
  max-height: 60vh;
  overflow: auto;
}

.baby-modal-card {
  max-width: 420px;
}

.baby-form {
  display: flex;
  flex-direction: column;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field + .form-field {
  margin-top: 16px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-primary);
  font-size: 1rem;
}

.form-input:focus {
  outline: none;
  border-color: rgba(255, 107, 157, 0.5);
  box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.12);
}

.baby-preview {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.08) 0%, rgba(107, 92, 231, 0.08) 100%);
}

.baby-preview-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.baby-preview-primary {
  margin-top: 8px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.baby-preview-copy {
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 18px 18px;
}

/* Pending kick indicator (subtle pulse) */
.kicks-log li.pending {
  animation: pending-pulse 1s infinite ease-in-out;
}

@keyframes pending-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

/* App Footer with User ID */
.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 16px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  background: none;
  border-top: none;
  display: flex;
  justify-content: center;
  z-index: 50;
  pointer-events: none; /* Make footer container non-blocking */
}

.user-id-display {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  background: rgba(0, 0, 0, 0.04); /* Subtle background for contrast */
  border-radius: 8px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
  max-width: 100%;
  overflow: hidden;
  pointer-events: auto; /* Re-enable pointer events for the ID itself to allow copying */
}

.user-id-display:hover {
  background: rgba(255, 107, 157, 0.1);
  color: var(--primary);
}

.user-id-display:active {
  transform: scale(0.98);
}

.user-id-display svg {
  stroke: var(--text-secondary);
  flex-shrink: 0;
}

.user-id-display:hover svg {
  stroke: var(--primary);
}

#user-id-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recovery-modal-body {
  padding-top: 0;
}

.recovery-panel {
  display: grid;
  gap: 14px;
}

.recovery-card {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 16px;
  padding: 16px;
}

.recovery-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.recovery-card-copy {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.recovery-code {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 107, 157, 0.08);
  color: var(--text-primary);
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.recovery-inline-message {
  min-height: 20px;
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state-icon svg {
  stroke: var(--text-secondary);
  width: 48px;
  height: 48px;
}

/* Responsive */
@media (max-width: 380px) {
  .app {
    padding: 12px;
  }

  .counter-circle {
    width: 140px;
    height: 140px;
  }

  .counter-number {
    font-size: 3rem;
  }

  .kick-button {
    padding: 16px 32px;
    font-size: 1.25rem;
  }

  .baby-summary-top {
    flex-direction: column;
  }

  .baby-age-badge {
    white-space: normal;
  }
}

/* Dark Mode Support */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --card-bg: rgba(30, 30, 50, 0.9);
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
}

:root[data-theme="dark"] .counter-circle {
  background: linear-gradient(135deg, #2a2a4a 0%, #1a1a2e 100%);
}

:root[data-theme="dark"] .stat-item {
  background: rgba(255, 107, 157, 0.15);
}

:root[data-theme="dark"] .calendar-day {
  background: rgba(255, 255, 255, 0.05);
}

:root[data-theme="dark"] .app-footer {
  background: none;
  border-top: none;
}

:root[data-theme="dark"] .user-id-display {
  background: rgba(255, 255, 255, 0.05);
}

:root[data-theme="dark"] .user-id-display:hover {
  background: rgba(255, 107, 157, 0.15);
}

:root[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255, 107, 157, 0.18);
}

:root[data-theme="dark"] .secondary-btn {
  background: rgba(255, 107, 157, 0.18);
}

:root[data-theme="dark"] .baby-empty-state,
:root[data-theme="dark"] .baby-preview {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.14) 0%, rgba(107, 92, 231, 0.14) 100%);
}

:root[data-theme="dark"] .baby-age-line {
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .form-input {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}
