/* Task Tracker - Pills Module Styles */

/* Pills Container Layout */
.pills-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Next Doses Section */
.next-doses {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 12px;
  border: 1px solid var(--border);
}

.next-doses h3 {
  color: var(--accent-green);
  margin-bottom: 8px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.next-dose-item {
  background: var(--bg-tertiary);
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  position: relative;
}

.next-dose-item:last-child {
  margin-bottom: 0;
}

.dose-info {
  padding-right: 160px; /* Space for both buttons */
}

.dose-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.dose-time {
  color: var(--accent-blue);
  font-weight: 500;
  font-size: 1rem;
}

.dose-countdown {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0;
}

.dose-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
}

.dose-taken-btn {
  background: var(--accent-green);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  min-height: 36px;
}

.dose-taken-btn:hover {
  background: #059669;
  transform: translateY(-1px);
}

.dose-skipped-btn {
  background: var(--accent-yellow);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  min-height: 36px;
}

.dose-skipped-btn:hover {
  background: #b45309;
  transform: translateY(-1px);
}

/* Daily Schedule Section */
.daily-schedule {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 12px;
  border: 1px solid var(--border);
}

.daily-schedule h3 {
  color: var(--accent-purple);
  margin-bottom: 8px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pill-schedule-item {
  background: var(--bg-tertiary);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}

.pill-schedule-item:last-child {
  margin-bottom: 0;
}

.pill-header {
  position: relative;
  margin-bottom: 8px;
}

.pill-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
  padding-right: 120px; /* Space for edit/delete buttons */
}

.pill-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 8px;
}

.pill-edit-btn,
.pill-delete-btn {
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  color: white;
}

.pill-edit-btn {
  background: var(--accent-blue);
}

.pill-edit-btn:hover {
  background: #0056b3;
}

.pill-delete-btn {
  background: var(--accent-red);
}

.pill-delete-btn:hover {
  background: #b91c1c;
}

.pill-times {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.time-badge {
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border);
}

.time-badge.next {
  background: var(--accent-blue);
  color: white;
  animation: pulse 2s infinite;
}

.time-badge.taken {
  background: var(--accent-green);
  color: white;
  opacity: 0.7;
}

.time-badge.skipped {
  background: var(--accent-yellow);
  color: white;
  opacity: 0.7;
}

.time-badge.missed {
  background: var(--accent-red);
  color: white;
}

.pill-notes {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
  margin-top: 4px;
}

/* Pill Management Controls */
.pill-management {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.pill-management .btn {
  min-width: 140px;
  flex: 1;
  max-width: 200px;
}

/* Dose Notification Styles */
.dose-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-secondary);
  border: 2px solid var(--accent-blue);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 122, 204, 0.3);
  z-index: 1001;
  animation: slideInNotification 0.3s ease-out;
  max-width: 320px;
  min-width: 280px;
}

.notification-content {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
  position: relative;
}

.notification-icon {
  font-size: 2rem;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

.notification-text {
  flex: 1;
}

.notification-title {
  font-weight: 700;
  color: var(--accent-blue);
  font-size: 1rem;
  margin-bottom: 4px;
}

.notification-pill {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1.1rem;
  margin-bottom: 2px;
}

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

.notification-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.notification-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.notification-play-sound {
  background: var(--accent-blue);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  margin-top: 8px;
  transition: all 0.2s ease;
  animation: pulse 2s infinite;
}

.notification-play-sound:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

@keyframes slideInNotification {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Mobile notification adjustments */
@media (max-width: 768px) {
  .dose-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    min-width: auto;
  }
  
  .notification-content {
    padding: 12px;
    gap: 10px;
  }
  
  .notification-icon {
    font-size: 1.5rem;
  }
  
  .notification-title {
    font-size: 0.9rem;
  }
  
  .notification-pill {
    font-size: 1rem;
  }
  
  .notification-time {
    font-size: 0.8rem;
  }
}

/* Hide task-specific controls on pills page */
body.pills-active .header-stats,
body.pills-active #headerStatsContainer,
body.pills-active .filter-toggle-btn,
body.pills-active #filterToggleBtn,
body.pills-active #taskViewToggle,
body.pills-active #filtersContainer,
body.pills-active .add-task-btn {
  display: none;
}

/* Mobile optimizations for Pills */
@media (max-width: 768px) {
  .dose-info {
    padding-right: 140px; /* Space for both buttons on mobile */
  }

  .dose-actions {
    top: 8px;
    right: 8px;
  }

  .dose-taken-btn,
  .dose-skipped-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
    min-height: 32px;
  }

  .pill-name {
    padding-right: 100px; /* Smaller space for mobile buttons */
  }

  .pill-actions {
    top: 0;
    right: 0;
  }

  .pill-edit-btn,
  .pill-delete-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  .pill-times {
    justify-content: center;
  }

  .pill-management {
    flex-direction: column;
  }

  .pill-management .btn {
    max-width: none;
  }
}