/* ===========================================================
   Jungpanther Eiszeiten — Responsive Timeline Calendar (v10)
   =========================================================== */

#jungpanther-calendar-wrapper {
  max-width: 1000px;
  margin: 1.5em auto;
  font-family: Arial, sans-serif;
}

/* ===========================================================
   Header / Navigation Bar
   =========================================================== */

.calendar-controls {
  display: flex;
  flex-direction: column;
  gap: 8px 16px;
  background: #003366;
  color: white;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  flex-wrap: wrap;
}

.calendar-row-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  justify-content: space-between;
  width: 100%;
}

.calendar-row-update {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.last-update {
  font-size: 0.75rem;
  color: #cfd8e3;
  font-style: italic;
  line-height: 1.2;
  text-align: right;
  width: 100%;
}

/* Buttons + selectors */

.calendar-controls button {
  background: #fff;
  color: #003366;
  border: none;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-weight: 600;
  transition: background 0.2s ease;
}

.calendar-controls button:hover {
  background: #e6f2ff;
}

.calendar-controls select,
.calendar-controls input {
  background: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.9rem;
  color: #003366;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  min-width: 140px;
}

#calendar-timeline {
  margin-top: 24px;
  transition: opacity 0.3s ease;
}

/* ===========================================================
   Dual-Calendar Layout
   =========================================================== */

.calendar-dual {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: nowrap;
}

.calendar-single {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  overflow: hidden;
  min-width: 0;
}

.calendar-single h3 {
  text-align: center;
  background: #003366;
  color: #fff;
  margin: 0;
  padding: 10px 0;
  font-size: 1rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ===========================================================
   Timeline + Events
   =========================================================== */

.timeline-wrapper {
  position: relative;
  overflow-y: hidden;
  background: #f9fbfd;
  border: 1px solid #f0f2f5;
  border-radius: 8px;
  padding-left: 44px; /* timeline gutter */
}

.timeline {
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  border-right: 1px solid #f0f2f5;
  background: #fefefe;
  font-size: 0;
}

.timeline .hour {
  position: relative;
  border-bottom: 1px solid #f0f2f5;
  height: 50px; /* must match 50px/hour in JS */
  box-sizing: border-box;
}

.timeline .hour span {
  position: absolute;
  right: 4px;
  top: 4px;
  font-size: 0.7rem;
  color: #777;
  line-height: 1;
}

.events {
  position: relative;
  margin-left: 44px;
  height: 100%;
}

.events .event {
  position: absolute;
  left: 6px;
  right: 6px;
  border-radius: 5px;
  padding: 4px 6px;
  font-size: 0.75rem;
  line-height: 1.15;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.events .event .ev-title {
  font-weight: 600;
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.events .event .ev-time {
  font-size: 0.7rem;
  opacity: 0.9;
  margin-top: 2px;
  line-height: 1.1;
}

/* Tiny 15-min blocks have no inner HTML, so strip borders to keep them minimal */
.events .event:empty {
  border: none;
  box-shadow: none;
  padding: 0;
}

.timeline-wrapper.empty {
  height: auto;
  text-align: center;
  background: #f9fbfd;
  border: 1px solid #f0f2f5;
  border-radius: 8px;
  padding: 20px;
  color: #777;
  font-size: 0.9rem;
  font-style: italic;
}

/* ===========================================================
   Team Table View
   =========================================================== */

.hockey-schedule table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1em 0;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.hockey-schedule th {
  background: #003366;
  color: #fff;
  text-transform: uppercase;
  font-weight: 600;
  padding: 10px 6px;
  text-align: center;
  vertical-align: middle;
  letter-spacing: 0.3px;
  font-size: 0.8rem;
}

.hockey-schedule td {
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid #f0f2f5;
  font-size: 0.8rem;
}

.hockey-schedule tr:nth-child(even) {
  background-color: #f9fbfd;
}

.hockey-schedule tr:last-child td {
  border-bottom: none;
}

/* ===========================================================
   Responsive
   =========================================================== */

@media (max-width: 768px) {
  .calendar-controls {
    padding: 10px;
  }

  .calendar-row-main {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .calendar-controls button {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
    flex: 0 0 auto;
    padding: 0;
  }

  #calendar-date,
  #calendar-location,
  #calendar-team {
    flex: 1 1 calc(50% - 8px);
    min-width: 120px;
    font-size: 0.8rem;
    padding: 6px 8px;
  }

  .calendar-row-update {
    justify-content: flex-end;
  }

  .last-update {
    text-align: right;
    font-size: 0.7rem;
    width: 100%;
  }

  .calendar-dual {
    flex-direction: column;
    gap: 16px;
  }

  .calendar-single {
    width: 100%;
  }

  .timeline .hour {
    height: 42px;
  }

  .timeline .hour span {
    font-size: 0.65rem;
  }

  .events .event {
    font-size: 0.7rem;
    padding: 3px 5px;
  }

  .events .event .ev-title {
    font-size: 0.7rem;
  }

  .events .event .ev-time {
    font-size: 0.65rem;
  }

  .hockey-schedule table {
    font-size: 0.8rem;
  }

  .hockey-schedule th {
    font-size: 0.7rem;
    padding: 8px 4px;
  }

  .hockey-schedule td {
    font-size: 0.7rem;
    padding: 6px 4px;
  }
}

.calendar-date-meta {
  font-size: 0.8em;
  color: #666;
  font-weight: 400;
  margin-left: 6px;
}

/* === FIXED TIMELINE ALIGNMENT (Nov 2025) === */
.timeline-wrapper {
  position: relative;
}

.timeline,
.events {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.timeline .hour {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  border-bottom: 1px solid #f0f2f5;
}

.timeline .hour span {
  font-size: 0.7rem;
  line-height: 1;
  padding: 2px 4px 0 0;
}

.events {
  margin-left: 44px;
}

@media (max-width: 768px) {
  .timeline .hour span {
    font-size: 0.6rem;
  }
}
