:root {
  --primary: #7a3cff;
  --primary-dark: #5b2fcc;
  --bg-light: #f5f8fc;
  --bg-dark: #1a1a1a;
  --text-light: #333;
  --text-dark: #f1f1f1;
  --card-light: #ffffff;
  --card-dark: #2a2a2a;
  --shadow: 0px 4px 12px rgba(0,0,0,0.1);
  --transition: all 0.3s ease-in-out;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  margin: 0;
  background-color: var(--bg-light);
  color: var(--text-light);
  transition: var(--transition);
}

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

.navbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 15px 40px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .logo {
  position: absolute;
  left: 40px;
}

.navbar .logo img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #000;
  transition: var(--transition);
}

body.dark .navbar .logo img {
  border: 2px solid var(--text-dark);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
  background: var(--card-light);
  padding: 10px 20px;
  border-radius: 50px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

body.dark .nav-links {
  background: var(--card-dark);
}

.nav-links li a {
  text-decoration: none;
  color: var(--text-light);
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  transition: var(--transition);
}

body.dark .nav-links li a {
  color: var(--text-dark);
}

.nav-links li a.active,
.nav-links li a:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.05);
}

.hamburger {
  display: none;
  font-size: 28px;
  background: none;
  border: none;
  cursor: pointer;
  color: #000;
  position: absolute;
  right: 20px;
  top: 15px;
  z-index: 101;
}

body.dark .hamburger {
  color: #fff;
}

.toggle-btn {
  margin-left: 15px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
}

.toggle-btn:hover {
  background: var(--primary-dark);
  transform: rotate(20deg);
}

.hero {
  text-align: center;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: bold;
  margin-bottom: 10px;
}

.hero h1 .highlight {
  color: var(--primary);
}

.hero h3 {
  font-size: 1.6rem;
  font-weight: 500;
  margin-bottom: 20px;
  color: var(--text-light);
  transition: var(--transition);
}

body.dark .hero h3 {
  color: var(--text-dark);
}

.hero p {
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 750px;
  margin: 0 auto 20px auto;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--primary);
  color: #fff;
  font-weight: bold;
  border-radius: 8px;
  text-decoration: none;
  transition: var(--transition);
}

.hero-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--shadow);
}

.hero-btn .btn-icon {
  width: 20px;
  height: 20px;
}

section {
  padding: 50px 10%;
}

h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: var(--primary);
  text-align: left;
  margin-left: 0;
  position: relative;
  display: block;
}

h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--primary);
  margin-top: 6px;
  border-radius: 2px;
}

section:not(.hero) {
  text-align: left;
  max-width: 1100px;
  margin: auto;
}

.about {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 20px;
  text-align: left;
  line-height: 1.8;
  font-size: 1.1rem;
  animation: fadeIn 1.2s ease-in-out;
}

.about h2 {
  font-size: 2.5rem;
  margin-bottom: 25px;
  color: var(--primary);
  position: relative;
  display: block;
  text-align: left;
}

.about h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--primary);
  margin-top: 10px;
  border-radius: 2px;
}

.about p {
  margin-bottom: 18px;
}

.about .highlight {
  color: var(--primary);
  font-weight: bold;
}

.projects {
  margin-top: 20px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: var(--card-light);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 25px;
  transition: var(--transition);
}

body.dark .project-card {
  background: var(--card-dark);
}

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

.project-info h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--primary);
}

.project-info .tech-stack {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--text-light);
}

body.dark .project-info .tech-stack {
  color: var(--text-dark);
}

.project-info p {
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.project-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.project-buttons a.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  color: #fff;
  background: var(--primary);
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.project-buttons a.btn:hover {
  transform: translateY(-3px) scale(1.05);
  background: var(--primary-dark);
  box-shadow: 0px 6px 15px rgba(0,0,0,0.15);
}

.project-buttons a.btn img {
  width: 18px;
  height: 18px;
}


.skills h3 {
  margin-top: 30px;
}

.skills-category {
  font-weight: bold;
  margin-top: 20px;
  margin-bottom: 10px;
  color: var(--primary);
}

.skills .skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 10px;
}

.skill-card {
  display: inline-flex; 
  background: var(--card-light);
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  font-weight: 500;
  align-items: center;
  gap: 8px;
  white-space: nowrap; 
  padding: 10px;
}

.skill-card img {
  width: 24px;
  height: 24px;
}

body.dark .skill-card {
  background: var(--card-dark);
}

.skill-card:hover {
  transform: scale(1.08);
  background: var(--primary);
  color: #fff;
}

.education .edu-card {
  background: var(--card-light);
  padding: 18px 22px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: var(--transition);
}

body.dark .education .edu-card {
  background: var(--card-dark);
}

.education .edu-card:hover {
  transform: translateX(5px);
}

.education h3 {
  margin: 0 0 6px 0;
  font-size: 1.1rem;
  color: var(--primary);
}

.education p {
  margin: 2px 0;
  font-size: 0.95rem;
  color: inherit;
}

.education .description {
  font-size: 0.95rem;
  margin-top: 6px;
  color: var(--text-light);
}

body.dark .education .description {
  color: var(--text-dark);
}

.certifications ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr; 
  gap: 16px;
}

.certifications ul li {
  background: var(--card-light);
  padding: 16px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

body.dark .certifications ul li {
  background: var(--card-dark);
}

.certifications ul li:hover {
  transform: translateY(-5px);
  background: var(--primary);
  color: #fff;
}

.cert-title {
  font-weight: 600;
  color: var(--primary);
  display: inline-block;
}

.certifications ul li:hover .cert-title {
  color: #fff;
}

.certifications .cert-desc {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #666;
  line-height: 1.4;
}

body.dark .certifications .cert-desc {
  color: #aaa;
}

.certifications ul li:hover .cert-desc {
  color: #fff;
}

.cert-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.cert-date {
  font-size: 0.8rem;
  color: gray;
  font-style: italic;
}

.certifications ul li:hover .cert-date {
  color: #eee;
}

.certifications ul li a {
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--primary);
  transition: color 0.3s ease;
}

.certifications ul li a:hover {
  text-decoration: underline;
  color: #007BFF;
}

.certifications ul li:hover a {
  color: #fff;
}


/* Dark mode button styles */
body.dark .hero-btn, 
body.dark .project-buttons a.btn, 
body.dark .message-form button {
  background: var(--primary-dark);
  color: #fff;
}

body.dark .hero-btn .btn-icon,
body.dark .project-buttons a.btn img {
  filter: invert(1);
}

#contact {
  padding: 40px 20px;
}

.contact-container {
  display: flex;
  justify-content: center;
}

.message-form {
  flex: 1;
  max-width: 500px;
  min-width: 300px;
}

.message-form h3 {
  margin-bottom: 15px;
}

.message-form form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-form label {
  font-weight: 500;
  margin-bottom: 4px;
}

.message-form input,
.message-form textarea {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: var(--card-light);
  color: var(--text-light);
  transition: border 0.3s ease;
}

body.dark .message-form input,
body.dark .message-form textarea {
  background: var(--card-dark);
  color: var(--text-dark);
  border: 1px solid #444;
}

.message-form input:focus,
.message-form textarea:focus {
  border: 1px solid var(--primary);
  outline: none;
}

.message-form button {
  display: block;
  margin: 15px auto 0 auto; 
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}

.message-form button:hover {
  background: var(--primary-dark);
}

footer {
  display: flex;
  justify-content: space-between; 
  align-items: center;
  padding: 12px 20px;
  font-size: 0.9rem;
  color: inherit;
  background: transparent; 
}

footer p {
  margin: 0;
  padding-left: 10px;
}

.footer-social {
  display: flex;
  gap: 14px;
}

.footer-social img {
  width: 22px;
  height: 22px;
  transition: transform 0.3s ease;
}

.footer-social img:hover {
  transform: scale(1.2);
}

body.dark .footer-social img {
  filter: invert(1);
}

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

@media (max-width: 768px) {
  .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .navbar .logo {
    left: 20px; 
    top: 10px; 
  }

  .navbar .logo img {
    width: 40px; 
    height: 40px;
  }

  .hamburger {
    display: inline-flex;
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    z-index: 102; 
    background: none;
    border: none;
    cursor: pointer;
  }

  .toggle-btn {
    position: absolute;
    right: 65px; 
    top: 15px;
    z-index: 101;
  }

  .nav-links {
    position: absolute;
    top: 65px;
    right: 20px;
    background: #fff;
    flex-direction: column;
    width: 220px;
    padding: 10px 0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: none;
  }

  body.dark .nav-links { 
    background: #222; 
  }

  .nav-links li {
    margin: 10px 0;
    text-align: left;
    width: 85%;
  }

  .nav-links li a {
    display: block;
    padding: 10px 20px;
    width: 85%;
  }

  .nav-links.active { 
    display: flex; 
  }

  section { 
    text-align: left; 
    padding: 40px 5%; 
  }

  .hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    width: auto;
    justify-content: center;
    margin: 10px;
    font-size: 0.9rem;
  }

  .hero-btn .btn-icon {
    width: 20px;
    height: 20px;
  }

  .skills .skills-grid {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: left;
    width: 100%;
    gap: 10px;
  }

  .skill-card {
    flex: 0 0 auto;
    width: auto;   
    padding: 10px;   
  }

  .certifications ul {
    grid-template-columns: 1fr; 
  }

  .contact-container {
    flex-direction: column;
    align-items: center;
  }

  .message-form {
    width: 75%;
    max-width: 75%;
  }

  footer {
    text-align: center;  
    padding: 20px 10px;
  }

  footer .footer-text {
    margin-bottom: 12px;  
  }

  footer .social-icons {
    display: flex;
    justify-content: center;  
    gap: 15px; 
  }

  footer .social-icons a img {
    width: 28px; 
    height: 28px;
  }
}

