body {
font-family: 'Inter', sans-serif;
height: 100vh;
margin: 0;
padding: 0;
overflow: hidden;
display: grid;
grid-template-columns: 150px 1fr;
grid-template-rows: 60px 1fr;
grid-template-areas: 
  "header header" 
  "side main";
}

/* Center the baseUrl in the header */
header {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
text-align: center;
grid-area: header;
}

header h1 {
margin: 0;
text-align: center;
width: 100%;
}

#baseUrl {
text-decoration: none;
color: inherit;
}

/* Adjust header positioning in the grid */
.header {
display: flex;
justify-content: center;
align-items: center;
}

/* Ensure proper positioning in mobile view */
@media (max-width: 768px) {
header {
  padding: 10 50px; /* Add padding to make space for hamburger menu */
}
}

#sidebarListWrapper {
background: #646464;
overflow-y: auto; /* Enables vertical scrolling */
max-height: 80vh; /* Set this to the desired height or use vh for viewport height */
}

.sidebar-header {
border-bottom: 1px solid black;
}

#sidebarListWrapper {
/* No top border here to avoid double borders with the header */
flex-grow: 1; /* Allow content to grow and fill available space */
overflow-y: auto; /* Enable vertical scrolling for content */
padding: 10px;
border-bottom: 1px solid black;
}


#mySidebar::-webkit-scrollbar {
width: 10px;
}

#mySidebar::-webkit-scrollbar-track {
background: #f1f1f1;
}

#mySidebar::-webkit-scrollbar-thumb {
background: #888;
}

#mySidebar::-webkit-scrollbar-thumb:hover {
background: #555;
}


#mySidebar > div { /* Targeting the first and last child divs specifically */
padding: 10px;
background-color: #f0f0f0; /* Example styling */
}

/* If you have added class or id you can target them specifically instead of using div */
.sidebar-header, .sidebar-footer {
flex-shrink: 0; /* Prevents them from shrinking */
}

.sidebar-footer{
margin-top: auto;
}

#mySidebar li {
padding: 10px;
/*border-bottom: 3px solid #fff; /* Adjust border color to match the design */
}
#mySidebar li a, .showflow-link a {
font-weight: bold;
font-size: 1.1em; /* Slightly larger font size */
color: #000000;
text-decoration: none; /* Removes underline from links */
}
#mySidebar li a:hover {
  background-color: #eaeaea; /* Light grey for hover effect */
  color: blue; /* Ensure text color remains black on hover */
}

#mySidebar li a.active {
color: white;
background-color: #1e90ff; /* A different shade for the active link */
}

/* Make sure these are correctly assigned */
header {
grid-area: header;
width: 100%;
}

#mySidebar {
background: #646464;
box-shadow: 2px 0px 5px rgba(0,0,0,0.2);
grid-area: side; /* Keep the same grid area for all screen sizes */
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
}

/* Assuming "Production Schedule" is wrapped in a <div> with class "schedule-link" */
.schedule-link a {
display: block; /* Ensures the link fills the entire space of its container for easier clicking */
padding: 10px; /* Matches your #mySidebar li padding */
/*border-bottom: 3px solid #fff; /* Matches your #mySidebar li border */
font-weight: bold; /* Matches your #mySidebar li a font-weight */
font-size: 1.1em; /* Matches your #mySidebar li a font-size */
color: #333; /* Matches your #mySidebar li a color */
text-decoration: none; /* Matches your #mySidebar li a text-decoration */
}

.schedule-link a:hover {
background-color: #eaeaea; /* Matches your #mySidebar li a:hover background */
color: blue; /* Adjusted to match your intended hover color; was '#blue' which is incorrect */
}





/* styling for the roomies containers */
#main-content {
  grid-area: main;
  background-color: #ffffff;
  padding: 10px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
      "tabs tabs"
      "summary floorplan"
      "sessions sessions";
  gap: 10px;
  height: 100%;
}

#tabs-container {
  background-color: #f6f7f9;
  border-radius: 5px;
  grid-area: tabs;
}


#floorplan-container,
#summary-container,
#sessions-container {
  transition: flex 0.3s ease;
}

/* Add text wrapping for summary container */
#summary-container {
  grid-area: summary;
  background-color: #f6f7f9;
  padding: 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

/* Ensure all elements inside the summary container also wrap text */
#summary-container * {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Handle pre and code blocks inside summary if any */
#summary-container pre,
#summary-container code {
  white-space: pre-wrap;
  word-break: break-all;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  #summary-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

#sessions-container {
grid-area: sessions;
max-height: 30vh;
overflow-y: auto;
align-self: end;
background-color: #f6f7f9;
border-radius: 5px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
padding: 20px;
position: relative;
}


#sessions-container::-webkit-scrollbar {
  width: 8px;
}

#sessions-container::-webkit-scrollbar-track {
  background: #f0f0f0;
}

#sessions-container::-webkit-scrollbar-thumb {
  background-color: #cccccc;
  border-radius: 4px;
}

#floorplan-container {
  background-color: #f6f7f9;
  border-radius: 5px;
  grid-area: floorplan;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 10px;
  box-sizing: border-box;
}

#floorplan-container img {
  max-width: 100%;
  max-height: calc(100% - 50px); /* Adjust based on h2 height */
  object-fit: contain;
}

#floorplan-container h2 {
  margin: 0 0 10px 0;
  width: 100%;
  text-align: center;
}
pre {
font-family: "Inter", sans-serif;
font-size: 16px;
color: #333;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid #ccc;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.change-role-button {
  margin-bottom: 10px;
  padding: 5px 10px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.change-role-button:hover {
  background-color: #0056b3;
}

.user-role {
  font-size: 0.9em;
  color: #666;
}


/* Add styles to ensure the sidebar overlays content and the hamburger menu icon appears on small screens */
/* Hamburger Menu Styles */
.hamburger-menu {
display: none; /* Hidden by default on desktop */
position: fixed;
top: 15px;
left: 15px;
width: 30px;
height: 25px;
flex-direction: column;
justify-content: space-between;
cursor: pointer;
z-index: 1100; /* Higher than sidebar z-index */
}

.hamburger-menu span {
display: block;
height: 3px;
width: 100%;
background-color: #ffffff;
border-radius: 3px;
transition: all 0.3s ease;
}

/* Hamburger Animation */
.hamburger-menu.active span:nth-child(1) {
transform: translateY(11px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
transform: translateY(-11px) rotate(-45deg);
}

/* Mobile Styles with Animation */
@media only screen and (max-width: 768px), 
       only screen and (max-device-width: 768px),
       only screen and (hover: none) {
body {
  grid-template-columns: 1fr; /* Single column layout on mobile */
  grid-template-areas: 
    "header" 
    "main";
}
  
.hamburger-menu {
  display: flex; /* Show hamburger on mobile */
}
  
#mySidebar {
  position: fixed;
  left: -150px; /* Reduced from -250px to match new width */
  width: 150px; /* Reduced from 250px */
  transition: left 0.3s ease;
  z-index: 1000;
}
  
#mySidebar.active {
  left: 0; /* Show sidebar when active */
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
}
  
#main-content {
  display: flex;
  flex-direction: column;
  padding: 8px; /* Slightly reduced padding for mobile */
  gap: 8px; /* Slightly reduced gap for mobile */
}
  
/* Adjust grid-area elements to work in flex layout */
#tabs-container,
#summary-container,
#floorplan-container,
#sessions-container {
  width: 100%; /* Full width in the flex container */
}
  
/* Reorder elements if needed */
#tabs-container { order: 1; }
#summary-container { order: 2; }
#floorplan-container { 
  order: 3; 
  min-height: 300px; /* Ensure floorplan has reasonable height */
}
#sessions-container { 
  order: 4;
  max-height: none; /* Remove the height restriction */
}
  
/* Additional adjustments for nested elements */
#floorplan-container img {
  max-height: 250px; /* Limit image height on mobile */
}
  
/* Make sure tables are responsive */
table {
  width: 100%;
  display: block;
  overflow-x: auto;
}
  
/* Optional: add margin to main content when sidebar is active */
body.sidebar-active #main-content {
  margin-left: 0; /* Don't push content, overlay instead */
}
}

/* Hide sidebar header in mobile view */
@media (max-width: 768px) {
.sidebar-header h2 {
  display: none; /* Hide the Room Directory heading */
}
  
/* Optional: adjust padding/margin if needed after hiding the header */
.sidebar-header {
  padding: 60px; /* Reduced padding since heading is hidden */
  margin-top: 60px;
  margin-bottom: 0px;
  border-bottom: none; /* Remove border if you want */
}
}

/* Backdrop overlay */
.sidebar-backdrop {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,0.5);
z-index: 999; /* Below sidebar but above content */
}

@media (max-width: 768px) {
body.sidebar-active .sidebar-backdrop {
  display: block;
}
}

#sidebarListWrapper ul, 
#mySidebar ul {
list-style-type: none;
padding-left: 0;
}

/* Mobile main content layout with improved scrolling */
@media (max-width: 768px) {
  #main-content {
      display: flex;
      flex-direction: column;
      padding: 8px;
      gap: 8px;
      height: auto; /* Remove fixed height constraint */
      max-height: calc(100vh - 60px); /* Account for header height */
      overflow-y: auto; /* Enable vertical scrolling */
      overflow-x: hidden; /* Prevent horizontal scrolling */
  }
    
  /* Adjust containers to allow proper scrolling */
  #tabs-container,
  #summary-container,
  #floorplan-container,
  #sessions-container {
      width: 100%;
      flex-shrink: 0; /* Prevent containers from shrinking */
  }
    
  /* Remove fixed heights that might interfere with scrolling */
  #sessions-container {
      max-height: none; /* Remove height limitation */
      overflow-y: visible; /* Let parent container handle scrolling */
  }
    
  /* Make sure floorplan has reasonable dimensions but doesn't force layout issues */
  #floorplan-container {
      height: auto;
      min-height: 200px;
      max-height: 350px;
      overflow: hidden; /* Let parent handle scrolling */
  }
    
  /* Make tables responsive without breaking layout */
  table {
      width: 100%;
      display: block;
      overflow-x: auto;
  }
}

/* Fix for sessions container horizontal overflow on mobile */
@media (max-width: 768px) {
  /* Ensure sessions container doesn't overflow */
  #sessions-container {
      max-width: 100%;
      padding: 15px; /* Reduce padding */
      box-sizing: border-box; /* Include padding in width calculation */
      overflow-x: hidden; /* Prevent horizontal overflow */
  }
    
  /* Make tables properly responsive */
  #sessions-container table {
      width: 100%;
      table-layout: fixed; /* Fixed table layout for better control */
      font-size: 0.9em; /* Slightly smaller font for mobile */
  }
    
  /* Handle table cell overflow */
  #sessions-container td {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      padding: 6px 4px; /* Smaller padding in cells */
  }
    
  /* Create horizontal scroll for the table only when needed */
  #sessions-container .sessions-table-wrapper {
      width: 100%;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }
    
  /* Ensure the sessions wrapper takes appropriate width */
  #sessions-container > div {
      width: 100%;
      max-width: 100%;
  }
}
/* Fix for sessions container on mobile - remove independent scrolling */
@media (max-width: 768px) {
  #sessions-container {
      max-height: none; /* Remove height limitation */
      overflow-y: visible; /* Remove the scrollbar */
      overflow-x: visible; /* Remove horizontal scrollbar as well */
      height: auto; /* Allow it to expand to its content */
      padding: 15px; /* Reduce padding */
      margin-bottom: 20px; /* Add some margin at bottom for better spacing */
  }
    
  /* Maintain the table wrapper's horizontal scrolling */
  #sessions-container .sessions-table-wrapper {
      width: 100%;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      /* No max-height here, let it expand */
  }
    
  /* Ensure the content container can scroll as a whole */
  #main-content {
      overflow-y: auto; /* Main scrollbar here */
      padding-bottom: 30px; /* Add padding to bottom for better scrolling experience */
  }
}

/* Floorplan container adjustments for mobile */
@media (max-width: 768px) {
  #floorplan-container { 
    order: 3;
    min-height: auto; /* Allow container to adjust to content */
    max-height: none; /* Remove height restriction */
    padding: 15px; /* Add more padding to see borders clearly */
    box-sizing: border-box;
    background-color: #f6f7f9;
    border-radius: 5px;
    margin-bottom: 20px; /* Add some space below */
  }
  
  #floorplan-container img {
    max-height: none; /* Remove height limitation */
    max-width: 100%; /* Keep width constraint */
    width: auto; /* Let width adjust based on height */
    height: auto; /* Allow natural height */
    object-fit: contain; /* Preserve aspect ratio */
    margin: 0 auto; /* Center the image */
    display: block; /* Proper block display */
    border: 1px solid #e0e0e0; /* Optional: add a light border */
  }
    
  /* Make room name header more compact */
  #floorplan-container h2 {
      font-size: 1.2em; /* Slightly smaller font for mobile */
      margin-bottom: 8px;
      text-align: center;
  }
    
  /* Adjust file upload input if present */
  #floorplan-container input[type="file"] {
      width: 100%;
      margin-bottom: 10px;
  }
}

/* Hide the sessions toggle button on mobile */
@media (max-width: 768px) {
    #sessions-container button {
        display: none; /* Hide the button on mobile */
    }
    
    /* Ensure sessions are always visible on mobile */
    #sessions-container table {
        display: table !important; /* Override any inline styles */
    }
    
    /* Ensure proper table display on mobile */
    #sessions-container {
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
    }
}

/* Reduce table text size on WebKit browsers */
@media (max-width: 768px) {
  /* General table text size reduction for mobile */
  #sessions-container table {
    font-size: 0.9em; /* Reduce overall table font size */
  }
  
  /* Additional reduction specifically for WebKit browsers */
  @supports (-webkit-touch-callout: none) or (-webkit-appearance: none) {
    #sessions-container table {
      font-size: 0.85em; /* Slightly smaller for WebKit browsers */
    }
    
    /* Optional: make headers stay at a readable size */
    #sessions-container table th {
      font-size: 0.95em;
      font-weight: 600; /* Semi-bold for better readability at smaller sizes */
    }
  }
}

/* Add dead space under the table to prevent scroll bounce */
@media (max-width: 768px) {
  /* Add padding to the sessions container */
  #sessions-container {
    padding-bottom: 60px !important; /* 50px as requested plus a bit extra */
    margin-bottom: 50px !important; /* Additional space */
  }
  
  /* Add padding to the main content as well */
  #main-content {
    padding-bottom: 70px !important; /* Even more padding at the page bottom */
  }
  
  /* Create a spacer element after the table */
  #sessions-container::after {
    content: "";
    display: block;
    height: 50px; /* Empty space height */
    width: 100%;
  }
  
  /* Ensure the body has enough scrollable area */
  body {
    overflow-y: scroll; /* Always show scroll */
    padding-bottom: 50px; /* Additional padding */
  }
}

/* Enable text wrapping in table cells on mobile */
@media (max-width: 768px) {
  /* Allow text wrapping in table cells */
  #sessions-container table td {
    white-space: normal !important; /* Allow text to wrap */
    word-wrap: break-word !important; /* Break long words if needed */
    overflow-wrap: break-word !important;
    max-width: 300px; /* Limit width of cells */
    padding: 8px 6px; /* Adjust padding for wrapped text */
  }
  
  /* Keep headers not wrapping for cleaner look */
  #sessions-container table th {
    white-space: nowrap !important; /* Headers still don't wrap */
  }
  
  /* Adjust specific column widths for better wrapping */
  #sessions-container table td:nth-child(4) { /* Event Title column */
    max-width: 180px; /* Give more space to event titles */
  }
  
  #sessions-container table td:nth-child(5), 
  #sessions-container table td:nth-child(6) { /* Recorded/Streamed columns */
    max-width: 500px; /* These columns can be narrower */
  }
  
  /* Apply word breaking for really long words */
  #sessions-container table td {
    word-break: break-word; /* Enable breaking long words */
  }
  
  /* Ensure the table still has horizontal scroll for extreme cases */
  #sessions-container .sessions-table-wrapper {
    overflow-x: auto !important;
  }
}

/* Fix header cells to prevent them from being smaller than their text */
@media (max-width: 768px) {
  /* Make sure table headers don't shrink below text width */
  #sessions-container table th {
    white-space: nowrap !important; /* Prevent header text from wrapping */
    min-width: min-content !important; /* Don't go smaller than content */
    width: auto !important; /* Let width be determined by content */
    overflow: visible !important; /* Show all content */
    text-overflow: clip !important; /* Don't add ellipsis */
    padding: 8px 12px !important; /* Maintain padding */
    box-sizing: content-box !important; /* Include padding in width calculation */
  }
  
  /* Force the table to use proper layout for headers */
  #sessions-container table {
    table-layout: auto !important; /* Respect content widths */
  }
  
  /* Match column widths between headers and cells */
  #sessions-container table colgroup {
    display: table-column-group !important;
  }
  
  /* Each header cell establishes minimum width for its column */
  #sessions-container table th {
    position: relative !important;
    display: table-cell !important;
  }
}
