:root {
  /* Default values, which JS will override */
  --room-count: 37;
  --hour-count: 29;
  --col-width: 100px;
  /* Assuming 4 slots per hour 
     60px background / 4 = 15px per row */
  --row-height: 15px; 
}

body{
	overflow: hidden;
}
h1{ margin: 0;}

.content.rooms {
  color: white;
  max-width: unset;
}

.rooms-container {
  display: grid;
  grid-template-columns: 70px auto;
  grid-template-rows: auto;
  gap: 0 0;
  grid-template-areas:
    ". header"
    "cal-times main";
  overflow: scroll;
	height: calc(100vh - 102px);
	scrollbar-width: thin;
}

.cal-headers .room-info-btn{
	display: inline-flex;
	margin-left: 5px;
	height: 20px;
	width: 20px;
}

.cal-headers {
  display: grid;
  /* Now matches the sessions container exactly */
  grid-template-columns: repeat(var(--room-count), var(--col-width));
  color: white;
  border-right: 1px solid black;
  background: var(--darkred);
  grid-area: header;
  position: sticky;
  top: 0;
  z-index: 6;
}

.cal-headers div { 
  padding: 10px 5px 5px;
  text-align: center;
  border-left: 1px solid black;
  border-right: 1px solid black;
}

.cal-times {
  background: var(--darkred);
  grid-area: cal-times;
  justify-items: left;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: sticky;
  left: 0;
  z-index: 6;
}

.cal-times div { 
  padding: 10px 5px;
  /* This must match your background-size hour height */
  height: calc(var(--row-height) * 4); 
  text-align: center;
  border-top: 1px solid black;
  border-bottom: 1px solid black;
}

.admin-only {background: black;}

.sessions-container {
  display: grid;
  /* Syncs perfectly with headers */
  grid-template-columns: repeat(var(--room-count), var(--col-width));
  grid-template-rows: repeat(calc(4 * var(--hour-count)), var(--row-height));
  background: rgb(222, 223, 231);
  grid-area: main;
  position: relative;
  white-space: nowrap;
  /* Dynamically uses the variables to draw the grid pattern */
  background-size: var(--col-width) calc(var(--row-height) * 4);
  background-image:
    linear-gradient(to right, grey 1px, transparent 1px),
    linear-gradient(to bottom, grey 1px, transparent 1px);
}

.cal-session.imin { 
	background: var(--v-diff-2);
	z-index: 5;
}
.cal-session.is_private { 
	background: black;
	color: white;
	z-index: 5;
}
.cal-session {
  position: absolute;
  background: var(--dark-purps);
  color: white;
  border-radius: 5px;
  margin-top: 1px;
  margin-left: 1px;
  outline: none;
  width: calc(var(--col-width) - 1px);
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  padding: 3px;
  border: 2px solid white;
  z-index: 3;
	display: flex;
	flex-direction: column;
	justify-content: space-between;

	text-decoration: none;
	color: inherit;
}
.cal-session .session-location{ display: none;}

.cal-session:hover {
  z-index: 1000;
}

.cal-times div.start {
  border-top: 4px solid black; /* Adjust thickness and colour as desired */
}

.day-separator {
  grid-column: 1 / -1; /* Span across ALL room columns */
  border-top: 4px solid black;
  z-index: 4; /* Sits above grid background, below hovered sessions */
  pointer-events: none; /* Prevents line from blocking clicks on sessions */
}


/* #region my agenda view */

.rooms-container.my-agenda-view .cal-headers {
  grid-template-columns: 1fr;
}

.rooms-container.my-agenda-view .cal-headers div:not(.elsewhere) {
  display: none;
}

.rooms-container.my-agenda-view .cal-session .session-location{ display: block;}

.rooms-container.my-agenda-view .sessions-container {
  grid-template-columns: 1fr;
  background-size: 100% calc(var(--row-height) * 4);
  /* Remove vertical grey lines, keep horizontal time dividers */
  background-image: linear-gradient(to bottom, grey 1px, transparent 1px);
}

.rooms-container.my-agenda-view .cal-session:not(.imin) {
  display: none !important;
}

.rooms-container.my-agenda-view .cal-session.imin {
  grid-column: 1 !important; 
  width: calc(100% - 6px) !important;
  margin-left: 3px;
}

.view-switcher {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 7; 
	background: var(--green2);
	color: white;
	border: white 2px solid;
	border-radius: 5px;
}
/* #endregion my agenda view */