/* General body and typography */
html, body {
  /* Ensures the browser can grow to 100% height */
  margin: 0; 
  padding: 0;
  height: 100%;
}

/* We removed margin: 20px; from body
   so the calendar can fully expand to the viewport.
   If you want some spacing, you can add it around
   specific elements rather than the entire body. */
body {
  font-family: Arial, sans-serif;
  box-sizing: border-box;
  /* If you absolutely need a margin, consider a smaller one: 
     margin: 10px; 
     or handle spacing individually. */
}

/* Page Titles */
h1, h2 {
  text-align: center;
  margin: 20px 0;
}

/* Forms */
label {
  display: block;
  margin-top: 10px;
}

input, select, textarea {
  width: 100%;
  max-width: 300px;
  margin-bottom: 10px;
  padding: 5px;
}

button {
  padding: 6px 12px;
  margin-top: 10px;
  cursor: pointer;
}
table tr:nth-child(even) {
  background-color: #f2f2f2;
}

/* Admin Page Layout */
#calendarAdmin {
  margin-bottom: 20px;
}

/* Make sure the admin calendar can also expand if you configure it to do so */
#calendarAdmin,
#calendar {
  /* If you want each calendar to fill available space, you can try: 
     height: 100%;
     Or leave them as auto and let FullCalendar handle it. */
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  /* margin-bottom: 20px; (optional spacing below the calendar) */
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  max-width: 900px; /* Adjust as needed */
}

table th, table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
}

/* Hide containers by default if needed */
#loginContainer,
#adminPanel {
  margin-top: 20px;
}

/* Modal (for the public booking form) */
.modal {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  width: 90%;
  max-width: 400px;
  border-radius: 4px;
  position: relative;
}

.close {
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: red;
}

/* FullCalendar event overrides:
   we can color-code based on booking status by using className
   (reserved, booked, cancelled, etc.) */
.fc-event.reserverad {
  background-color: orange !important;
  color: #000 !important;
}

.fc-event.bokad {
  background-color: red 
  color: #fff 
}

.fc-event.avbokad {
  background-color: #888 !important; /* or gray to signify cancellation */
  color: #fff !important;
}

/* If using background events for multi-date selection on the public side: */
.fc-event[data-display="background"] {
  background-color: #51c0ff !important;
  opacity: 0.5;
  border: 0;
}
/* Container for the booking list (the table below the calendar).
   If you want the entire text & table to align with the calendar,
   give it the same max-width and center it. */
#publicBookingsList {
  width: 100%;
  max-width: 600px;
  margin: 20px auto;  /* 20px top/bottom, auto left/right */
  text-align: center; /* or left if you prefer left-aligned text, 
                         but many people like center in this scenario */
}

/* If you only want the heading centered but table cells left-aligned, 
   you can remove text-align: center in #publicBookingsList 
   and do this instead: */
#publicBookingsList h2 {
  text-align: center;
}

/* Make table content neatly centered in the container.
   You can also do text-align: left for the table content if you like. */
#publicBookingsList table {
  margin: 0 auto; /* centers the table itself */
  border-collapse: collapse; /* if not already set */
  width: 100%; /* expand to container width if you want, or remove this line */
}

/* Table cell styling (optional) */
#publicBookingsList th,
#publicBookingsList td {
  padding: 8px;
  border: 1px solid #ccc;
}
/* Center the container's contents */
#buttonContainer {
  text-align: center;
  margin: 10px auto;  /* optional vertical spacing */
}

/* Style the button itself */
#openBookingForm {
  /* 
    The script sets display = 'inline-block' or 'none', so 
    we won't override display here. 
  */
  font-size: 1.2em;   /* bigger text */
  padding: 10px 20px; /* bigger clickable area */
  cursor: pointer;    /* show a pointer on hover */
  margin: 10px;       /* some space around the button */
}
#selectedDays {
  text-align: center;
  margin: 10px 0;
  font-weight: bold;
  /* Additional styling as desired */
}
/* Light green "Bekräfta" button */
button.confirm-btn {
  background-color: #d4f5d4; /* Light green */
  border: 1px solid #a8d5a8;
  color: #2e7d32; /* Dark green text */
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
}

button.confirm-btn:hover {
  background-color: #bdecb6; /* Slightly darker green on hover */
}

/* Light red "Avboka" button */
button.cancel-btn {
  background-color: #f5d4d4; /* Light red */
  border: 1px solid #d5a8a8;
  color: #d32f2f; /* Dark red text */
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
}

button.cancel-btn:hover {
  background-color: #ecb6b6; /* Slightly darker red on hover */
}
/* Style weekend day cells with light background and black text */
.fc-day-sat, .fc-day-sun {
  background-color: #f0f0f0 !important;
  color: black !important;
}

/* Ensure day numbers on weekends are black */
.fc-day-sat .fc-daygrid-day-number,
.fc-day-sun .fc-daygrid-day-number {
  color: black !important;
}
#bookingsTable {
  margin: 0 auto;
}
#loginContainer, #adminPanel {
  display: none;
}

/* Enhanced modal styling for edit booking form */
#editBookingFormContainer.modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  overflow-y: auto; /* Allow scrolling for long forms */
}

#editBookingFormContainer .modal-content {
  background-color: #fff;
  margin: 5% auto; /* Reduced from 10% to show more of the form */
  padding: 25px;
  width: 90%;
  max-width: 500px; /* Slightly wider for the edit form */
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Style form elements within the edit modal */
#editBookingForm input,
#editBookingForm select,
#editBookingForm textarea {
  width: 100%;
  max-width: 100%; /* Override the general 300px max-width */
  margin-bottom: 15px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

#editBookingForm label {
  display: block;
  margin-top: 15px;
  margin-bottom: 5px;
  font-weight: bold;
}

#editBookingForm button[type="submit"] {
  width: 100%;
  padding: 10px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 20px;
}

#editBookingForm button[type="submit"]:hover {
  background-color: #45a049;
}
