:root {
  --primary-blue: #3594D1;
  --accent-yellow: #EDA339;
  --light: #f9f9f9;
  --dark-text: #222;
  --header-height: 60px;
}

* {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Roboto', Arial, sans-serif;
  background: var(--light);
  color: var(--dark-text);
  line-height: 1.6;
}

header {
  display: flex;
  align-items: center;
  background-color: var(--primary-blue);
  height: var(--header-height);
  padding: 0 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  gap: 1rem;
}

header .logo {
  height: 60px;
  width: auto;
  object-fit: contain;
  display: block;
  background-color: white;
  padding: 4px;
  border-radius: 6px;
}

nav {
  display: flex;
  justify-content: center;
  flex: 1;
  gap: 2rem;
  flex-wrap: wrap;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.5rem 0;
  position: relative;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--accent-yellow);
}

.hero {
  position: relative;
/*  background: url('./hero.jpg') center/cover no-repeat; */
  height: 480px;
}

.hero .overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
  padding: 1rem;
}

.hero .overlay h1 {
  font-size: 2.5rem;
  margin: 0;
}

.hero .overlay p {
  font-size: 1.2rem;
  margin: 0.5rem 0 0;
}

.yellow-strip {
  background-color: var(--accent-yellow);
  color: var(--primary-blue);
  padding: 2rem 1rem;
  text-align: center;
}

.section {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 1.5rem;
  transition: transform 0.3s ease;
  will-change: transform;
}

.card:hover {
  transform: translateY(-5px);
}

footer {
  background: var(--primary-blue);
  color: white;
  text-align: center;
  padding: 1.5rem 1rem;
  margin-top: 2rem;
  font-size: 0.9rem;
}

ul {
  padding-left: 1.25rem;
}

a {
  color: var(--primary-blue);
}

a:hover {
  color: var(--accent-yellow);
}

/* Forms on Contact Page */
form label {
  font-weight: 600;
}

input[type="text"],
input[type="email"],
textarea {
  font-size: 1rem;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  resize: vertical;
  font-family: inherit;
}

button {
  background-color: var(--primary-blue);
  color: var(--accent-yellow);
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #003f8a;
}

/* Responsive text */
h1, h2, h3 {
  word-wrap: break-word;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* Members Login Form */
.members-login {
  max-width: 320px;
  margin: 2rem auto;
  background: white;
  padding: 2rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.members-login h1 {
  color: var(--primary-blue);
  margin-bottom: 1.5rem;
  font-weight: 700;
  font-size: 1.8rem;
  text-align: center;
}

.members-login label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--dark-text);
}

.members-login input[type="password"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  font-family: inherit;
}

.members-login button {
  width: 100%;
  background-color: var(--primary-blue);
  color: var(--accent-yellow);
  border: none;
  padding: 12px;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.members-login button:hover {
  background-color: #003f8a;
}

.members-login p.error {
  color: #c0392b;
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: center;
}

#ballCanvas {
  position: absolute;
  bottom: 10px; /* near bottom of hero */
  left: 0;
  pointer-events: none;
}

.grid-wrapper {
  overflow-x: auto; /* allow horizontal scroll on small screens */
}

.grid-header, .grid-cell {
  border: 1px solid #ccc;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.grid-header {
  background: #f0f0f0;
  font-weight: bold;
  text-align: center;
}

.rink-name {
  background: #e0e0e0;
  font-weight: bold;
  text-align: left;
  padding-left: 10px;
}

.time-slot {
  font-size: 0.85em;
  color: #666;
  padding-left: 10px;
  text-align: left;
}

.booking {
  background-color: #90ee90;
  font-size: 0.9em;
  cursor: pointer;
  overflow-wrap: break-word;
  word-break: break-word;
  padding: 4px 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex-direction: column;
  white-space: normal;
  transition: background-color 0.3s ease;
  height: 100%;
  width: 100%;             /* fill grid cell horizontally */
  box-sizing: border-box;
}

.booking:hover {
  background-color: #66cc66;
}
.rink-booking-wrapper .nav-buttons a {
  display: inline-block;
  text-decoration: none;
  background: #007acc;
  color: white;
  padding: 8px 12px;
  margin-right: 10px;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.rink-booking-wrapper .nav-buttons a:hover {
  background: #005fa3;
}

.rink-booking-wrapper .grid-container {
  display: grid;
  grid-template-columns: 150px 100px repeat(7, 1fr);
  grid-auto-rows: 50px;
  min-width: 800px;
  border: 1px solid #ccc;
}

.rink-booking-wrapper .grid-header,
.rink-booking-wrapper .grid-cell {
  border: 1px solid #ccc;
  padding: 0px;
  box-sizing: border-box;
  overflow: hidden;
  text-align: center;
}

.booking small {
  display: none;
}

.booking.show-time small {
  display: block;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.6);
}

.modal-content {
  background-color: var(--accent-yellow);
  color: var(--primary-blue);
  margin: 15% auto;
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 400px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  text-align: center;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 24px;
  cursor: pointer;
 -webkit-user-select: none; /* Safari and iOS support */
  user-select: none;
}

/* Combined media queries for max-width 600px */
@media (max-width: 600px) {
  /* Hero overlay smaller heading */
  .hero .overlay h1 {
    font-size: 1.75rem;
  }

  /* Header tweaks */
  header {
    height: auto !important;
    padding: 0.5rem 1rem !important; /* adds space inside the blue bar */
    flex-wrap: wrap;
    align-items: flex-start;
  }

  header .logo {
    height: 50px;
    margin-bottom: 0.5rem;
  }

  /* Navigation */
  nav {
    justify-content: center;
    gap: 1rem;
  }

  nav a {
    padding: 0.4rem 0.6rem;
    font-size: 1rem;
  }

  /* Grid container for rink booking */
  .grid-container {
    grid-auto-rows: 70px; /* taller rows on phones */
    grid-template-columns: 100px 70px repeat(7, minmax(50px, 1fr));
  }

  .rink-booking-wrapper .grid-container {
    grid-template-columns: 100px 80px repeat(7, 120px);
    grid-auto-rows: 65px;
    min-width: 1000px;
  }
}

/* Landscape tweaks */
@media (max-width: 900px) and (orientation: landscape) {
  .rink-booking-wrapper .grid-container {
    grid-template-columns: 150px 100px repeat(7, minmax(110px, 1fr));
    grid-auto-rows: 50px;
  }
}

.booking span {
  display: block;
  text-align: center;
  margin-bottom: 4px; /* optional spacing from time */
}
