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

body {
  font-family: "Roboto", Arial, sans-serif;
  background-color: #fafafa;
  color: #202124;
  padding: 16px;
}

/* Updated calendar container styling for Google Calendar appearance */
.calendar-container {
  max-width: 1400px;
  margin: 0 auto;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.calendar-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid #dadce0;
  background-color: #ffffff;
  flex-wrap: wrap;
}

.today-btn {
  padding: 8px 16px;
  border: 1px solid #dadce0;
  background-color: #ffffff;
  border-radius: 24px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #202124;
  transition: background-color 0.2s;
}

.today-btn:hover {
  background-color: #f8f9fa;
}

.nav-controls {
  display: flex;
  gap: 4px;
}

.nav-btn {
  width: 32px;
  height: 32px;
  border: none;
  background-color: transparent;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  color: #202124;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.nav-btn:hover {
  background-color: #f1f3f4;
}

#monthYear {
  font-size: 22px;
  font-weight: 500;
  margin: 0;
  min-width: 200px;
}

.header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background-color: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.icon-btn:hover {
  background-color: #f1f3f4;
}

.material-icons {
  font-size: 24px;
  color: #5f6368;
}

.view-controls {
  display: flex;
  gap: 4px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background-color: #f8f9fa;
  padding: 4px;
}

.view-btn {
  width: 36px;
  height: 36px;
  border: none;
  background-color: transparent;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.view-btn.active {
  background-color: #e8eaed;
}

.view-btn:hover {
  background-color: #e8eaed;
}

.dropdown {
  margin-left: 8px;
}

.dropdown-btn {
  padding: 8px 16px;
  border: 1px solid #dadce0;
  background-color: #ffffff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: #202124;
  transition: background-color 0.2s;
}

.dropdown-btn:hover {
  background-color: #f8f9fa;
}

/* Added view-content for different view modes */
.view-content {
  display: none;
}

.view-content.active {
  display: block;
}

/* Updated calendar grid to start from Monday */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  border-bottom: 1px solid #dadce0;
  background-color: #fafafa;
}

.weekday {
  padding: 12px 0;
  text-align: center;
  font-weight: 500;
  font-size: 12px;
  color: #5f6368;
  background-color: #fafafa;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  min-height: 600px;
}

/* Updated day cell styling for better visual hierarchy */
.calendar-day {
  padding: 12px 8px;
  border-right: 1px solid #dadce0;
  border-bottom: 1px solid #dadce0;
  cursor: pointer;
  transition: background-color 0.2s;
  position: relative;
  min-height: 100px;
  vertical-align: top;
  text-align: right;
  background-color: #ffffff;
}

.calendar-day:hover {
  background-color: #f8f9fa;
}

.calendar-day.today {
  font-weight: 700;
}

.calendar-day.today .day-number {
  background-color: #1a73e8;
  color: #ffffff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

.calendar-day.other-month {
  background-color: #fafafa;
  color: #bdbdbd;
}

.calendar-day.other-month .day-number {
  color: #bdbdbd;
}

.day-number {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 8px;
}

.day-events {
  font-size: 12px;
  color: #202124;
}

.event-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.event-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background-color: #1a73e8;
  cursor: pointer;
  position: relative;
  box-shadow: 0 0 0 2px #e8f0fe;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.event-dot:hover,
.event-dot:focus {
  transform: scale(1.15);
  box-shadow: 0 0 0 2px #c2e0ff;
  outline: none;
}

.event-dot-overflow {
  background-color: #5f6368;
  color: #ffffff;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.event-popover {
  position: absolute;
  min-width: 220px;
  max-width: 260px;
  background-color: #ffffff;
  border: 1px solid #dadce0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  padding: 12px;
  z-index: 10;
  display: none;
}

.event-popover.visible {
  display: block;
}

.popover-event {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.detail-label {
  color: #5f6368;
  font-weight: 500;
}

.detail-value {
  color: #202124;
  font-weight: 500;
}

.popover-divider {
  height: 1px;
  background-color: #dadce0;
  margin: 6px 0;
}

.event-item {
  background-color: #a4edff;
  color: #202124;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.event-item.today-event {
  background-color: #f2a8a8;
}

/* Styles for Week, Day, and Year views */
.week-view {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background-color: #dadce0;
}

.week-grid-header {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  background-color: #dadce0;
  gap: 1px;
}

.week-grid-corner {
  background-color: #fafafa;
}

.week-day-header {
  padding: 12px;
  text-align: center;
  font-weight: 500;
  font-size: 12px;
  border-bottom: 1px solid #dadce0;
  background-color: #fafafa;
}

.week-grid-body {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  gap: 1px;
  background-color: #dadce0;
}

.week-time-column,
.day-time-column {
  background-color: #fafafa;
}

:root {
  --hour-height: 60px;
}

.time-label {
  height: var(--hour-height);
  padding: 12px 8px;
  font-size: 12px;
  text-align: right;
  border-bottom: 1px solid #dadce0;
  color: #5f6368;
}

.week-day-column,
.day-column {
  background-color: #ffffff;
  position: relative;
}

.week-day-grid,
.day-time-grid {
  position: relative;
  min-height: calc(var(--hour-height) * 24);
  background-image: linear-gradient(to bottom, #e8eaed 1px, transparent 1px);
  background-size: 100% var(--hour-height);
  cursor: pointer;
}

.time-event {
  position: absolute;
  background-color: #e8f0ff;
  border-left: 4px solid #1a73e8;
  border-radius: 8px;
  padding: 8px 10px;
  color: #1f1f1f;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  font-size: 12px;
}

.time-event-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.time-event-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.event-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}

.event-chip-patient {
  background-color: #fce8e6;
  color: #c5221f;
}

.event-chip-staff {
  background-color: #e6f4ea;
  color: #137333;
}

.event-chip-service {
  background-color: #e8f0fe;
  color: #1a73e8;
}

.day-view-grid {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1px;
  background-color: #dadce0;
  min-height: 800px;
}

.year-view {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  padding: 24px;
  background-color: #fafafa;
}

.year-month {
  background-color: #ffffff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.year-month-header {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 12px;
  text-align: center;
  color: #202124;
}

.year-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.year-month-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  background-color: #fafafa;
  transition: background-color 0.2s;
}

.year-month-day:hover {
  background-color: #e8eaed;
}

.year-month-day.other-month {
  color: #bdbdbd;
}

.year-month-day.today {
  background-color: #1a73e8;
  color: #ffffff;
  font-weight: 500;
}

/* Added modal styling for event creation form */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid #dadce0;
}

.event-title {
  width: 100%;
  font-size: 20px;
  border: none;
  outline: none;
  padding: 0;
  font-family: "Roboto", Arial, sans-serif;
  color: #202124;
}

.event-title::placeholder {
  color: #bdbdbd;
}

.event-tabs {
  display: flex;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid #dadce0;
}

.tab-btn {
  border: none;
  background-color: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #bdbdbd;
  padding-bottom: 8px;
  border-bottom: 3px solid transparent;
}

.tab-btn.active {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
}

.event-form {
  padding: 24px;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.form-row .material-icons {
  margin-top: 4px;
  flex-shrink: 0;
}

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

.duration-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.duration-chip {
  border: 1px solid #dadce0;
  background-color: #f8f9fa;
  border-radius: 16px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.duration-chip.active {
  background-color: #e8f0fe;
  border-color: #1a73e8;
  color: #1a73e8;
}

.form-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid #dadce0;
  padding: 8px 0;
  font-size: 14px;
  font-family: "Roboto", Arial, sans-serif;
  color: #202124;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-bottom-color: #1a73e8;
}

.form-input::placeholder {
  color: #bdbdbd;
}

.conflict-warning {
  background-color: #fff4e5;
  border: 1px solid #f4b400;
  color: #8a5a00;
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.hidden {
  display: none;
}

.calendar-selector {
  flex: 1;
}

.calendar-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.calendar-dot {
  color: #fbbc04;
  font-size: 20px;
}

.calendar-status {
  font-size: 12px;
  color: #5f6368;
  display: block;
  width: 100%;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid #dadce0;
}

.more-btn {
  background-color: transparent;
  border: none;
  color: #1a73e8;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid #dadce0;
  color: #202124;
  padding: 8px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-secondary:hover {
  background-color: #f8f9fa;
}

.btn-primary {
  background-color: #1a73e8;
  color: #ffffff;
  padding: 8px 24px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: #1765cc;
}

/* Mobile responsive design improvements */
@media (max-width: 1024px) {
  .calendar-header {
    padding: 12px;
    gap: 8px;
  }

  #monthYear {
    min-width: auto;
    font-size: 18px;
  }

  .header-actions {
    display: none;
  }

  .calendar-day {
    padding: 8px 4px;
    min-height: 80px;
  }

  .day-number {
    font-size: 12px;
  }

  .event-item {
    font-size: 11px;
  }

  .calendar-days {
    min-height: 500px;
  }
}

@media (max-width: 768px) {
  .calendar-header {
    padding: 8px;
    gap: 4px;
    justify-content: space-between;
  }

  #monthYear {
    order: 3;
    width: 100%;
    text-align: center;
    font-size: 16px;
    margin: 8px 0;
  }

  .today-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .nav-controls {
    gap: 2px;
  }

  .nav-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  .header-actions {
    display: none;
  }

  .view-controls {
    order: 4;
    width: 100%;
    justify-content: center;
    gap: 2px;
  }

  .dropdown {
    order: 5;
    width: 100%;
    text-align: center;
    margin-left: 0;
    margin-top: 8px;
  }

  .dropdown-btn {
    width: 100%;
    font-size: 13px;
  }

  .calendar-day {
    padding: 6px 2px;
    min-height: 60px;
  }

  .day-number {
    font-size: 11px;
  }

  .event-item {
    font-size: 10px;
    padding: 1px 4px;
  }

  .calendar-days {
    min-height: 400px;
  }

  .week-grid-header {
    grid-template-columns: 50px repeat(7, 1fr);
  }

  .week-grid-body {
    grid-template-columns: 50px repeat(7, 1fr);
  }

  .day-view-grid {
    grid-template-columns: 60px 1fr;
  }

  .time-label {
    padding: 8px 4px;
    font-size: 11px;
  }

  .year-view {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    padding: 12px;
  }

  .year-month {
    padding: 12px;
  }

  .year-month-header {
    font-size: 12px;
  }

  .year-month-day {
    font-size: 9px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 8px;
  }

  .calendar-container {
    border-radius: 4px;
  }

  .calendar-header {
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
  }

  .today-btn,
  .dropdown-btn {
    font-size: 12px;
    padding: 6px 12px;
    width: 100%;
  }

  .view-controls {
    width: 100%;
  }

  .modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .calendar-day {
    min-height: 50px;
    padding: 4px 2px;
  }

  .day-number {
    font-size: 10px;
  }

  .event-item {
    font-size: 9px;
  }

  .calendar-days {
    min-height: 300px;
  }
}
