:root {
  --content-height: calc(100vh - 150px);
  --header-footer-padding: 8px;
  --sidebar-width: 250px;
}
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fa;
  box-sizing: border-box;
}
.parent {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: 60px 1fr 150px;
  gap: var(--header-footer-padding);
  min-height: 100vh;
  padding: var(--header-footer-padding);
  box-sizing: border-box;
}

/* Header (div1) */
.div1 {
  grid-column: 1 / -1; /* Span all columns */
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
}

.menu {
  display: flex;
  gap: 24px;
}

.menu a {
  text-decoration: none;
  color: #444;
  font-weight: 500;
  padding: 6px 12px;
  transition: background-color 0.2s, color 0.2s;
  border-radius: 6px;
}

.menu a:hover {
  background-color: #e5e9f0;
  color: #000;
}

.search-box input {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: #007bff;
}

/* Sidebar (div2) */
.div2 {
  grid-column: 1;
  grid-row: 2;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
  overflow-y: auto;
  height: var(--content-height);
  position: relative;
}

.div2::-webkit-scrollbar {
  width: 8px;
}
.div2::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.sidebar-section h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #333;
  padding-bottom: 4px;
  border-bottom: 1px solid #e0e0e0;
}

.sidebar-section ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.sidebar-section ul li {
  padding: 8px 12px;
  border-radius: 6px;
  margin: 4px 0;
  color: #555;
  cursor: pointer;
  transition: background-color 0.2s;
}

.sidebar-section ul li:hover {
  background-color: #f0f4f8;
  color: #000;
}

/* Main content (div3) */
.div3 {
  grid-column: 2;
  grid-row: 2;
  background-color: #ffffff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
  overflow-y: auto;
}

/* Footer (div4) */
.div4 {
    grid-column: 1 / -1; /* Span all columns */
    grid-row: 3; /* Place in the third row */
    background-color: #ffffff;
    padding: 30px; /* Padding around the content */
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
    display: flex; /* Use flexbox for layout */
    flex-direction: row; /* Stack sections vertically */
    gap: 20px; /* Space between sections */
    align-items: flex-start; /* Align items to the start */
    font-size: 15px;
    min-height: 150px; /* Optional: Set a minimum height */
}

.footer-section {
    width: 100%; /* Ensure sections take full width */
    max-width: 300px; /* Optional: Limit max width */
}

.footer-section h4 {
    color: #2c3e50;
    margin-bottom: 10px; /* Space below heading */
}

.footer-section p {
    line-height: 1.6; /* Improve readability */
    margin-bottom: 10px; /* Space below paragraph */
}

.footer-section ul {
    padding: 0;
    list-style: none; /* Remove bullet points */
}

.footer-section li {
    margin-bottom: 5px; /* Space between list items */
}

.footer-section a {
    color: #555;
    text-decoration: none; /* Remove underline */
    transition: color 0.3s; /* Smooth color transition */
}

.footer-section a:hover {
    color: #2980b9; /* Change color on hover */
}

.social-links {
    display: flex; /* Use flexbox for social links */
    gap: 15px; /* Space between icons */
    font-size: 20px; /* Icon size */
}


/* User panel (div5) - Fixed positioning */
.div5 {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
  padding: 16px;
  font-size: 14px;
  height: fit-content;
  margin-left: auto;
}
.user-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-menu li {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: #444;
  transition: all 0.2s;
  background-color: #f8f9fc;
  font-weight: 500;
  white-space: nowrap;
}
.user-menu li:hover {
  background-color: #e5e9f0;
  color: #000;
  transform: translateX(-2px);
}
/* Add transition effects for user panel */
.user-panel {
  transition: all 0.3s ease;
}
.user-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .parent {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
  }

  .div1 {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  .div2 {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
  }

  .div3 {
    grid-column: 1;
    grid-row: 3;
  }

  .div4 {
        grid-template-columns: 1fr;
        gap: 25px;
    }

  .div5 {
    grid-column: 1 / -1;
    grid-row: 4;
    margin-top: var(--header-footer-padding);
    width: 100%;
  }

  .user-menu {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .user-menu li {
    white-space: normal;
  }
}

/* Animation for sidebar content */
@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
.sidebar-section {
  animation: fadeIn 0.3s ease forwards;
}
/* Delay animations for each section */
.sidebar-section:nth-child(1) { animation-delay: 0.1s; }
.sidebar-section:nth-child(2) { animation-delay: 0.2s; }
.sidebar-section:nth-child(3) { animation-delay: 0.3s; }
.sidebar-section:nth-child(4) { animation-delay: 0.4s; }