body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f4f6f8;
  color: #162013;
}

h1 {
  margin: 18px auto 10px;
  text-align: center;
  font-size: 2rem;
}

.view-section,
.controls-section,
footer {
  margin-inline: auto;
}

.view-section {
  margin-top: 12px;
}

.view-tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  margin-bottom: -1px;
  padding-left: 8px;
  border-bottom: 1px solid #cbd5e1;
}

.view-tab {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 11px 18px;
  border: 1px solid #cbd5e1;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.95rem;
}

.view-tab.active {
  background: white;
  color: #14532d;
  position: relative;
  z-index: 1;
  padding-top: 13px;
}

.view-panel[hidden] {
  display: none;
}

.calendar-section {
  margin-top: 0;
}

.calendar-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 8px 12px 12px;
}

.calendar-actions h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.calendar-actions p {
  margin: 0;
  color: #475569;
  font-size: 0.95rem;
}

.calendar-actions button {
  width: auto;
  flex: 0 0 auto;
  margin-bottom: 0;
}

#calendar {
  background: white;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.10);
  min-height: 650px;
}

#calendar .fc-toolbar-chunk {
  display: flex;
  align-items: center;
  gap: 10px;
}

.map-section {
  margin-top: 0;
  background: white;
  padding: 14px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.map-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

#courseMapCount {
  color: #475569;
  font-size: 0.95rem;
  white-space: nowrap;
}

.map-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.map-date-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-date-controls label {
  color: #475569;
  font-size: 0.9rem;
  font-weight: bold;
}

.map-date-controls input,
.map-date-controls button {
  width: auto;
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.95rem;
}

.map-date-controls input {
  border: 1px solid #cbd5e1;
}

.date-step-button,
.date-today-button {
  background: #e2e8f0;
  color: #1e293b;
  border: 1px solid #cbd5e1;
}

.date-step-button {
  min-width: 40px;
}

#courseMap {
  width: 100%;
  height: calc(100vh - 185px);
  min-height: 650px;
  border-radius: 8px;
  overflow: hidden;
  background: #dbeafe;
}

.weather-button {
  width: 100%;
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
}

.weather-result {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #dbe4ec;
  line-height: 1.45;
}

.weather-result p {
  margin: 0;
}

.layout-list {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #dbe4ec;
}

.layout-list ul {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.layout-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 3px 0;
}

.layout-list span {
  overflow-wrap: anywhere;
}

.layout-list strong:last-child {
  color: #14532d;
}

.layout-list p {
  margin: 6px 0 0;
  color: #475569;
}

.controls-section {
  display: grid;
  grid-template-columns: minmax(320px, 520px) 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.side-panel,
.info-box {
  background: white;
  padding: 18px;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.10);
}

.side-panel h2,
.info-box h3 {
  margin-top: 0;
}

.info-box {
  border-left: 5px solid #2f855a;
  font-size: 0.95rem;
  white-space: pre-line;
}

.neighbor-toggle {
  margin-bottom: 15px;
}

#freeCoursesList {
  margin-top: 20px;
}

select,
button {
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 16px;
}

button {
  cursor: pointer;
  font-weight: bold;
  border: none;
}

.button-success {
  background: #28a745;
  color: white;
}

.button-primary {
  background: #007bff;
  color: white;
}

.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  background: white;
  margin: 15% auto;
  padding: 20px;
  width: 90%;
  max-width: 400px;
  border-radius: 8px;
}

.close {
  float: right;
  font-size: 24px;
  cursor: pointer;
}

footer {
  margin-top: 36px;
  margin-bottom: 24px;
  padding: 26px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.10);
  text-align: center;
}

.contact-form {
  max-width: 420px;
  margin: 20px auto;
  text-align: left;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
}

.contact-form button {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 12px;
  cursor: pointer;
  font-weight: bold;
}

.contact-form button:hover {
  background-color: #0056b3;
}

.copyright {
  font-size: 0.8em;
  color: #666;
  margin-top: 20px;
}

@media (max-width: 900px) {
  h1 {
    font-size: 1.6rem;
  }

  .controls-section {
    grid-template-columns: 1fr;
  }

  .calendar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-actions button {
    width: 100%;
  }

  #calendar {
    min-height: 560px;
  }

  #courseMap {
    height: 68vh;
    min-height: 520px;
  }
}

@media (max-width: 640px) {
  .view-section,
  .controls-section,
  footer {
    width: min(100% - 16px, 1480px);
  }

  .map-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-tools {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .map-date-controls {
    display: grid;
    grid-template-columns: 40px minmax(0, 180px) 40px;
    justify-content: center;
    width: 100%;
  }

  .map-date-controls label,
  #todayMapDateBtn,
  #refreshMapDateBtn {
    display: none;
  }

  .map-date-controls input {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
  }

  .map-date-controls .date-step-button {
    width: 40px;
    padding-inline: 0;
  }

  #courseMap {
    height: 66vh;
    min-height: 420px;
  }
}
