/* Base styles and CSS Variables for themes */
:root {
  /* Light mode variables */
  --bg-color: #ffffff;
  --text-color: #333333;
  --header-footer-bg: #f4f4f4;
  --border-color: #dddddd;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --accent-color: #007bff;
  --theme-toggle-bg: #e0e0e0;
  --theme-toggle-icon: #333;
  --hover-bg-light: #e9ecef; /* Light mode hover */
}

[data-theme="dark"] {
  /* Dark mode variables */
  --bg-color: #1e1e1e;
  --text-color: #e0e0e0;
  --header-footer-bg: #121212;
  --border-color: #444444;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --accent-color: #64b5f6;
  --theme-toggle-bg: #333333;
  --theme-toggle-icon: #f0f0f0;
  --hover-bg-dark: #2c2c2c; /* Dark mode hover */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Header Styles */
header {
  background-color: var(--header-footer-bg);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 5px var(--shadow-color);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--accent-color);
  /* Add animation for name on load */
  animation: fadeInDown 0.8s ease-out;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  /* Add animation for contact info */
  animation: fadeInUp 0.8s ease-out 0.2s both; /* Delayed start */
}

.contact-info span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#theme-toggle {
  background-color: var(--theme-toggle-bg);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s ease, transform 0.2s ease; /* Added transform */
  animation: popIn 0.5s ease-out 0.4s both; /* Animation for toggle button */
}

#theme-toggle:hover {
  background-color: var(--border-color);
  transform: scale(1.1); /* Slight scale on hover */
}

#theme-icon {
  color: var(--theme-toggle-icon);
  font-size: 1.2rem;
  transition: color 0.3s ease, transform 0.2s ease; /* Added transform */
}

#theme-toggle:hover #theme-icon {
  transform: rotate(20deg); /* Rotate icon slightly on hover */
}


/* Main Content Styles */
main {
  padding: 2rem 0;
}

/* --- Animation for Sections --- */
/* Define the fade-in-up animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Define the fade-in-down animation */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Define a pop-in animation */
@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  70% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
     opacity: 1;
    transform: scale(1);
  }
}


/* Apply fade-in animation to sections */
section {
  margin-bottom: 2rem;
  opacity: 0; /* Start hidden */
  animation: fadeInUp 0.6s ease-out forwards; /* Trigger animation */
}

/* Stagger the animation delays for sections */
/* Adjust the delay times as needed */
#objective { animation-delay: 0.1s; }
#skills { animation-delay: 0.3s; }
#education { animation-delay: 0.5s; }
#experience { animation-delay: 0.7s; }
#projects { animation-delay: 0.9s; }
#certificates { animation-delay: 1.1s; }

/* Ensure animated elements retain their final state */
section:nth-child(1) { animation-delay: 0.1s; }
section:nth-child(2) { animation-delay: 0.3s; }
section:nth-child(3) { animation-delay: 0.5s; }
section:nth-child(4) { animation-delay: 0.7s; }
section:nth-child(5) { animation-delay: 0.9s; }
section:nth-child(6) { animation-delay: 1.1s; }


h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--accent-color);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.3rem;
  /* Add subtle animation to section headers */
  transition: color 0.3s ease, border-color 0.3s ease;
}

/* Hover effect on section headers */
h2:hover {
  color: var(--text-color); /* Adjust color change as desired */
  border-color: var(--accent-color);
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.date {
  font-weight: normal;
  font-size: 0.9rem;
  color: var(--text-color); /* Adjust color if needed for contrast */
  opacity: 0.8;
}

ul {
  list-style-type: none;
  padding-left: 1rem;
}

ul li {
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.5rem;
  transition: transform 0.2s ease; /* Add transition for hover effect */
}

/* Hover effect on list items */
ul li:hover {
  transform: translateX(5px); /* Slight move on hover */
}

ul li::before {
  content: "•";
  color: var(--accent-color);
  position: absolute;
  left: 0;
  top: 0;
  transition: color 0.3s ease;
}

.education-item, .experience-item, .project-item {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-radius: 5px;
  background-color: var(--header-footer-bg);
  box-shadow: 0 1px 3px var(--shadow-color);
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease; /* Added transform */
}

/* Hover effect on cards */
.education-item:hover, .experience-item:hover, .project-item:hover {
  box-shadow: 0 4px 8px var(--shadow-color);
  transform: translateY(-3px); /* Lift slightly on hover */
  /* Optional: Change background on hover based on theme */
  /* background-color: var(--hover-bg-light); */ /* For light mode */
  /* [data-theme="dark"] .education-item:hover, [data-theme="dark"] .experience-item:hover, [data-theme="dark"] .project-item:hover {
    background-color: var(--hover-bg-dark);
  } */
}


/* Footer Styles */
footer {
  background-color: var(--header-footer-bg);
  text-align: center;
  padding: 1rem 0;
  margin-top: 2rem;
  box-shadow: 0 -2px 5px var(--shadow-color);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  opacity: 0; /* Start hidden */
  animation: fadeInUp 0.6s ease-out 1.3s forwards; /* Animate footer */
}

footer p {
  margin: 0.2rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  header .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-info {
    margin: 1rem 0;
  }

  header h1 {
    font-size: 1.8rem;
  }
}