body {
    margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.layout-grid {
  display: grid;
  grid-template-areas: 
      "header header"
      "nav main"
      "footer footer";
  grid-template-rows: 60px 1fr 50px;
  grid-template-columns: 200px 1fr;
  height: 100vh;
  background: #1c2c26;
}

header {
  display: flex;
  flex-direction: row;
  align-items: center;
  grid-area: header;
  background: #444;
  color: white;
  padding: 0.5rem;
}

header h1 {
  font-size: 2rem;
}

header .menu-toggle {
  font-size: 2rem;
  padding: 0;
}

nav {
  grid-area: nav;
  background: #eee; 
  padding: 1rem;
}

main {
  grid-area: main;
  padding: 1rem;
  background: #1c2c26;
}

footer {
  grid-area: footer;
  background: #ccc;
  text-align: center;
  padding: 1rem;
}

.menu-toggle {
  display: none;
  font-size: 1rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  margin-right: 1rem;
}

/* Sidebar nav styles */
#sidebar {
  transition: max-height 0.3s ease-out;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

#sidebar.collapsible {
  max-height: 0;
  visibility: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0s linear 0.3s;
}

#sidebar.collapsible.open {
  max-height: 500px;
  visibility: visible;
  opacity: 1;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

#sidebar ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* main area */ 

.card-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1rem 1rem 0;
  
}

.card {
  background: #acccd2;
  /* border: 1px solid #ddd; */
  border-radius: 5px;
  flex: 1 1 auto;
  padding: 1rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}


/* Mobile styles */
@media (max-width: 768px) {
  .layout-grid {
    display: grid;
    grid-template-areas: 
        "header header"
        "main main"
        "footer footer";
    grid-template-rows: 60px 1fr 50px;
    grid-template-columns: 200px 1fr;
    height: 100vh;
  }
  .menu-toggle {
    display: block;
  }

  #sidebar {
    position: fixed;
    top: 60px;
    width: 100%;
    grid-area: nav;
    background: #eee;
    padding: 1rem;
  }

  #sidebar.collapsible {
  max-height: 0;
  visibility: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0s linear 0.3s;
}

#sidebar.collapsible.open {
  max-height: 500px; /* or auto with JS */
  visibility: visible;
  opacity: 1;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}


  #sidebar.collapsible.open {
    display: block;
    max-height: 500px;
  }

  #sidebar ul {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: #f4f4f4;
  }
}

/* Desktop styles */
@media (min-width: 769px) {
  #sidebar.collapsible {
    max-height: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: none;
    width: 150px;
  }

  .menu-toggle {
    display: none;
  }

  #sidebar.collapsible.open {
    display: block;
    max-height: 500px;
  }
}



