/* General Styles */
* {
  box-sizing: border-box; /* Ensures padding and borders are included in element width */
}

body {
  font-family: "Arial", sans-serif;
  background-color: #f0f4f8;
  color: #333;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scrolling on mobile */
}

header {
  background-color: #1e3a8a; /* Blue color */
  color: white;
  padding: 1.5rem;
  text-align: center;
  font-size: 1.8rem;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

footer {
  background-color: #1e3a8a; /* Blue color */
  color: white;
  text-align: center;
  padding: 1rem;
  width: 100%;
  margin-top: auto;
  font-size: 0.9rem;
}

main {
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  overflow-x: hidden; /* Prevent content from causing horizontal scrolling */
}

/* Introduction Section */
#introduction {
  background-color: #e7effc;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  border-left: 5px solid #1e3a8a;
}

/* Calendar Styles */
#calendar {
  text-align: center;
  margin-bottom: 2rem;
  overflow-x: hidden; /* Prevent overflow on small screens */
}

#calendar-navigation {
  margin: 1rem 0;
}

#calendar-days,
#calendar-dates {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px; /* Consistent gap between all items */
  text-align: center;
  max-width: 100%;
  overflow-x: hidden; /* Prevent any overflow issues */
  padding: 0;
  margin: 0 auto;
}

.day-name {
  padding: 8px 0;
  font-weight: bold;
  background-color: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.9rem; /* Adjust font size to fit the screen */
  text-overflow: ellipsis; /* Add ellipsis if text is too long */
}

.day {
  padding: 15px 0;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s, transform 0.2s;
}

.day.unavailable {
  background-color: #e0e0e0;
  color: #999;
  cursor: not-allowed;
}

.day:hover {
  transform: scale(1.05);
}

.day.selected {
  background-color: #1e3a8a;
  color: white;
  border: 2px solid #142857;
}

/* Status-Specific Styling */
.available {
  background-color: #8fbc8f; /* Green for available */
  color: #fff;
}

.blocked,
.booked {
  background-color: #f08080; /* Red for blocked or booked */
  color: #fff;
}

.pending {
  background-color: #ffd700; /* Yellow for pending confirmation */
  color: #fff;
}

/* Booking Form Styles */
#booking-form {
  border: 1px solid #ddd;
  padding: 1.5rem;
  background-color: white;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

form label {
  font-weight: bold;
}

form input,
form textarea {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

form button {
  background-color: #1e3a8a;
  color: white;
  border: none;
  padding: 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  font-weight: bold;
}

form button:hover {
  background-color: #142857; /* Darker blue for hover */
}

/* Contact Section */
#contact a {
  color: #1e3a8a;
  text-decoration: none;
  font-weight: bold;
}

#contact a:hover {
  text-decoration: underline;
}

/* Responsive Styles */
@media (max-width: 768px) {
  header {
    font-size: 1.4rem; /* Smaller header text on mobile */
  }

  footer {
    font-size: 0.8rem;
    text-align: center;
  }

  #calendar-days,
  #calendar-dates {
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding: 0 5px; /* Adjust padding to prevent overflow */
    max-width: 100%;
  }

  .day,
  .day-name {
    padding: 0.5rem;
    font-size: 0.75rem; /* Smaller font to fit better */
  }

  .day-name {
    text-overflow: ellipsis; /* Ellipsis for long day names */
    font-size: 0.7rem; /* Smaller font size to ensure proper fit */
  }

  main {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  header {
    font-size: 1.2rem; /* Further reduce header text on very small devices */
  }

  #calendar-days,
  #calendar-dates {
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    max-width: 100%; /* Ensure the calendar fits within the screen */
    padding: 0 2px; /* Reduce padding for smaller screens */
  }

  .day,
  .day-name {
    padding: 0.2rem;
    font-size: 0.65rem; /* Further reduce to fit smaller screens */
    text-overflow: ellipsis; /* Ensure text fits without overflow */
  }

  main {
    padding: 0.5rem;
  }

  footer {
    text-align: center;
    font-size: 0.7rem;
    padding: 0.75rem;
  }
}
/* Styling for "disponible de jour seulement" */
.day.disponible_jour {
  background-color: #8fbc8f; /* Light green background to match available */
  color: white;
}

/* Styling for "disponible de 9-15 seulement" */
.day.disponible_9_15 {
  background-color: #8fbc8f; /* Light green background to match available */
  color: white;
}

/* For the admin panel specifically */
.admin .day.disponible_jour {
  background-color: #add8e6; /* Light blue for admin view */
  color: black; /* Black text for admin clarity */
}

/* For the admin panel specifically */
.admin .day.disponible_9_15 {
  background-color: #add8e6; /* Light blue for admin view */
  color: black; /* Black text for admin clarity */
}

/* General style tweaks for admin panel */
.admin #date-details {
  border: 1px solid #ddd;
  padding: 1.5rem;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  margin-top: 2rem;
}

.admin #update-date-form button {
  background-color: #1e3a8a;
  color: white;
  border: none;
  padding: 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  font-weight: bold;
}

.admin #update-date-form button:hover {
  background-color: #142857;
}

/* Admin-specific styling */
.admin #calendar-dates .day.disponible_jour {
  background-color: #add8e6; /* Light blue for admin view */
  color: black; /* Black text for admin clarity */
}

/* Admin-specific styling */
.admin #calendar-dates .day.disponible_9_15 {
  background-color: #a9c027; /* Light blue for admin view */
  color: black; /* Black text for admin clarity */
}
