:root {
  --red: #ee4522;
  --blue: #31489f;
  --font-dark: #425b76;
  --font-light: #efefef;
  --grey: #425b76;
  --grey-medium: #cccccc;
  --grey-light: #efefef;
  --red-light: rgba(238, 69, 34, 0.1);
  --blue-light: rgba(111, 168, 220, 0.1);

  --event-height: 120px; /* Height of each event */
  --date-border-height: 0px; /* Height of the border between date and event divs */
  --event-padding-vertical: 00px; /* Padding top and bottom for events */
  --event-padding-horizontal: 10px; /* Padding left and right for events */
  --day-margin-bottom: 0px; /* Margin between days */
}

/* GENERAL STYLES */
.calendar {
  
    width: 97%;
    max-width: 1440px;
    margin: 0 auto;
    border: 0px none #ddd;
    border-radius: 5px;
    overflow: visible; /* was hidden */
    position: relative; /* Ensure the calendar itself is a stacking context */
    z-index: 0; /* Lower z-index to make sure children can be on top */
}


/* Container for the filter form */
.event-filters {
  display: flex; /* Align children horizontally */
  flex-wrap: wrap; /* Allow wrapping onto multiple lines */
  justify-content: space-between; /* Evenly spread children */
  align-items: center; /* Vertically center children */
  background-color: var(--grey-light); /* Dark grey background */
  padding: 10px; /* Padding around the container */
  border-radius: 5px; /* Rounded corners */
  gap: 10px; /* Space between dropdowns */
  width: 100%; /* Full width of the parent container */
  box-sizing: border-box; /* Include padding in the width calculation */
}

/* Styles for dropdown fields */
.event-filters select {
  background-color: fff; /* Light background for dropdowns */
  border: 1px solid var(--grey-medium); /* Border color */
  color: var(--font-dark); /* Text color */
  padding: 5px 5px; /* Padding inside dropdowns */
  font-size: 0.8em; /* Font size for dropdown text */
  border-radius: 3px; /* Rounded corners */
  flex: 1; /* Allow dropdowns to grow */
  width: 150px; /* Limit max width for dropdowns */
  box-sizing: border-box; /* Include padding and border in width */
  margin: 5px; /* Margin around each dropdown */
}

/* Dropdown fields on focus */
.event-filters select:focus {
  outline: none; /* Remove default focus outline */
  border-color: var(--blue); /* Highlight border color on focus */
  box-shadow: 0 0 5px var(--blue-light); /* Shadow effect on focus */
}


.week {
  border: 1px solid #ccc;
  margin-bottom: 10px;
 position: relative; /* Ensure stacking context */
  z-index: 10; /* Lower z-index to make sure children can be on top */
    overflow: visible; /* new */
}}

.day {
  border: 1px solid #ddd;
  margin-bottom: 5px;
  transition: background-color 0.3s;
  padding: 0; /* Remove padding to ensure date bars touch */
  position: relative; /* Ensure stacking context */
  z-index: 20; /* Set a lower z-index for the event itself to allow the event-pop-up appear on top of all other elements*/
    overflow: visible; /* was new */
}

.day:hover {
    background-color: var(--grey-light);
}

.date {
  font-weight: bold;
    background-color: var(--blue);
    color: var(--font-light);
    padding: 5px 0; 
    width: 100%;
    text-align: center;
    font-size: 0.8em;
    box-sizing: border-box; /* Ensures the date bar fits within the day div */
  position: relative; /* Ensure stacking context */
  z-index: 30; /* Lower z-index to make sure children can be on top */
  border-right: 1px solid #ddd; /* Add border between date divs */
}  

/* Optional: Remove the border on the last date if you don't want it */
.date:last-child {
  border-right: none;
}

.red-date {
    background-color: var(--red);
}

.events-container {
  background-color: transparent; /* Make background transparent */
  border: none; /* Remove border */
  padding: 0; /* Remove padding */
  margin: 0; /* Remove margin */
  position: relative; 
  z-index: 40; /* Set a lower z-index for the event itself to allow the event-pop-up appear on top of all other elements*/
}

.event {
  margin: 3px auto; /* Center the event within the column */

  height: var(--event-height); /* Height of events set via variable */
  padding: var(--event-padding-vertical) var(--event-padding-horizontal); /* Vertical and horizontal padding */
  box-sizing: border-box; /* Include padding and border in width */
  text-align: center; /* Center text inside events */
  overflow: hidden; /* was hidden */
  word-wrap: break-word; /* Ensure long words break to fit within the event box */
  
  border: 1px solid #ccc;
  border-radius: 3px;
  background-color: var(--grey-medium);
  color: var(--font-dark);
  font-size: 0.8em;
  line-height: 1.5;            /* Adjust this value to increase the space between lines */
  position: relative; /* Ensure the pop-up is positioned relative to the event */
  z-index: 50; /* Set a lower z-index for the event itself to allow the event-pop-up appear on top of all other elements*/


  justify-content: center; /* Center the content vertically */
  align-items: stretch; /* Make sure the event div stretches to fill the container */
  min-height: var(--event-height); /* Prevent events from shrinking below this height */
  width: 100%; /* Make sure the event div takes full width of its container */
 

  
}

.event-name {
  font-weight: bold;
  display: -webkit-box;        /* Required for the multiline ellipsis effect */
  -webkit-box-orient: vertical;/* Required for the multiline ellipsis effect */
  -webkit-line-clamp: 1;       /* Number of lines to show */
  overflow: hidden;            /* Hides the overflowing content */
  text-overflow: ellipsis;     /* Adds the ellipsis (...) */
}
.type {
  font-weight: bold;
  overflow: hidden;            /* Hides the overflowing content */  
}
.region {
  font-style: italic; 
  overflow: hidden;            /* Hides the overflowing content */    
}

.more-info {
  font-weight: bold;
  font-style: italic; 
  color: var(--red);
}

.event-popup {
  position: fixed; /* Position relative to the viewport */
  z-index: 1000; /* Ensure the pop-up appears above all other elements */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none; /* Initially hidden */
  background-color: var(--grey-light);
  border: 1px solid var(--blue);
  padding: 10px;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    width: 500px; /* Standard width for the pop-up */
  max-width: 90%; /* Ensures the pop-up is responsive */
  min-width: 300px; /* Ensures the pop-up is not too narrow */
  font-size: 0.8em;
  line-height: 1.5;            /* Adjust this value to increase the space between lines */
  color: var(--font-dark);
}

.close-btn {
  position: absolute; /* Position relative to the nearest positioned ancestor */
  top: 0px; /* Adjust as needed */
  right: 5px; /* Adjust as needed */
  font-weight: bold;
  color: var(--red);
  cursor: pointer; /* Change cursor to pointer to indicate clickability */
  font-size: 1.4em; /* Adjust the size of the "x" as needed */
}

.popups-container {
  color: #ffffff;
}

.event-popup.show {
  display: block; /* Show pop-up when it has the 'show' class */
}
.month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 20px; /* Adjust the value as needed */
}

.left-button {
  align-self: flex-start;
}

.month-title {
  flex-grow: 1;
  text-align: center;
  font-size: 1.2em;
  font-weight: bold;
  color: var(--font-dark);
}

.right-button {
  align-self: flex-start;
}

.nav-button {
    background-color: var(--red);
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 3px;
     transition: background-color 0.3s, transform 0.3s;
}

.nav-link {
  color: var(--font-light);
  text-decoration: none; /* Remove underline from links */
}

.nav-button:hover {
    transform: scale(1.1); /* Make the button grow */
}
.nav-link:hover {
  color: var(--grey);
}

/* LIST VIEW STYLES */
.list-view.week {
  display: flex;
  flex-direction: column;
}

.list-view.day {
  display: flex;
  flex-direction: row; /* Keeps date and events-container side by side */
  align-items: stretch; /* Makes children stretch to fill the height */
  margin-bottom: var(--day-margin-bottom); /* Space between days */
  min-height: calc(var(--event-height) + var(--date-border-height) + var(--event-padding-vertical)); /* Minimum height for the day container */
  border-bottom: 1px solid #ddd;
}

.list-view.date {
  width: 75px;
  display: flex;
  flex-direction: column; /* Allows the date to stretch vertically */
  justify-content: center; /* Centers content vertically within the date container */
  border-right: var(--date-border-height) solid #ddd; /* Border to separate date and events-container */
  padding: 0 5px; /* Adjust padding if needed */
  margin-right: 5px; /* Add margin to the right */

}

.list-view.events-container {
  display: flex;
  flex-direction: row; /* Stack events vertically */
  flex-wrap: wrap; /* Allows events to wrap to the next line */
  flex: 1; /* Takes up remaining space in the day */
  margin: 0; /* Remove margin to ensure events are aligned properly */
  padding:0px; /* Remove padding to ensure events are aligned properly */
}

.list-view.event {
  width: 300px; /* Fixed width for events */
  margin: 0; /* Remove margin to ensure alignment */
  margin-top: 2px;
  margin-bottom: 2px;
}

/* CALENDAR VIEW STYLES */
.calendar-view.week {
  display: flex;
  flex-direction: row;
  justify-content: space-between; /* Distribute columns evenly */
}

.calendar-view.day {
  display: flex;
  flex-direction: column; /* Flex-column for the calendar view */
  flex: 1 0 0; /* Ensure equal width for each day */
  min-height: 100px; /* Set a minimum height for days */
  align-items: center; /* Center content horizontally within the day column */
  justify-content: flex-start; /* Add this line */
  border-right: 1px solid #ddd;

}

.calendar-view.events-container, 
  display: flex;
  flex-direction: column; /* Stack events vertically */
  flex: 1 1 0; /* Grow to fill available space */
}


.calendar-view.date {
  flex-shrink: 0; /* Prevent shrinking */
  height: 30px; /* Fixed height for the date bar */
  padding: 5px 0; /* Adjust padding if needed */
  text-align: center;
  font-size: 0.8em;
  box-sizing: border-box; /* Ensure date bar fits within the day div */
}

.calendar-view.event {
  flex: 1; /* Ensure events grow to fill available space */
  width: 98%; /* Ensure events take full width of their container */
  min-width: 230px;
  padding: 10p;
}

/* WEEK HEADER STYLES */
.week-header {
  display: flex;
  justify-content: space-between; /* Distribute headers evenly */
  margin-bottom: 10px
}

.day-header {
  flex: 1; /* Equal width for each day header */
  text-align: center;
  position: relative;
  font-size: 0.8em;
  background-color: var(--grey);
  font-weight: bold;
  color: var(--font-light);  
  z-index: 5;
  padding: 10px 0;
  border-right: 1px solid #ddd;
}

.day-header:last-child {
  border-right: none;
}