/* Base styles */
:root {
  --primary-color: #2c5dcd;
  --secondary-color: #2c3e50;
  --background-color: #f4f4f4;
  --text-color: #333;
  --header-color: #3b93d1;
  --header-height: 77px;
  --header-height-scrolled: 0;
  --nav-height: 36px;
  overflow-x: hidden;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  /* Add padding to prevent content from being hidden behind sticky header */
  padding-top: calc(var(--header-height) + var(--nav-height));
}

.container {
  width: 80%;
  margin: 0 auto;
  padding: 20px;
}

h1, h2, h3, h4 {
  color: var(--primary-color);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

p {
  line-height: 1.6;
  margin-bottom: 1em;
}

/* Header */
.header {
  background-color: var(--header-color);
  color: white;
  padding: 1rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: all 0.1s cubic-bezier(0.165, 0.84, 0.44, 1);
  height: auto;
}

.header.scrolled {
  height: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

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

.logo-header {
  display: flex;
  align-items: center;
  transition: opacity 0.3s ease;
}

.logo-header img {
  height: 45px;
  transition: all 0.3s ease;
}

.header-title {
  margin: 0;
  font-size: 1.5rem;
  color: white;
  transition: opacity 0.3s ease;
}

#burger-menu {
  display: none;
}

.burger-menu-label {
  display: none;
  flex-direction: column;
  width: 30px;
  cursor: pointer;
  z-index: 1001;
}

.burger-menu-label span {
  background: white;
  height: 3px;
  margin: 3px 0;
  transition: 0.4s;
}

.header-bar {
  background-color: var(--secondary-color);
  padding: 0.5rem;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  z-index: 999;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.header.scrolled + .header-bar {
  top: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-links a {
  color: white;
  margin: 0 10px;
  padding: 5px 0;
}

/* Logo in navigation when scrolled */
.nav-logo {
  margin-right: auto;
  padding-right: 20px;
  display: flex;
  align-items: center;
  animation: fadeIn 0.4s ease;
}

.nav-logo img {
  height: 35px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Footer */
footer {
  background-color: var(--secondary-color);
  color: white;
  text-align: center;
  padding: 1rem;
  width: 100%;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

@media (max-width: 900px) {
  main {
    padding: 0; 
  }
  .container {
    padding: 0;
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    width: 95%;
  }

  .burger-menu-label {
    display: flex;
    position: absolute;
    top: 15px;
    right: 15px;
  }

  .header-bar {
    display: none;
    position: fixed;
    top: var(--header-height);
  }

  .header.scrolled + .header-bar {
    top: 0;
  }

  #burger-menu:checked ~ .header-bar {
    display: block;
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 40px; /* Space for the burger menu */
  }

  .nav-links a {
    display: block;
    padding: 10px;
    width: 100%;
  }

  /* Move burger menu to nav when scrolled */
  .header.scrolled ~ .header-bar .burger-menu-label {
    display: flex;
    position: absolute;
    top: 12px;
    right: 15px;
  }

  #burger-menu:checked ~ .header .burger-menu-label span:nth-child(1),
  #burger-menu:checked ~ .header-bar .burger-menu-label span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  #burger-menu:checked ~ .header .burger-menu-label span:nth-child(2),
  #burger-menu:checked ~ .header-bar .burger-menu-label span:nth-child(2) {
    opacity: 0;
  }

  #burger-menu:checked ~ .header .burger-menu-label span:nth-child(3),
  #burger-menu:checked ~ .header-bar .burger-menu-label span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }
  
  /* Adjust nav logo positioning on mobile */
  .nav-logo {
    margin-right: 0;
    padding-right: 0;
    margin-bottom: 15px;
  }
}