/* General Styles */
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  color: white;
  overflow-x: hidden;
}

canvas#bg {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
}

main {
  position: absolute;
  width: 100%;
  padding: 20px;
  z-index: 1;
}

header {
  text-align: center;
  padding: 50px 0;
}

.profile img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 3px solid #4CAF50;
  object-fit: cover;
}

/* Navigation Container */
.nav-container {
  background-color: rgba(0, 0, 0, 0.7);
  padding: 10px;
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 10px;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 90%; /* Adjusted for smaller screens */
  max-width: 800px; /* Limit width on larger screens */
}

/* Navigation Bar */
nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap; /* Allow items to wrap on smaller screens */
  justify-content: center;
}

nav ul li {
  margin: 0 10px; /* Reduced margin for smaller screens */
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

nav ul li a:hover {
  color: #4CAF50;
}

/* Toggle Button */
#theme-toggle {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
}

#theme-toggle:hover {
  background-color: #45a049;
}

/* Sections */
section {
  background: rgba(0, 0, 0, 0.7);
  padding: 20px;
  margin: 20px 0;
  border-radius: 10px;
  animation: fadeIn 1s ease-in;
}

section h2 {
  text-align: center;
  margin-bottom: 20px;
}

/* About Section */
.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-content h3 {
  margin-top: 20px;
}

.about-content ul {
  list-style-type: disc;
  margin: 10px 0 20px 20px;
}

.about-content ul li {
  margin: 10px 0;
}

/* Blog Section */
.blog-post {
  background: rgba(255, 255, 255, 0.1);
  padding: 15px;
  margin: 20px 0;
  border-radius: 10px;
}

.blog-post h3 {
  margin-top: 0;
}

.blog-post p {
  margin: 10px 0;
}

.read-more {
  color: #4CAF50;
  text-decoration: none;
  font-weight: bold;
}

.read-more:hover {
  text-decoration: underline;
}

/* Contact Section */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.contact-form button {
  background-color: #4CAF50;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.contact-form button:hover {
  background-color: #45a049;
}

.social-links {
  text-align: center;
  margin-top: 20px;
}

.social-links a {
  color: #4CAF50;
  text-decoration: none;
  margin: 0 10px;
}

.social-links a:hover {
  text-decoration: underline;
}

/* Footer */
footer {
  background-color: #222;
  color: #fff;
  text-align: center;
  padding: 10px;
  width: 100%;
  position: relative;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

/* Fade-in animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Light Mode Styles */
body.light-mode {
  background-color: white;
  color: #333;
}

body.light-mode header {
  background-color: #f4f4f4;
  color: #333;
}

body.light-mode .blog-post,
body.light-mode #about,
body.light-mode #contact {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
}

body.light-mode .nav-container {
  background-color: rgba(255, 255, 255, 0.9);
}

body.light-mode .nav-container ul li a {
  color: #333;
}

body.light-mode .nav-container ul li a:hover {
  color: #4CAF50;
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
  /* Adjust header padding */
  header {
    padding: 30px 0;
  }

  /* Make profile image smaller */
  .profile img {
    width: 100px;
    height: 100px;
  }

  /* Adjust navigation bar */
  .nav-container {
    width: 95%; /* Increase width for smaller screens */
    padding: 5px;
  }

  nav ul li {
    margin: 0 5px; /* Reduce margin for smaller screens */
  }

  /* Adjust section padding */
  section {
    padding: 15px;
    margin: 15px 0;
  }

  /* Adjust blog post padding */
  .blog-post {
    padding: 10px;
    margin: 15px 0;
  }

  /* Adjust contact form padding */
  .contact-form input,
  .contact-form textarea {
    padding: 8px;
  }

  .contact-form button {
    padding: 8px 16px;
  }
}

@media (max-width: 480px) {
  /* Further adjustments for very small screens */
  header {
    padding: 20px 0;
  }

  .profile img {
    width: 80px;
    height: 80px;
  }

  .nav-container {
    width: 100%; /* Full width on very small screens */
    border-radius: 0; /* Remove rounded corners */
  }

  nav ul {
    flex-direction: column; /* Stack navigation items vertically */
  }

  nav ul li {
    margin: 5px 0; /* Add vertical spacing */
  }

  section {
    padding: 10px;
    margin: 10px 0;
  }

  .blog-post {
    padding: 8px;
    margin: 10px 0;
  }

  .contact-form input,
  .contact-form textarea {
    padding: 6px;
  }

  .contact-form button {
    padding: 6px 12px;
  }
}
