/* SGCA Calendar - Reverted Version with Adjusted Mobile Width */

/* === Base container styles === */
.sgca-calendar-widget {
  font-family: 'Nunito', sans-serif;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 10px;
}

/* === Calendar title === */
.sgca-calendar-title {
  text-align: center;
  font-family: 'Nunito', sans-serif;
  font-size: 26px;
  font-weight: 500;
  color: #536878;
  margin-bottom: 1em;
}

/* === Toolbar (Desktop) === */
.sgca-calendar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px auto;
}

.sgca-calendar-toolbar button {
  background-color: #63bc45;
  color: white;
  border: none;
  padding: 0.5em 1em;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  text-decoration: underline;
}

.sgca-calendar-toolbar button:hover {
  background-color: #536878;
}

/* === Legend === */
.sgca-calendar-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}

.legend-item {
  display: inline-block !important;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 3px;
  border: 1px solid #ddd;
}

.legend-item.indoor {
  background-color: rgba(83, 104, 120, 0.35) !important;
}
.legend-item.outdoor {
  background-color: rgba(99, 188, 69, 0.35) !important;
}
.legend-item.both {
  background: linear-gradient(to right, rgba(83,104,120,0.35) 50%, rgba(99,188,69,0.35) 50%) !important;
}

/* === Calendar Grid (Desktop) === */
.sgca-calendar-grid-wrapper {
  overflow-x: hidden;
}

.sgca-calendar-grid {
  border-collapse: collapse;
  width: 100%;
  margin-top: 10px;
  table-layout: fixed;
}

.sgca-calendar-grid th {
  background-color: #6ebc45;
  color: #fff !important;
  font-weight: bold;
  text-align: center;
  font-size: 16px;
  height: 30px;
  border: 1px solid #ccc;
}

.sgca-calendar-grid td {
  border: 1px solid #ccc;
  vertical-align: top;
  padding: 0 !important;
  height: 120px;
  box-sizing: border-box;
}

.calendar-day-number {
  background-color: #536878;
  color: white;
  font-size: 14px;
  padding: 2px 6px;
  text-align: right;
  display: block;
}

.calendar-events {
  padding: 4px;
}

.sgca-calendar-grid .event-block {
  padding: 2px 5px;
  font-size: 0.85em;
  margin-top: 4px;
  border-radius: 3px;
  color: #536878;
  line-height: 1.3;
  word-break: break-word;
}

.sgca-calendar-grid .event-block.indoor {
  background-color: rgba(83, 104, 120, 0.35) !important;
}
.sgca-calendar-grid .event-block.outdoor {
  background-color: rgba(99, 188, 69, 0.35) !important;
}
.sgca-calendar-grid .event-block.both {
  background: linear-gradient(to right, rgba(83,104,120,0.35) 50%, rgba(99,188,69,0.35) 50%) !important;
}
.sgca-calendar-grid .event-block.type-missing {
  border: 1px dashed red;
}

.mobile-day-header, .sgca-calendar-scroll-hint {
  display: none;
}

/* Watermark */
.sgca-calendar-watermark {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  text-align: right;
  font-size: 12px;
  color: #536878;
}

.sgca-calendar-watermark img {
  height: 24px;
  width: auto;
}

/* === Mobile Styles (max-width: 1024px) === */
@media screen and (max-width: 1024px) {
  .sgca-calendar-toolbar {
    flex-wrap: wrap;
    gap: 15px;
  }
  .sgca-calendar-legend {
    order: 1;
    width: 100%;
    justify-content: center;
  }
  .sgca-calendar-prev {
    order: 2;
  }
  .sgca-calendar-next {
    order: 3;
  }

  .sgca-calendar-scroll-hint {
    display: block;
    text-align: center;
    margin: 15px 0;
  }

  .sgca-calendar-grid thead,
  .calendar-day-number {
    display: none;
  }

  .sgca-calendar-grid-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sgca-calendar-grid {
    width: auto;
    table-layout: auto;
  }

  .sgca-calendar-grid td {
    width: 30vw; 
    min-width: 160px;
  }

  .mobile-day-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background-color: #6ebc45;
    color: white;
    padding: 6px 8px;
    font-weight: bold;
  }
  .mobile-day-name {
    font-size: 16px;
    margin-right: 8px;
  }
  .mobile-day-number {
    font-size: 16px;
  }
  /* Reduce title font size on small screens */
@media screen and (max-width: 768px) {
  .sgca-calendar-title {
    font-size: 22px !important; /* Reduced from 26px */
  }
}

}