/* กำหนดรูปแบบเฉพาะภายในแอป Calendar */
.calendar-app {
  width: calc(100% + 34px);
  min-height: 100%;
  margin: -20px -17px;
  padding: 14px 18px 30px;
  color: #1c1c1e;
  background: #f2f2f7;
}

/* วางปุ่ม Today ชื่อเดือน และปุ่มเพิ่มในแถวเดียวกัน */
.calendar-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 38px;
}

/* ปุ่ม Today สไตล์ลิงก์น้ำเงินแบบ iOS */
.calendar-today {
  justify-self: start;
  padding: 0;
  border: 0;
  color: #007aff;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
}

/* ชื่อเดือนและปีบนแถบปฏิทิน */
.calendar-month-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.2px;
}

/* ปุ่มเพิ่มจำลองตามหน้าตาแอป Calendar */
.calendar-add {
  justify-self: end;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1.5px solid #007aff;
  border-radius: 50%;
  color: #007aff;
  font-size: 23px;
  font-weight: 300;
  line-height: 1;
}

/* จัดปุ่มเลื่อนเดือนให้อยู่ชิดขวา */
.calendar-month-controls {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  height: 29px;
}

/* รูปแบบปุ่มลูกศรเลื่อนเดือน */
.calendar-month-controls button {
  width: 26px;
  padding: 0;
  border: 0;
  color: #007aff;
  background: transparent;
  font-size: 29px;
  line-height: 23px;
}

/* แสดงชื่อวันและวันในรูปแบบตารางเจ็ดคอลัมน์ */
.calendar-month-grid {
  width: 100%;
}

/* จัดชื่อย่อวันเหนือช่องวันที่ */
.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
}

/* ชื่อวันแบบย่อสไตล์ iOS */
.calendar-weekdays {
  align-items: center;
  height: 29px;
  color: #8e8e93;
  font-size: 11px;
  font-weight: 600;
}

/* ช่องวันที่ในแต่ละสัปดาห์ */
.calendar-days {
  grid-auto-rows: 43px;
}

/* ปุ่มวันที่เป็นวงกลมสัมผัสง่าย */
.calendar-day {
  position: relative;
  justify-self: center;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #1c1c1e;
  background: transparent;
  font-size: 15px;
  font-weight: 400;
}

/* ทำวันนอกเดือนให้จางลง */
.calendar-day.outside-month {
  color: #c7c7cc;
}

/* วงกลมสีน้ำเงินเน้นวันที่เลือก */
.calendar-day.selected {
  color: #fff;
  background: #007aff;
  font-weight: 600;
}

/* เน้นวันนี้ด้วยตัวอักษรน้ำเงินเมื่อไม่ได้เลือก */
.calendar-day.today:not(.selected) {
  color: #007aff;
  font-weight: 700;
}

/* จุดสีเล็กแสดงว่ามีกิจกรรมในวันนั้น */
.calendar-event-dot {
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 4px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #ff0000;
}

/* จุดแสดงกิจกรรมเป็นสีขาวเมื่อวันถูกเลือก */
.calendar-day.selected .calendar-event-dot {
  background: #fff;
}

/* เส้นคั่นส่วนปฏิทินกับรายการกิจกรรม */
.calendar-divider {
  height: 1px;
  margin: 5px -18px 0;
  background: #d1d1d6;
}

/* ส่วนรายการกิจกรรมของวันที่เลือก */
.calendar-agenda {
  padding-top: 16px;
}

/* หัวข้อวันเต็ม */
.calendar-selected-date {
  margin: 0 0 12px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.4px;
}

/* กล่องกิจกรรมแต่ละรายการ */
.calendar-event {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 11px;
  border-radius: 11px;
  background: #fff;
}

/* เส้นสีประจำปฏิทินของกิจกรรม */
.calendar-event-color {
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  background: var(--event-color);
}

/* ชื่อกิจกรรมและชื่อปฏิทิน */
.calendar-event-details {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

/* ตัวอักษรชื่อกิจกรรม */
.calendar-event-details strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ชื่อปฏิทินใต้ชื่อกิจกรรม */
.calendar-event-details span,
.calendar-event time {
  color: #8e8e93;
  font-size: 11px;
}

/* เวลาเริ่มกิจกรรม */
.calendar-event time {
  white-space: nowrap;
}

/* ข้อความเมื่อวันที่เลือกไม่มีนัดหมาย */
.calendar-no-events {
  margin: 0;
  padding: 14px 0;
  color: #8e8e93;
  font-size: 14px;
}
