:root {
  --primary-color: #6c5ce7;
  --secondary-color: #fd79a8;
  --text-color: #2d3436;
  --bg-color: #f0f2f5;
  --accent-color: #00b894;
  --transition: all 0.3s ease;
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  margin: 0;
  padding: 0;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  text-align: center;
  padding: 4rem 0;
  clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
  position: relative;
}

h1 {
  margin-bottom: 0;
  font-size: 3.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
  color: var(--primary-color);
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 0.5rem;
  display: inline-block;
}

nav {
  background-color: rgba(255, 255, 255, 0.8);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

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

nav a {
  color: var(--primary-color);
  text-decoration: none;
  padding: 0.5rem 1rem;
  transition: var(--transition);
  font-weight: 600;
}

nav a:hover {
  color: var(--secondary-color);
  transform: translateY(-3px);
}

section {
  margin: 4rem 0;
  padding: 2rem;
  background-color: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-radius: 15px;
  transition: var(--transition);
}

section:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.experience-item {
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.experience-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.experience-item::before {
  display: none;
}

.experience-item h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.experience-item h4 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.dark-mode .experience-item {
  background-color: #2c3e50;
}

.project {
  background: linear-gradient(
    45deg,
    var(--accent-color),
    var(--secondary-color)
  );
  padding: 2rem;
  margin: 1rem 0;
  border-radius: 15px;
  transition: var(--transition);
  cursor: pointer;
  color: white;
}

.project:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#mode-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  z-index: 1001;
}

#mode-toggle:hover {
  background-color: var(--secondary-color);
  transform: translateY(-3px);
}

.dark-mode {
  --primary-color: #a29bfe;
  --secondary-color: #ff7675;
  --text-color: #dfe6e9;
  --bg-color: #2d3436;
  --accent-color: #55efc4;
}

.dark-mode body {
  background-color: var(--bg-color);
}

.dark-mode section {
  background-color: #34495e;
}

.dark-mode nav {
  background-color: rgba(44, 62, 80, 0.8);
}

.dark-mode nav a {
  color: var(--text-color);
}

.dark-mode nav a:hover {
  color: var(--accent-color);
}

.dark-mode h2 {
  color: var(--accent-color);
  border-bottom-color: var(--secondary-color);
}

.dark-mode .project {
  background: linear-gradient(
    45deg,
    var(--primary-color),
    var(--secondary-color)
  );
}

.dark-mode .modal-content {
  background-color: #2c3e50;
  color: var(--text-color);
}

.dark-mode .close {
  color: var(--text-color);
}

.dark-mode .close:hover,
.dark-mode .close:focus {
  color: var(--accent-color);
}

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

section {
  animation: fadeInUp 1s ease-out;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 600px;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

.education-item {
  margin-bottom: 2rem;
}

.fas,
.fab {
  margin-right: 5px;
}

nav a .fas {
  font-size: 1.2em;
  vertical-align: middle;
}

.project h3 .fas {
  font-size: 1.2em;
  margin-right: 10px;
}

#mode-toggle .fas {
  margin-right: 5px;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
  .container {
    padding: 0 15px;
  }

  h1 {
    font-size: 2.5rem;
  }

  nav ul {
    flex-direction: column;
    align-items: center;
  }

  nav li {
    margin: 5px 0;
  }

  section {
    padding: 1.5rem;
  }

  .project {
    padding: 1.5rem;
  }
}

@media screen and (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  #mode-toggle {
    top: 10px;
    right: 10px;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
  }

  .experience-item {
    padding: 0.8rem;
  }

  .project {
    padding: 1rem;
  }

  .modal-content {
    width: 90%;
    margin: 20% auto;
  }
}

/* Make the layout more flexible */
main {
  flex: 1;
}

/* Improve readability on smaller screens */
@media screen and (max-width: 768px) {
  body {
    font-size: 16px;
  }
}

@media screen and (max-width: 480px) {
  body {
    font-size: 14px;
  }
}

/* Adjust header for smaller screens */
@media screen and (max-width: 768px) {
  header {
    padding: 2rem 0;
    clip-path: none;
  }
}

/* Make projects stack vertically on smaller screens */
@media screen and (max-width: 768px) {
  .project {
    margin: 1rem 0;
  }
}

/* Adjust modal for smaller screens */
@media screen and (max-width: 768px) {
  .modal-content {
    width: 90%;
    margin: 10% auto;
  }
}

/* Hamburger menu styles */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  position: absolute;
  top: 20px;
  right: 20px;
}

@media screen and (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    height: 100%;
    background-color: var(--bg-color);
    transition: left 0.3s ease;
    z-index: 1000;
  }

  nav.active {
    left: 0;
  }

  nav ul {
    flex-direction: column;
    padding-top: 60px;
  }

  nav li {
    margin: 10px 0;
  }

  nav a {
    display: block;
    padding: 10px 20px;
  }

  #mode-toggle {
    top: 20px;
    left: 20px;
    right: auto;
  }
}

.dark-mode #contact a {
  color: var(--accent-color);
  transition: var(--transition);
}

.dark-mode #contact a:hover {
  color: var(--secondary-color);
}

.download-resume {
  display: inline-block;
  background-color: var(--accent-color);
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  font-weight: 600;
  transition: var(--transition);
  margin-top: 1rem;
}

.download-resume:hover {
  background-color: var(--secondary-color);
  transform: translateY(-3px);
}

.dark-mode .download-resume {
  background-color: var(--primary-color);
  color: var(--text-color);
}

.dark-mode .download-resume:hover {
  background-color: var(--accent-color);
}

@media screen and (max-width: 768px) {
  .download-resume {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }
}

.blog-overview {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  padding: 2rem;
  border-radius: 15px;
  color: white;
  text-align: center;
  margin: 1rem 0;
  transition: var(--transition);
}

.blog-overview:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.blog-overview p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  line-height: 1.6;
}

.blog-link {
  display: inline-block;
  background-color: white;
  color: var(--primary-color);
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border-radius: 30px;
  font-weight: 600;
  transition: var(--transition);
}

.blog-link:hover {
  background-color: var(--accent-color);
  color: white;
  transform: translateY(-3px);
}

.blog-link i {
  margin-right: 8px;
  font-size: 1.2em;
}

/* Dark mode styles */
.dark-mode .blog-overview {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
}

.dark-mode .blog-link {
  background-color: var(--bg-color);
  color: var(--text-color);
}

.dark-mode .blog-link:hover {
  background-color: var(--accent-color);
  color: white;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
  .blog-overview {
    padding: 1.5rem;
  }

  .blog-overview p {
    font-size: 1rem;
  }

  .blog-link {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
}

.project-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.project-link {
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--primary-color);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.project-link:hover {
  background-color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.dark-mode .project-link {
  background-color: var(--bg-color);
  color: var(--text-color);
}

.dark-mode .project-link:hover {
  background-color: var(--accent-color);
  color: white;
}

@media screen and (max-width: 768px) {
  .project-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .project-link {
    text-align: center;
    justify-content: center;
  }
}
