/* Basic Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f9f9f9;
}

p {
  margin-bottom: 20px;
}

/* Top Bar */
header.top-bar {
  background-color: #004d22;
  color: #ecf0f1;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10;
}

header.top-bar .top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header.top-bar .logo img {
	height: 80px;
  padding: 15px 20px;
  display: block;
}

header.top-bar nav {
  padding: 10px 20px; 
  display: flex;
}

header.top-bar nav img.qr-code {
  height: 55px;
  width: 55px;
  display: block;
}

/* Layout Container */
.container {
  display: flex;
  width: 100%;
  height: calc(100vh - 80px); /* Top bar height adjustment */
  margin-top: 80px;
  overflow: hidden;
}

/* Burger Menu */
.burger-menu {
  background: none;
  border: none;
  font-size: 2rem;
  color: #ecf0f1;
  cursor: pointer;
  margin-left: 15px;
  display: none; /* Hidden by default */
}

/* Sidebar */
aside.sidebar {
  position: relative; /* Static for desktop */
  flex: 0 0 200px; /* Fixed width for the sidebar */
  width: 200px; /* Explicit width */
  height: auto;
  background-color: #003b19;
  color: #ecf0f1;
  padding: 1rem;
  overflow-y: auto;
  display: block; /* Always visible on desktop */
}

aside.sidebar nav ul {
  list-style: none;
}

aside.sidebar nav ul li {
  margin: 1rem 0;
}

aside.sidebar nav ul li a {
  color: #ecf0f1;
  text-decoration: none;
  padding: 0.5rem;
  display: block;
  border-radius: 5px;
  transition: background 0.3s;
}

aside.sidebar nav ul li a.active,
aside.sidebar nav ul li a:hover {
  background: #004d22;
}

/* Main Content */
main.content {
  flex-grow: 1;
  padding: 2rem;
  overflow-y: auto;
}

main.content h1 {
  color: #003b19;	
  line-height: 1.3;
  font-size: 2rem;
  margin-bottom: 1rem;
}

main.content article section {
  margin-bottom: 2rem;
}

main.content article h1, main.content article h2 {
  color: #003b19;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); /* 3 max cols */
  gap: 1rem; /* Space between cards */
  margin-top: 2rem;
}

.card {
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  flex: 1 1 calc(33.333% - 1rem); /* Three cards per row */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.card h2 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
  color: #333;
  line-height: 1.3;
}

.card p {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: #666;
}

.card-link {
  display: inline-block;
  margin-top: auto;
  padding: 0.5rem 1rem;
  background-color: #004d22;
  color: #ffffff;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.3s;
}

.card-link:hover {
  background-color: #003b19;
}

.card-link.secondary {
  background-color: #d1651a;
}

.card-link.secondary:hover {
  background-color: #c1611e;
}



/* QR Code Icon */
.qr-code-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}

.qr-code-button img {
  width: 24px;
  height: 24px;
}

/* QR Code Dialog */
.qr-code-dialog {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.qr-code-dialog-content {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  position: relative;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.qr-code-dialog-content .copy-button, 
.qr-code-dialog-content .download-button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem; /* Equal padding */
  background: #004d22; /* Primary color */
  color: #fff; /* White text */
  text-decoration: none; /* Remove underline for links */
  font-size: 1rem; /* Ensure consistent font size */
  line-height: 1.5; /* Normalize line height */
  text-align: center;
  border: none; /* Remove button border */
  border-radius: 5px; /* Rounded corners */
  cursor: pointer;
  transition: background 0.3s;
}

button.copy-button {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 0.5rem 1rem; /* Reapply padding */
    font-family: inherit; /* Inherit font styles */
    border: none; /* Remove default border */
    background: none; /* Reset background */
}

.qr-code-dialog-content .copy-button:hover {
  background: #003b19;
}

.qr-code-dialog-content .download-button {
  background: #d1651a;
}

.qr-code-dialog-content .download-button:hover {
  background: #c1611e;
}

.close-dialog {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.5rem;
  color: #333;
  cursor: pointer;
}

.document-embed {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #323639;
    width: 100%;
    height: 75vh;
    margin: 20px auto 0;
    display: flex;
    justify-content: center;
    align-items: center;
}


/* For Mobile Screens */
@media screen and (max-width: 768px) {
  /* Hide Sidebar on Mobile */
  aside.sidebar {
    position: fixed;
    top: 80px;
    left: -250px; /* Hidden off-screen */
    width: 250px;
    height: calc(100vh - 80px);
    background-color: #003b19;
    z-index: 100;
    transition: left 0.3s ease;
  }

  .container {
    overflow: scroll;
  }

  .cards {
    grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
  }

  /* Sidebar Active (Visible) */
  aside.sidebar.active {
    left: 0; /* Slide in */
  }

  /* Show Burger Menu on Mobile */
  .burger-menu {
    display: block;
  }

  /* Adjust Content for Mobile */
  .container {
    display: block;
  }

  main.content {
    margin-left: 0;
    width: 100%; /* Full width */
    padding: 2rem 1rem;
  }
  main.content h1 {
    font-size: 1.8rem;
  }

  .card h2 {
    font-size: 1.3rem;
  }

}