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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Main Screen */
.header {
  background: white;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 1.8em;
  color: #667eea;
  margin: 0 auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px;
}

.section {
  background: white;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.section h2 {
  margin-bottom: 15px;
  color: #667eea;
  font-size: 1.3em;
}

/* Status Display */
.status-display {
  text-align: center;
  padding: 20px;
  margin-bottom: 20px;
  background: #f8f9fa;
  border-radius: 10px;
}

.status-badge {
  display: inline-block;
  padding: 10px 30px;
  border-radius: 25px;
  font-size: 1.2em;
  font-weight: 600;
  margin-bottom: 10px;
}

.status-badge.asleep {
  background: #667eea;
  color: white;
}

.status-badge.awake {
  background: #f39c12;
  color: white;
}

.status-badge.unknown {
  background: #95a5a6;
  color: white;
}

.status-time {
  font-size: 1.1em;
  color: #555;
}

/* Buttons */
.button-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.btn {
  padding: 18px 30px;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  min-height: 56px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: scale(0.97);
}

.btn-asleep {
  background: #667eea;
  color: white;
}

.btn-awake {
  background: #f39c12;
  color: white;
}

.btn-pee {
  background: #3498db;
  color: white;
}

.btn-poop {
  background: #8b4513;
  color: white;
}

.btn-both {
  background: linear-gradient(135deg, #3498db 0%, #8b4513 100%);
  color: white;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-secondary {
  background: #95a5a6;
  color: white;
}

.btn-danger {
  background: #e74c3c;
  color: white;
}

.btn-left {
  background: #e91e63;
  color: white;
}

.btn-right {
  background: #9c27b0;
  color: white;
}

.btn-bottle {
  background: #00bcd4;
  color: white;
}

.btn-pumping-left {
  background: #ff9800;
  color: white;
}

.btn-pumping-right {
  background: #ff5722;
  color: white;
}

.btn-stop {
  background: #e74c3c;
  color: white;
  width: 100%;
  margin-top: 15px;
}

/* Feeding Timer */
.feeding-timer {
  text-align: center;
  padding: 25px 15px;
  background: #f8f9fa;
  border-radius: 15px;
  margin-bottom: 15px;
}

.timer-icon {
  font-size: 4em;
  margin-bottom: 10px;
}

.timer-display {
  font-size: 3.5em;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 10px;
  font-family: 'Courier New', monospace;
  line-height: 1;
}

.timer-type {
  font-size: 1.3em;
  font-weight: 600;
  color: #555;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.stat-card {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.stat-card:hover {
  background: #e9ecef;
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
}

.stat-icon {
  font-size: 2.5em;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.9em;
  color: #777;
  font-weight: 600;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.8em;
  font-weight: 700;
  color: #667eea;
  font-family: 'Courier New', monospace;
}

/* Activity Items */
.activity-item.feeding {
  border-left-color: #e91e63;
}

/* Timeline */
#timeline-container {
  height: 600px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}

/* Timeline group labels (swim lanes) */
.vis-label {
  background-color: #f8f9fa;
  border-right: 2px solid #e0e0e0;
  font-weight: 600;
  font-size: 14px;
  color: #667eea;
  padding: 10px;
}

.vis-labelset {
  background-color: #ffffff;
}

.vis-foreground .vis-group {
  border-bottom: 1px solid #e0e0e0;
}

.timeline-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  justify-content: center;
}

.timeline-controls .btn {
  padding: 10px 20px;
  font-size: 14px;
}

/* Custom vis-timeline styling */
.vis-item {
  border-radius: 5px;
  border-width: 2px;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px !important;
  line-height: 40px;
}

.vis-item .vis-item-content {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
}

.vis-item.sleep-asleep {
  background-color: #667eea;
  border-color: #5568d3;
  color: white;
}

.vis-item.sleep-awake {
  background-color: #f39c12;
  border-color: #e67e22;
  color: white;
}

/* Feeding items - with minimum width */
.vis-item.feeding-left,
.vis-item.feeding-right,
.vis-item.feeding-bottle,
.vis-item.feeding-pumping_left,
.vis-item.feeding-pumping_right {
  min-width: 45px !important;
}

.vis-item.feeding-left {
  background-color: #e91e63;
  border-color: #c2185b;
  color: white;
}

.vis-item.feeding-right {
  background-color: #9c27b0;
  border-color: #7b1fa2;
  color: white;
}

.vis-item.feeding-bottle {
  background-color: #00bcd4;
  border-color: #0097a7;
  color: white;
}

.vis-item.feeding-pumping_left {
  background-color: #ff9800;
  border-color: #f57c00;
  color: white;
}

.vis-item.feeding-pumping_right {
  background-color: #ff5722;
  border-color: #e64a19;
  color: white;
}

/* Diaper items - with minimum width */
.vis-item.diaper-pee,
.vis-item.diaper-poop,
.vis-item.diaper-both {
  min-width: 45px !important;
}

.vis-item.diaper-pee {
  background-color: #3498db;
  border-color: #2980b9;
  color: white;
}

.vis-item.diaper-poop {
  background-color: #8b4513;
  border-color: #654321;
  color: white;
}

.vis-item.diaper-both {
  background: linear-gradient(135deg, #3498db 0%, #8b4513 100%);
  border-color: #2980b9;
  color: white;
}

.vis-item.note {
  background-color: #f39c12;
  border-color: #e67e22;
  color: white;
  min-width: 45px !important;
}

/* Textarea and inputs */
textarea {
  width: 100%;
  padding: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  margin-bottom: 15px;
  resize: vertical;
  transition: border-color 0.3s;
}

textarea:focus {
  outline: none;
  border-color: #667eea;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

.tab {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 16px;
  font-weight: 600;
  color: #777;
  cursor: pointer;
  transition: all 0.3s;
}

.tab:hover {
  color: #667eea;
}

.tab.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

/* List Tabs */
.list-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.list-tab {
  padding: 8px 16px;
  background: #f8f9fa;
  border: 2px solid #e0e0e0;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  color: #777;
  cursor: pointer;
  transition: all 0.3s;
}

.list-tab:hover {
  background: #e9ecef;
  color: #667eea;
  border-color: #667eea;
}

.list-tab.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* Activity List */
.activity-list {
  max-height: 500px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
  margin-bottom: 10px;
  background: #f8f9fa;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  border-left: 4px solid transparent;
}

.activity-item:hover {
  background: #e9ecef;
  transform: translateX(5px);
}

.activity-item.sleep {
  border-left-color: #667eea;
}

.activity-item.diaper {
  border-left-color: #3498db;
}

.activity-item.note {
  border-left-color: #f39c12;
}

.activity-icon {
  font-size: 2em;
  min-width: 40px;
  text-align: center;
}

.activity-details {
  flex: 1;
}

.activity-title {
  font-weight: 600;
  font-size: 1.1em;
  margin-bottom: 5px;
  color: #333;
}

.activity-time {
  font-size: 0.9em;
  color: #777;
  margin-bottom: 5px;
}

.activity-description {
  font-size: 0.95em;
  color: #555;
  margin-top: 8px;
  line-height: 1.4;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: 15px;
  padding: 30px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  margin-bottom: 20px;
  color: #667eea;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 25px;
}

.modal-actions .btn {
  flex: 1;
}

/* Scrollbar styling */
.activity-list::-webkit-scrollbar {
  width: 8px;
}

.activity-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.activity-list::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 10px;
}

.activity-list::-webkit-scrollbar-thumb:hover {
  background: #5568d3;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  .header {
    flex-direction: column;
    gap: 10px;
    padding: 15px;
  }

  .header h1 {
    font-size: 1.6em;
  }

  .container {
    padding: 10px;
  }

  .section {
    padding: 18px;
    margin-bottom: 12px;
    border-radius: 12px;
  }

  .section h2 {
    font-size: 1.2em;
    margin-bottom: 12px;
  }

  .button-group {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .btn {
    padding: 20px 25px;
    font-size: 18px;
    min-height: 60px;
    border-radius: 10px;
  }

  .tabs {
    flex-wrap: wrap;
    gap: 8px;
  }

  .tab {
    padding: 12px 20px;
    font-size: 16px;
    flex: 1;
    min-width: 100px;
    text-align: center;
  }

  .list-tabs {
    justify-content: center;
    gap: 8px;
  }

  .list-tab {
    padding: 10px 16px;
    font-size: 15px;
  }

  .activity-item {
    padding: 12px;
    margin-bottom: 8px;
  }

  .activity-icon {
    font-size: 2.2em;
  }

  .activity-title {
    font-size: 1.05em;
  }

  .modal-actions {
    flex-direction: column;
    gap: 12px;
  }

  .modal-actions .btn {
    width: 100%;
  }

  #timeline-container {
    height: 350px;
  }

  .timeline-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  .timeline-controls .btn {
    flex: 1;
    min-width: 80px;
  }

  .feeding-timer {
    padding: 20px 15px;
  }

  .timer-display {
    font-size: 3em;
  }

  .timer-icon {
    font-size: 3.5em;
  }

  textarea {
    font-size: 16px;
    padding: 12px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px;
    padding: 14px;
  }

  /* Prevent zoom on input focus for iOS */
  input[type="text"],
  input[type="password"],
  input[type="datetime-local"],
  textarea,
  select {
    font-size: 16px !important;
  }
}
