* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  padding: 0 0.5em;
  overflow-x: hidden;
}

section {
    padding: 1em;
}

label {
    display:block;
    padding-top:1em;
}

input {
    width: 100%;
    margin-right:12px;
    box-sizing: border-box;
    max-width: 800px;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
}

fieldset.datetime-group input {
    width: 100%;
    max-width: 400px;
}

td.day_num {
  width: 100px;
  text-align: center;
  border: 1px solid grey;
  background-color: lightgrey;
}
td.day {
  width: 100px;
  height: 50px;
  border: 1px solid black;
  padding: 4px 6px;
}
td.unused_day {
  width: 100px;
  height: 50px;
}
td.unused_day_num {
  width: 100px;
}
.cal-table-wrap {
  overflow-x: auto;
  margin-top: 20px;
}
table.cal_table {
  margin-top: 0;
  border-spacing: 0;
  border-collapse: collapse;
  border: 1px black solid;
  background-color: #f0f0f0;
}
table.cal_table tr td {
  padding-top: 5px;
}
table.cal_table td.day.today {
  background-color: lightyellow;
}
table.cal_table td.day {
  background-color: white;
}
table.cal_table td.day_num.today {
  background-color: yellow;
}

table.cal_table th.month_title {
    background-color: #57b;
    color: white;
}
.admin_tool {
  display: inline-block;
  padding: 4px 10px;
  margin-left: 4px;
  background-color: #57b;
  color: #fff;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85rem;
  cursor: pointer;
}
.admin_tool:hover {
  background-color: #46a;
}

nav.top-bar {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0.5em 0;
}

details.dropdown {
  position: relative;
  display: inline-block;
}

details.dropdown summary.admin_tool {
  list-style: none;
}

details.dropdown summary.admin_tool::-webkit-details-marker {
  display: none;
}

details.dropdown summary.admin_tool::after {
  content: " \25BE";
}

details.dropdown[open] summary.admin_tool {
  background-color: #46a;
}

details.dropdown .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  z-index: 10;
  min-width: 140px;
  overflow: hidden;
}

details.dropdown .dropdown-menu a {
  display: block;
  padding: 6px 12px;
  color: #333;
  text-decoration: none;
  font-size: 0.85rem;
  white-space: nowrap;
}

details.dropdown .dropdown-menu a:hover {
  background-color: #dde;
}

.table-wrap {
  overflow-x: auto;
}

table.item-table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

table.item-table th,
table.item-table td {
  padding: 6px 16px;
  text-align: left;
}

table.item-table thead tr {
  border-bottom: 2px solid #888;
}

table.item-table th {
  background-color: #dde;
}

table.item-table tbody tr {
  border-bottom: 1px solid #ccc;
}

table.item-table tbody tr:nth-child(odd) {
  background-color: #f5f5f5;
}

table.item-table tbody tr:nth-child(even) {
  background-color: #e8eaf0;
}

table.item-table tbody tr:hover {
  background-color: #d8dff0;
}

.repeat-days label {
  display: inline-block;
  margin-right: 1em;
}

.radio-group {
  margin-top: 0.4rem;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.3rem;
  cursor: pointer;
}

p.warning {
  color: #c55;
  font-weight: bold;
}

p[class^="event-type-"] {
  border-radius: 8px;
  padding: 4px 8px;
  margin: 3px 0;
}

p.event-type-shop                 { background-color: #cce8ff; }
p.event-type-outreach             { background-color: #d4edda; }
p.event-type-competition          { background-color: #f8d7da; }
p.event-type-offseasonCompetition { background-color: #fde8c8; }
p.event-type-recreation           { background-color: #e8d5f5; }

span.attending_check {
    color: green;
}

span.declined_mark {
    color: #c55;
}

span.low_count {
    padding: 4px;
    background-color: #c55;
    color: white;
    border-radius: 4px;
}

.hidden_data {
    display: none;
}

.hidden_data.revealed {
    display: block;
    animation: past-reveal 0.4s ease-out both;
}

@keyframes past-reveal {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#show-past {
    display: inline-block;
    padding: 6px 14px;
    background-color: #888;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 0.75rem;
}

#show-past:hover {
    background-color: #555;
}

#event-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

#event-modal-overlay.open {
  display: flex;
}

#event-modal {
  background: #fff;
  border-radius: 6px;
  padding: 1.5rem;
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 4px 24px rgba(0,0,0,.3);
}

.em-close {
  position: absolute;
  top: .5rem;
  right: .75rem;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
}

.em-title { margin: 0 2rem .5rem 0; font-size: 1.2rem; }
.em-meta { margin: .2rem 0; font-size: .9rem; }

.em-attendees { margin-top: .75rem; }
.em-attendees h4 { margin: 0 0 .25rem; }
.em-attendees ul { margin: 0; padding-left: 1.25rem; font-size: .9rem; }

.em-declined { margin-top: .75rem; }
.em-declined h4 { margin: 0 0 .25rem; color: #c55; }
.em-declined ul { margin: 0; padding-left: 1.25rem; font-size: .9rem; }

.em-declined-note { display: block; margin-bottom: .4rem; width: 100%; }

.em-actions {
  margin-top: 1rem;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.em-actions a, a.em-button, span.em-button {
  padding: .4rem .9rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: .9rem;
  display: inline-block;
}

.em-rsvp        { background: #3a7; color: #fff; }
.em-cancel-rsvp { background: #c55; color: #fff; }
.em-decline     { background: #c80; color: #fff; }
.em-attend      { background: #3a7; color: #fff; }
.em-withdraw    { background: #888; color: #fff; }
.em-edit        { background: #57b; color: #fff; }
.em-delete      { background: #c55; color: #fff; }
.em-disabled    { background: #555; color: #fff; }

.event-btn {
  background: #7ec89a;
  border: 1px solid #3a7;
  color: #fff;
  cursor: pointer;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  padding: 0;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
}
.event-btn:hover { background: #4a9; }

.event-btn .info-icon {
  width: 88%;
  height: 88%;
}

#today-checkin {
    background-color: #f0f8f0;
    border: 1px solid #3a7;
    border-radius: 6px;
    padding: 0.75em 1em;
    margin-bottom: 1em;
}

#today-checkin h2 {
    margin: 0 0 0.5em;
    font-size: 1.1rem;
    color: #2a6;
}

.today-event {
    margin: 0.3em 0;
}

.em-checkin     { background: #3a7; color: #fff; }
.em-checked-in  { background: #888; color: #fff; cursor: default; }

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

  section {
    padding: 1em 0;
  }

  fieldset.datetime-group {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    border: none;
    padding: 0;
    margin: 0;
  }

  fieldset.datetime-group input {
    max-width: 100%;
  }

  td.day_num,
  td.day,
  td.unused_day,
  td.unused_day_num {
    width: 70px;
  }

  td.day {
    height: 40px;
    padding: 3px 4px;
    font-size: 0.85rem;
  }

  p[class^="event-type-"] {
    font-size: 0.85rem;
  }

  .event-btn {
    width: 1.3rem;
    height: 1.3rem;
  }

  table.item-table th,
  table.item-table td {
    padding: 6px 8px;
    font-size: 0.85rem;
  }

  #event-modal {
    padding: 1rem;
    width: 94%;
  }

  .em-actions a, a.em-button, span.em-button {
    padding: .5rem .8rem;
    font-size: .85rem;
  }
}
