html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  /* Keep your existing body styles */
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
  /* Fix for mobile initial scroll position */
  position: relative;
}

/* Force sections to start at the top */
#home, #portfolio, #cogs, #resume, #contact {
  padding-top: 1px;
  margin-top: -1px;
}
body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  color: #2F4F4F; /* Dark slate for text */
  background-image: url('assets/background.jpg');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

.container {
  width: 75%;
  max-width: 1000px;
  min-width: 300px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: rgba(245, 245, 220, 0.95); /* Beige with opacity */
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

h1 {
  color: #2E7D32; /* Forest green for headings */
  text-align: center;
}

h2, h3 {
  color: #2E7D32; /* Forest green for headings */
  text-align: left;
}

p {
  font-size: 1.1em;
  line-height: 1.8em;
  text-align: justify;
}

a {
  color: #689F38; /* Lime green for links */
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #AED581; /* Light green for hover */
}

header {
  background-color: rgba(46, 125, 50, 0.9); /* Semi-transparent forest green */
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

nav ul li {
  margin: 0;
}

nav a {
  color: #F5F5F5; /* Off-white for nav links */
  font-size: 1.2em;
  padding: 0.5rem 1rem;
  border: 2px solid transparent;
  border-radius: 8px;
  transition: all 0.3s ease;
}

nav a:hover {
  border-color: #AED581;
  background-color: rgba(174, 213, 129, 0.2);
  color: #F5F5F5;
}

button {
  background-color: #689F38; /* Lime green */
  color: #F5F5F5;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #AED581;
}

/* === Portfolio List Enhancements === */
#portfolio ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#portfolio li {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed #ccc;
}

#portfolio li:last-child {
  border-bottom: none;
}

/* === Code Snippet Styling === */
pre, code {
  background-color: #f5f5f5;
  border-radius: 5px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 10pt !important;
  line-height: 1.4;
}

pre {
  padding: 15px;
  max-height: 400px;
}

code {
  padding: 2px 5px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
}

/* === Responsive Design === */
/* Large desktop */
@media (min-width: 1201px) {
  .container {
    width: 75%;
  }
}

/* Standard desktop */
@media (max-width: 1200px) {
  .container {
    width: 85%;
  }
}

/* Tablets and smaller laptops */
@media (max-width: 1024px) {
  .container {
    width: 90%;
    padding: 1.5rem;
  }
  
  pre, code {
    font-size: 9pt !important;
  }
  
  nav ul {
    gap: 1rem;
  }
}

/* Mobile devices (landscape) */
@media (max-width: 768px) {
  body {
    background-image: url('assets/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    -webkit-background-size: cover;
  }
  
  .container {
    width: 100%;
    padding: 1.2rem;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box;
  }
  
  h1 {
    font-size: 1.8em;
  }
  
  h2 {
    font-size: 1.5em;
  }
  
  h3 {
    font-size: 1.3em;
  }
  
  p {
    font-size: 1em;
    line-height: 1.6em;
  }
  
  pre, code {
    font-size: 8pt !important;
  }
  
  nav ul {
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 0.5rem;
  }
  
  nav a {
    font-size: 1em;
    padding: 0.4rem 0.8rem;
  }
}

/* Mobile devices (portrait) */
@media (max-width: 480px) {
  body {
    background-image: url('assets/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    -webkit-background-size: cover;
  }
  
  .container {
    width: 100%;
    padding: 1rem;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box;
  }
  
  h1 {
    font-size: 1.6em;
  }
  
  h2 {
    font-size: 1.3em;
  }
  
  h3 {
    font-size: 1.1em;
  }
  
  p {
    font-size: 0.95em;
    line-height: 1.5em;
    text-align: left;
  }
  
  pre, code {
    font-size: 7pt !important;
    padding: 10px;
  }
  
  nav ul {
    gap: 0.3rem;
  }
  
  nav a {
    font-size: 0.9em;
    padding: 0.3rem 0.6rem;
  }
  
  button {
    padding: 0.4rem 0.8rem;
    font-size: 0.9em;
  }
}

.image-gallery {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  gap: 1rem;
}

.gallery-image {
  flex: 1;
  width: calc(50% - 0.5rem); /* Half the container width minus gap */
  max-width: calc(50% - 0.5rem);
  height: auto;
  border: 2px solid #2E7D32; /* Forest green border */
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
