/* Base Mobile Styles */
.app-container {
  display: block; /* Stacked by default */
}

.sidebar {
  position: fixed;
  left: -250px; /* Hide off-screen */
  width: 250px;
  height: 100vh;
  background: #2c3e50;
  transition: left 0.3s ease;
  z-index: 1000;
}

/* When the invisible checkbox is checked, slide the menu in */
.nav-toggle:checked ~ .sidebar {
  left: 0;
}

.content {
  padding: 20px;
  padding-top: 60px; /* Space for the toggle button */
}

/* Hide the actual checkbox */
.nav-toggle {
  display: none;
}

.nav-toggle-label {
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1001; /* Must be higher than the sidebar */
  cursor: pointer;
  display: flex;
  align-items: center;
  height: 30px;
  width: 30px;
}

/* The middle bar */
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  display: block;
  background: #333;
  height: 3px;
  width: 25px;
  border-radius: 2px;
  position: relative;
  transition: all 0.3s ease-in-out;
}

/* The top and bottom bars */
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  content: '';
  position: absolute;
}

.nav-toggle-label span::before { bottom: 8px; }
.nav-toggle-label span::after { top: 8px; }

/* Hide the middle bar */
.nav-toggle:checked ~ .nav-toggle-label span {
  background: transparent;
}

/* Rotate top bar to 45 degrees */
.nav-toggle:checked ~ .nav-toggle-label span::before {
  transform: rotate(45deg);
  bottom: 0;
}

/* Rotate bottom bar to -45 degrees */
.nav-toggle:checked ~ .nav-toggle-label span::after {
  transform: rotate(-45deg);
  top: 0;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
  z-index: 999; /* Just below the sidebar, but above the content */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

/* Show overlay when checkbox is checked */
.nav-toggle:checked ~ .overlay {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 1024px) {
  .app-container {
    display: grid;
    grid-template-columns: 250px 1fr; /* Fixed sidebar width, flexible content */
  }

  .sidebar {
    position: sticky; /* Keeps it visible while scrolling */
    left: 0;
    height: 100vh;
    top: 0;
  }

  .nav-toggle-label {
    display: none; /* Hide the hamburger menu on desktop */
  }

  .content {
    padding-top: 20px; /* Reset mobile padding */
  }
  
  .overlay {
    display: none;
  }
}

/* Sidebar links */
.sidebar ul {
    list-style: none;
    padding: 20px 0;
    margin: 0;
}

.sidebar li a {
    display: block;
    padding: 10px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar li a:hover {
    background-color: #34495e;
}

/* Page title */
.content h1 {
    color: #333;
    font-size: 2em;
    margin-bottom: 20px;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #ecf0f1;
    color: #34495e;
    line-height: 1.6;
}

.sidebar h2, .sidebar h3 {
    color: #ecf0f1;
    font-weight: 600;
    padding: 10px 20px;
    margin: 0;
}

.sidebar h3.org-name {
    padding-top: 40px; /* Add space for the toggle button */
    background-color: #34495e;
}

/* Basic styling consistent with other views */
.error {
    color: red;
    font-weight: bold;
}
.success {
    color: green;
    font-weight: bold;
}
.filter-form {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}
.filter-form label {
    font-weight: bold;
}
.button-link {
    padding: 8px 12px;
    text-decoration: none;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
}
table {
    margin-top: 15px;
}
th, td {
    padding: 8px;
    text-align: left;
}
th {
    background-color: #f2f2f2;
}
