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

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  color: slategray;
}

body {
  position: relative;
  background: url("./images/background.jpg") no-repeat center center fixed;
  background-size: cover;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: slategray;
}

.app-container {
  display: grid;
  grid-template-columns: auto 1fr; /* Auto for nav, rest for content */
  grid-template-rows: auto 1fr auto; /* Header, Main, Footer */
  flex: 1;
}

/* Main content styles */
main {
  text-align: center;
}

.main {
  grid-row: 2; /* Second row */
  grid-column: 2; /* Second column */
  display: flex; /* Use flexbox to center content */
  justify-content: center; /* Center horizontally */
  align-items: center; /* Center vertically */
  padding: 2rem;
}

/* Header styles */
header {
  position: fixed; /* Keeps the header at the top */
  top: 0;
  left: 0;
  width: 100%; /* Span the full width of the page */
  display: flex;
  align-items: center;
  padding: 0 2rem; /* Add padding for spacing */
  box-sizing: border-box; /* Include padding in the height/width calculations */
  z-index: 10;
}

.footer {
  grid-column: 1 / -1; /* Span all columns */
  grid-row: 3; /* Last row in the grid */
  padding: 1rem;
  text-align: center;
  color: rgb(133, 61, 247);
  flex-shrink: 0;
}

.nav-footer {
  margin-bottom: 1rem;
}

.categories {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex: 1;
}

.category-item {
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.3s ease;
}

.category-item:hover {
  color: #a36cfc;
  transform: scale(1.1); /* Slight scaling effect */
}

.sign-up-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

button {
  background-color: #a36cfc;
  color: white;
  border-radius: 30px;
  width: 100px;
  height: auto;
  padding: 0.7rem;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

button:hover {
  transform: scale(1.1); /* Slight scaling */
  cursor: pointer;
}

.logo {
  width: 40px;
}

hr {
  height: 2px;
  width: 80%;
  color: white;
}

.sign-up {
  cursor: pointer;
  font-size: 0.8rem;
  text-decoration: underline;
  color: white;
}

.website-title {
  text-align: center;
  font-size: 3rem;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.website-sub-title {
  font-size: 1.5rem;
  color: white;
  position: relative; /* Ensures the scrolling content stays inside */
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.scrolling-content {
  display: flex;
  flex-direction: column;
  position: absolute; /* To avoid overlap of messages */
  top: 0;
  left: 0;
  width: 100%;
}

.message {
  opacity: 0; /* Initially hidden */
  height: 30px; /* Match this height with subtitle container */
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: absolute; /* Absolutely position the messages inside the container */
  width: 100%; /* Ensure each message spans the full width */
  animation: scrollMessages 16s infinite; /* Apply animation for each message */
  background: linear-gradient(90deg, rgba(255, 0, 128, 1) 50%, rgba(255, 0, 128, 1) 30%, rgba(255, 255, 255, 1) 100%);
  -webkit-background-clip: text;
  background-clip: text;

  /* Ensure text color is transparent */
  color: transparent;
  font-weight: 400;
}

@keyframes scrollMessages {
  0% {
    opacity: 0;
    transform: translateY(30px); /* Below the container */
  }
  10% {
    opacity: 1;
    transform: translateY(0); /* Fade in and scroll into view */
  }
  25% {
    opacity: 1;
    transform: translateY(0); /* Stay visible */
  }
  35% {
    opacity: 0;
    transform: translateY(-30px); /* Start fading out */
  }
  100% {
    opacity: 0;
    transform: translateY(-30px); /* Offscreen */
  }
}

/* Stagger animation delays for each message */
.message:nth-child(1) {
  animation-delay: 0s; /* First message starts immediately */
}

.message:nth-child(2) {
  animation-delay: 4s; /* Second message starts after 2s */
}

.message:nth-child(3) {
  animation-delay: 8s; /* Third message starts after 4s */
}

.message:nth-child(4) {
  animation-delay: 12s; /* Fourth message starts after 6s */
}

/* Hamburger Menu */
.hamburger-menu {
  display: none; /* Hidden by default */
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger-icon {
  font-family: "Material Symbols Outlined", sans-serif;
  font-size: 2rem;
  color: white;
}

#mainContent {
  transition: opacity 0.3s ease, visibility 0.3s ease;
  opacity: 1;
  visibility: visible;
}

#mainContent.hidden {
  opacity: 0;
  visibility: hidden;
}

.left-nav {
  position: fixed; /* Fix the nav to the left side of the viewport */
  top: 0;
  left: 0;
  width: 200px; /* Adjust width as needed */
  height: 100vh; /* Full height of the viewport */
  padding: 5rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: start;
  overflow-y: visible;
  background-color: whitesmoke;
  transition: width 0.5s ease, padding 0.5s ease;
}

/* Left Nav (hidden by default) */
#leftNav {
  transition: opacity 0.3s ease, visibility 0.3s ease;
  opacity: 1;
  visibility: visible;
}

#leftNav.hidden {
  opacity: 0;
  visibility: hidden;
}

.nav-container {
  display: flex;
  flex-flow: column;
  justify-content: flex-start;
  height: 100vh;
  width: 100%;
  gap: 1rem;
}

.nav-items {
  z-index: 10;
}

.nav-items:hover {
  color: #a36cfc;
  cursor: pointer;
}

hr.nav-seperator {
  width: 100%;
  height: 1px;
  background-color: #a36cfc;
}

.logged-in {
  background-color: lightgray;
  color: slategray;
}

.logged-out {
  background-color: #a36cfc;
  color: white;
}

.hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.categories.show {
  display: block; /* Adjust as per your mobile menu design */
}

/* toggle nav */
.left-nav.collapsed {
  width: 0px; /* Adjust to desired collapsed width */
  background-color: transparent;
}

.left-nav.collapsed .nav-items {
  display: none; /* Hide text */
}

.left-nav .toggle-btn {
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 60px;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  border-top: 1px solid slategray;
  border-bottom: 1px solid slategray;
  border-right: 1px solid slategray;
  background-color: whitesmoke;
  cursor: pointer;
  transition: transform 0.6s ease, background-color 0.3s ease;
}

.left-nav.collapsed .toggle-btn {
  right: -15px; /* Keep in the same place for collapsed state */
  transform: translateY(-50%); /* Rotate to indicate state */
}

/* Add media query for mobile devices (e.g., iPhone Pro) */
@media screen and (max-width: 768px) {
  body {
    height: 100dvh; /* Use dynamic viewport height on supported devices */
  }

  .app-container {
    height: 100dvh; /* Match app-container height to the dynamic viewport */
    display: grid; /* Retain grid layout */
    grid-template-rows: auto 1fr auto; /* Header, Main, Footer */
  }

  header {
    display: flex;
    flex-direction: column; /* Stack items vertically */
    justify-content: flex-start; /* Align items at the top */
    align-items: stretch; /* Make child items take full width */
    padding: 1rem; /* Add padding inside the header */
    box-sizing: border-box; /* Include padding in size calculations */
  }

  main {
    grid-row: 2;
    grid-column: 1 / -1;
    display: flex; /* Center content */
    justify-content: center;
    align-items: center;
    padding: 1rem;
  }

  .footer {
    grid-row: 3;
    grid-column: 1 / -1;
    padding: 1rem;
    text-align: center;
    flex-shrink: 0;
  }

  .hamburger-menu {
    position: fixed;
    display: block;
    align-self: flex-end;
    cursor: pointer;
    padding: 0;
  }

  /* Categories (Hidden by Default) */
  .categories {
    display: none; /* Hidden initially */
    flex-direction: column; /* Stack items vertically */
    gap: 1rem; /* Add spacing between items */
    margin-top: -50px;
  }

  /* Show Categories When Toggled */
  .categories.show {
    display: flex; /* Display flex when toggled */
  }

  .sign-up {
    color: #a36cfc;
  }

  .login.show {
    display: flex;
  }

  /* Adjust Sign-Up Container */
  .sign-up-container {
    display: flex;
    flex-direction: column; /* Stack sign-in and sign-up vertically */
    align-items: center;
    gap: 0.5rem;
  }

  .message {
    justify-content: center;
    font-size: 1.3rem;
    color: rgba(255, 0, 128, 1);
  }

  .website-title {
    font-size: 2.5rem;
  }

  .left-nav {
    width: 120px;
  }

  #leftNav {
    height: 100dvh;
  }

  .nav-container {
    height: 100dvh;
  }
}

/* Media query for desktop resolution */
@media screen and (min-width: 769px) {
  /* On larger screens, always show the menu */
  .hamburger-menu {
    display: none; /* Hide the hamburger menu */
  }

  .ul-list {
    display: flex;
  }

  .ul-list li {
    display: inline-block; /* Horizontal menu for desktop */
  }
}
