/* Medication Calendar Styles */

.medications-view {
  padding: 20px;
}

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

.medications-header h2 {
  margin: 0;
  font-size: 24px;
  color: #333;
}

.medications-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.medication-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.2s;
}

.medication-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.medication-card.inactive {
  opacity: 0.6;
  background: #f9f9f9;
}

.med-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 10px;
}

.med-header h3 {
  margin: 0;
  font-size: 18px;
  color: #2c3e50;
}

.dosage {
  background: #e8f4f8;
  color: #0066cc;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
}

.med-details {
  margin-bottom: 15px;
}

.med-details p {
  margin: 8px 0;
  font-size: 14px;
  color: #555;
}

.med-refill {
  background: #fff9e6;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  border-left: 3px solid #ffa500;
}

.med-refill p {
  margin: 0;
  font-size: 13px;
}

.med-actions {
  display: flex;
  gap: 10px;
}

.btn-small {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-small:hover {
  background: #f0f0f0;
  border-color: #999;
}

.btn-small.btn-danger:hover {
  background: #ffebee;
  border-color: #d32f2f;
  color: #d32f2f;
}

/* Week View */

.medications-week {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid #e0e0e0;
}

.medications-week h3 {
  margin-bottom: 20px;
  color: #333;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.week-day {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  background: #f9f9f9;
}

.day-label {
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 12px;
  font-size: 14px;
}

.scheduled-med {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  padding: 6px;
  background: white;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

.med-time {
  font-weight: bold;
  color: #0066cc;
  min-width: 45px;
}

.med-name {
  flex: 1;
  color: #555;
}

.med-checkbox {
  cursor: pointer;
}

/* Modal */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.modal-content h3 {
  margin-top: 0;
  color: #333;
}

.close {
  float: right;
  font-size: 24px;
  font-weight: bold;
  color: #999;
  cursor: pointer;
}

.close:hover {
  color: #333;
}

.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-content input,
.modal-content select {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.modal-content button {
  padding: 12px;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  font-weight: bold;
}

.modal-content button:hover {
  background: #0052a3;
}

/* Buttons */

.btn-primary {
  padding: 10px 20px;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
}

.btn-primary:hover {
  background: #0052a3;
}

/* Calendar View */

.medications-calendar {
  margin-top: 2rem;
  padding: 1rem;
  background: #f5f5f5;
  border-radius: 8px;
}

.month-block {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.month-block h4 {
  margin-top: 0;
  text-align: center;
  font-size: 1.1rem;
  color: #333;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-top: 1rem;
}

.calendar-day-header {
  text-align: center;
  font-weight: bold;
  font-size: 0.85rem;
  color: #666;
  padding: 0.5rem 0;
  border-bottom: 2px solid #ddd;
}

.calendar-day {
  aspect-ratio: 1;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 60px;
}

.calendar-day.empty {
  background: transparent;
  border: none;
}

.calendar-day.today {
  background: #e8f5e9;
  border-color: #4caf50;
  border-width: 2px;
}

.day-number {
  font-weight: bold;
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 0.2rem;
}

.day-meds {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  flex: 1;
}

.med-dose {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: bold;
  color: white;
  cursor: pointer;
  transition: transform 0.2s;
}

.med-dose:nth-child(1) { background: #2196F3; }
.med-dose:nth-child(2) { background: #FF9800; }
.med-dose:nth-child(3) { background: #9C27B0; }
.med-dose:nth-child(4) { background: #F44336; }

.med-dose:hover {
  opacity: 0.8;
  transform: scale(1.2);
}
