/* Reset / layout */
body {
  margin: 0;
  font-family: 'sinter', system-ui, sans-serif;
  background: #f5f7fa;
  color: #333;
   padding-top: 60px; 
}

@font-face {
    font-family: 'Sinter';
    src: url('/fonts/Sinter-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

#logout-btn {
  background: #6c757d;
  color: #fff;
}
#logout-btn:hover {
  background: #555;
}

/* Court selector */
#courts {
  display: flex;
  gap: 12px;
  padding: 14px 24px;
}
button {
  padding: 8px 14px;
  border: none;
  border-radius: 4px;
  background: #e0e0e0;
  color: #333;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s ease;
}
#courts button:hover {
  background: #ccc;
}
#courts button.active {
  background: #d71920;
  color: #fff;
}

/* Dashboard */
#dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Week navigation */
#week-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
#week-nav h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Calendar grid */
#calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
  width: 100%;
  min-height: 70vh;
}

.day-header {
  font-weight: 600;
  text-align: center;
  padding: 8px;
  background: #f0f2f5;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: #333;
}

/* Slot card */
.slot-card {
  background: #fff;
  border: 2px solid #d71920;
  color: #333;
  padding: 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

/* Zoom effect on hover */
.slot-card:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

/* Keep the free-specific background */
.slot-card.free:hover {
  background: #fff5f5;
}

.slot-card h4 {
  margin: 0;
  font-size: 0.95rem;
  color: #d71920;
  font-weight: 600;
}
.players {
  font-size: 0.8rem;
  color: #555;
}
.slot-card button {
  background: #d71920;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.2s ease;
}
.slot-card button:hover {
  background: #b9151b;
}

/* Reserved slots */
.slot-card.reserved {
  border-color: #888;
  background: #f6f6f6;
  color: #555;
}
.slot-card.reserved h4 {
  color: #444;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  justify-content: center;
  align-items: center;
}
.modal-content {
  background: #fff;
  padding: 32px;
  border-radius: 10px;
  max-width: 600px;
  width: 100%;
  min-height: 300px;      /* gives taller look */
  max-height: 80vh;       /* prevent overflow */
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);

  display: flex;
  flex-direction: column;  /* stack items */
  gap: 14px;
  animation: slideDown 0.25s ease;
}

.modal-actions {
  margin-top: auto;        /* ⬅️ push buttons to bottom */
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.modal-content h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #d71920;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}
.modal-content label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 8px;
}
.modal-content input,
.modal-content select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
}
.modal-actions button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
#confirm-add-slot {
  background: #d71920;
  color: #fff;
}
#confirm-add-slot:hover {
  background: #b9151b;
}
#cancel-add-slot {
  background: #f0f0f0;
  color: #333;
}
#cancel-add-slot:hover {
  background: #ddd;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ------------------------------
   Topbar
--------------------------------*/
#topbar {
  display: flex;
  align-items: center;
  background: #2f2f2f;
  color: white;
  padding: 10px 30px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  z-index: 100;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}
#topbar .left {
  display: flex;
  align-items: center;
  gap: 12px;
}
#topbar .logo {
  height: 32px;
  width: auto;
}
#topbar .brand {
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}
#topbar .center {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 28px;
}
#topbar .nav-link {
  color: #ddd;
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: color 0.2s;
}


#topbar .right {
  display: flex;
  align-items: center;
  gap: 15px;
}
#logged-user {
  font-size: 0.9rem;
  color: #bbb;
}
.btn {
  padding: 6px 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}
.btn.danger {
  background: #e74c3c;
  color: white;
}
.btn.danger:hover {
  background: #c0392b;
}

/* Hamburger */
#topbar .hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}
#topbar .hamburger span {
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 1px;
}

/* ------------------------------
   Responsiveness
--------------------------------*/

/* Tablet screens */
@media (max-width: 768px) {
  #topbar {
    flex-wrap: wrap;
    padding: 10px 16px;
  }
  #topbar .center {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 16px;
    padding: 12px 0;
    background: #2f2f2f;
  }
  #topbar .center.open {
    display: flex;
  }
  #topbar .hamburger {
    display: flex;
    margin-left: auto;
  }
  #topbar .right {
    display: none;
  }

  /* Calendar → 2 columns */
  #calendar {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* Small phones */
@media (max-width: 480px) {
  #calendar {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .day-column {
    padding: 6px;
  }
  .slot-card {
    font-size: 0.8rem;
    padding: 8px;
  }
  .slot-card h4 {
    font-size: 0.85rem;
  }
  .modal-content {
    max-width: 95%;
    margin: 0 10px;
    padding: 16px;
  }
}
#week-nav h3 {
  flex: 1;
  text-align: center;
}

.day-column {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  position: relative;    /* needed for absolute button */
  padding: 10px;
  padding-bottom: 36px;  /* reserve space at bottom for add button */
}

.add-slot-btn {
  position: absolute;
  bottom: 8px;           /* pinned to bottom */
  left: 0;
  right: 0;
  background: none;
  border: none;
  color: #d71920;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  padding: 4px 0;
  transition: color 0.2s;
  display: none;         /* hidden by default */
}

.day-column:hover .add-slot-btn {
  display: block;        /* reveal on hover */
}

.add-slot-btn:hover {
  color: #b9151b;
}
#logged-user::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 16 16'><path d='M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm4-3a4 4 0 1 1-8 0 4 4 0 0 1 8 0z'/><path d='M14 14s-1-4-6-4-6 4-6 4 1 2 6 2 6-2 6-2z'/></svg>") no-repeat center;
  background-size: contain;
  vertical-align: middle;
}

.nav-link-selected {
  text-decoration: underline;
  text-underline-offset: 4px; /* pushes underline slightly down for readability */
  text-decoration-thickness: 2px; /* make it a bit bolder */
  color: #fff; /* keep the text white like hover */
}

#topbar .nav-link:hover {
    text-decoration: underline;
  text-underline-offset: 4px; /* pushes underline slightly down for readability */
  text-decoration-thickness: 2px; /* make it a bit bolder */
  color: #fff; /* keep the text white like hover */
}
#context-menu {
  position: absolute;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  z-index: 3000;
  min-width: 140px;
  font-size: 0.9rem;
}

.context-item {
  padding: 8px 12px;
  cursor: pointer;
  color: #e74c3c;
  font-weight: 600;
}

.context-item:hover {
  background: #ffeaea;
}

