html.dark-mode {
  background-color: #1e1e1e;
  color: #f4f4f4;
}

:root {
  --bg-light: #f4f4f4;
  --text-light: #333;
  --bg-dark: #1e1e1e;
  --text-dark: #f4f4f4;
}

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

/* Body styles */
body {
  background-color: var(--bg-light);
  color: var(--text-light);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  padding: 0 1rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: #2a3d4a;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.project-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 2rem;
}

.project-card {
  background-color: #fff;
  color: #333;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

body.dark-mode .project-card {
  background-color: #2b2b2b;
  color: #f4f4f4;
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-card a {
  display: inline-block;
  margin-top: 1rem;
  color: #2f4d63;
}

body.dark-mode .project-card a {
  color: #89c4ff;
}

/* Dark mode styles */
body.dark-mode {
  background-color: #1e1e1e;
  color: #f4f4f4;
}

body.dark-mode main {
  background-color: #2b2b2b;
  color: #f4f4f4;
}

body.dark-mode h2 {
  color: #f4f4f4;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
}

body.dark-mode label {
  color: #ddd;
}

body.dark-mode footer {
  background-color: #111;
  color: #f4f4f4;
}

body.dark-mode footer a {
  color: #89c4ff;
}

body.dark-mode footer a:hover {
  color: #ffffff;
}

body.dark-mode .resume-btn {
  background-color: #4a6f89;
  color: white;
}

body.dark-mode .resume-btn:hover {
  background-color: #6f91a8;
}

/* Optional: Style the toggle button */
#theme-toggle {
  background: none;
  font-size: 1.5rem;
  margin-left: auto;
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 0.5rem 1rem;
  background-color: #4a6f89;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#theme-toggle:hover {
  background-color: #4a6f89;
}

#theme-toggle:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.resume-download {
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.resume-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  background-color: #2f4d63;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.resume-btn:hover {
  background-color: #577387;
}

/* Header */
header {
  background-color: #333;
  color: #fff;
  padding: 1.5rem 0;
  text-align: center;
}

header h1 {
  font-size: 2rem;
}

.fade {
  transition: opacity 0.5s ease;
  opacity: 0.6;
}

.header-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

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

nav a {
  font-size: 1.1rem;
  font-weight: 500;
  color: #fff;
  padding: 0.5rem 1rem;
  transition: color 0.3s ease;
}

nav a:hover {
  color: #577387;
}

@media (prefers-color-scheme: dark) {
    html:not(.dark-mode) {
      background-color: #1e1e1e;
      color: #f4f4f4;
    }
  }

@media (max-width: 600px) {
  .header-wrapper {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
  }

  nav ul {
    flex-direction: column;
  }

  nav li {
    margin: 0.5rem 0;
  }

}

.about-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap; /* ensures responsiveness */
}

.about-text {
  flex: 5;
  min-width: 300px;
}

.about-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
  padding: 2rem 1rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.about-centered p {
  font-size: 1.2rem;
  line-height: 1.8;
  max-width: 600px;
  margin-top: 1rem;
}

.about-centered h1 {
  font-size: 2rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

/* Header Image */
.header-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.profile-pic-header {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

/* Main Content */
main {
  max-width: 900px;
  margin: 2rem auto;
  padding: 1rem;
  background-color: #fff;
  color: #333;
  border-radius: 8px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

section {
  margin-bottom: 2rem;
}

.skills-grid {
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  flex-wrap: wrap;
}

.skills-grid ul {
  flex: 1;
  min-width: 200px;
  padding-left: 1.5rem;
}


h2 {
  margin-bottom: 0.5rem;
  color: #222;
}

ul {
  margin-top: 0.5rem;
  padding-left: 1.5rem;
}

/* Contact Form */
form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

input[type="text"],
input[type="email"] {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

input[type="submit"] {
  padding: 0.6rem;
  background-color: #2f4d63;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  width: fit-content;
}

input[type="submit"]:hover {
  background-color: #577387;
}

.thank-you {
  color: #3c763d;
  font-weight: bold;
  margin-top: 1rem;
  font-size: 1.1rem;
  text-align: center;
  transition: opacity 0.3s ease;
  opacity: 0;
  animation: fadeIn 0.5s forwards;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 2rem;
  padding: 1rem;
  background-color: #333;
  color: white;
}

footer a {
  color: #a3beda;
  font-weight: 500;
}

footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.profile-pic-centered {
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-pic-centered:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 800px) {
  .about-container {
    flex-direction: column;
    align-items: center;
  }

}

.error-message {
  color: #d9534f;
  font-size: 0.9rem;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

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