:root {
  --primary: #7f5af0;
  --secondary: #232946;
  --accent: #2cb67d;
  --bg: #121629;
  --text: #eaeaea;
  --card: #232946;
  --light-bg: #f4f4f4;
  --light-text: #232946;
}

body {
  font-family: 'Roboto', sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  transition: background 0.3s, color 0.3s;
}

body.light {
  background: var(--light-bg);
  color: var(--light-text);
}

a {
  color: var(--primary);
  text-decoration: none;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 5vw;
  background: var(--secondary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.logo {
  display: flex;
  align-items: center;
  font-weight: bold;
  font-size: 1.3rem;
  letter-spacing: 1px;
  color: var(--primary);
}

nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav a {
  color: var(--text);
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--primary);
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.6rem;
  cursor: pointer;
  margin-left: 1rem;
}

/* Hero Section */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(135deg, #232946 60%, #7f5af0 100%);
  overflow: hidden;
}

#hero .content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
}

#hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: 1px;
}

#hero .typed {
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 500;
  min-height: 2.2rem;
  display: inline-block;
}

#hero .lottie-bg {
  position: absolute;
  right: 5vw;
  bottom: 0;
  width: 400px;
  max-width: 60vw;
  z-index: 1;
  opacity: 0.7;
  pointer-events: none;
}

/* About */
#about {
  padding: 5rem 0 3rem 0;
  background: var(--bg);
}

#about .container {
  max-width: 900px;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
}

#about .profile-img {
  width: 160px;
  border-radius: 50%;
  border: 4px solid var(--primary);
  box-shadow: 0 4px 24px rgba(127, 90, 240, 0.15);
}

#about .about-text {
  flex: 1;
  min-width: 250px;
}

#about h2 {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

#about p {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

/* Skills */
#skills {
  background: var(--secondary);
  padding: 4rem 0;
}

#skills h2 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 2rem;
  font-size: 2rem;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem;
  max-width: 900px;
  margin: auto;
}

.skill-circle {
  width: 130px;
  height: 130px;
  background: var(--card);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(127, 90, 240, 0.07);
  position: relative;
  transition: transform 0.2s;
}

.skill-circle:hover {
  transform: translateY(-8px) scale(1.04);
}

.skill-svg {
  width: 80px;
  height: 80px;
  margin-bottom: 0.5rem;
}

.skill-label {
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.3rem;
  font-size: 1.1rem;
}

/* Projects */
#projects {
  padding: 4rem 0;
  background: var(--bg);
}

#projects h2 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 2rem;
  font-size: 2rem;
}

.projects-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  max-width: 1100px;
  margin: auto;
}

.project-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(127, 90, 240, 0.07);
  width: 320px;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 8px 32px rgba(127, 90, 240, 0.13);
}

.project-card .project-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
}

.project-card h3 {
  margin: 0 0 0.5rem 0;
  color: var(--accent);
  font-size: 1.2rem;
}

.project-card p {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.7rem;
}

.project-card a {
  color: var(--primary);
  font-weight: 500;
  font-size: 1rem;
  margin-top: auto;
  transition: color 0.2s;
}

.project-card a:hover {
  color: var(--accent);
}

/* Services */
#services {
  background: var(--secondary);
  padding: 4rem 0;
}

#services h2 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 2rem;
  font-size: 2rem;
}

.services-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  max-width: 900px;
  margin: auto;
}

.service-box {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(127, 90, 240, 0.07);
  width: 260px;
  padding: 2rem 1.2rem;
  text-align: center;
  transition: transform 0.2s;
}

.service-box:hover {
  transform: translateY(-8px) scale(1.04);
}

.service-box .service-icon {
  margin-bottom: 1rem;
  width: 48px;
  height: 48px;
  margin-left: auto;
  margin-right: auto;
}

.service-box h3 {
  color: var(--accent);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.service-box p {
  font-size: 1rem;
  color: var(--text);
}

/* Certifications */
#certifications {
  background: var(--bg);
  padding: 4rem 0;
}

#certifications h2 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 2rem;
  font-size: 2rem;
}

.swiper {
  width: 90vw;
  max-width: 700px;
  margin: auto;
}

.swiper-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(127, 90, 240, 0.07);
  padding: 2rem 1rem;
}

.cert-img {
  width: 220px;
  border-radius: 12px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 12px rgba(127, 90, 240, 0.13);
}

.swiper-pagination-bullet-active {
  background: var(--primary) !important;
}

/* Contact */
#contact {
  background: var(--secondary);
  padding: 4rem 0 2rem 0;
}

#contact h2 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 1.5rem;
  font-size: 2rem;
}

.contact-form {
  max-width: 400px;
  margin: auto;
  background: var(--bg);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(127, 90, 240, 0.07);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 1s;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border: none;
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: background 0.2s;
  margin-bottom: 1rem; /* Corrected margin */
  box-sizing: border-box; /* Corrected box */
}

.contact-form input:focus,
.contact-form textarea:focus {
  background: #232946;
}

.contact-form button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.9rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.contact-form button:hover {
  background: var(--accent);
  transform: translateY(-2px) scale(1.03);
}

.contact-form .form-message {
  margin-top: 0.7rem;
  font-size: 1rem;
  color: var(--accent);
  text-align: center;
  min-height: 1.2rem;
}

/* Footer */
footer {
  background: var(--bg);
  color: var(--text);
  text-align: center;
  padding: 2rem 0 1rem 0;
}

.footer-icons a {
  color: var(--primary);
  font-size: 1.5rem;
  margin: 0 0.7rem;
  transition: color 0.2s;
}

.footer-icons a:hover {
  color: var(--accent);
}

/* Hamburger menu toggle */
.menu-toggle {
  display: none;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
}


/* ===================== Responsive: Tablet & Mobile ===================== */
/* Mobile Styles */
@media (max-width: 768px) {
  header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  nav ul {
    flex-direction: column;
    position: absolute;
    top: 70px;
    right: 5vw;
    background: var(--secondary);
    width: 200px;
    padding: 1rem;
    display: none;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
  }

  nav ul.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  nav ul li {
    margin: 10px 0;
  }
  
  #hero h1 {
    font-size: 2rem;
  }

  #hero .typed {
    font-size: 1.2rem;
  }

  #about .container {
    flex-direction: column;
    text-align: center;
  }

  #about .profile-img {
    margin: auto;
  }

  .skills-grid,
  .services-grid,
  .projects-grid {
    flex-direction: column;
    align-items: center;
  }

  .skill-circle,
  .service-box,
  .project-card {
    width: 90%;
  }

  .contact-form {
    width: 90%;
    padding: 1.5rem 1rem;
  }
}

/* ===================== Responsive: Small Phones ===================== */
@media (max-width: 480px) {
  header {
    padding: 0.8rem 4vw;
  }

  .logo {
    font-size: 1.1rem;
  }

  #hero h1 {
    font-size: 1.6rem;
  }

  #hero .typed {
    font-size: 1rem;
  }

  #hero .lottie-bg {
    width: 250px;
  }

  #about h2,
  #skills h2,
  #projects h2,
  #services h2,
  #certifications h2,
  #contact h2 {
    font-size: 1.5rem;
  }

  .skill-label,
  .project-card p,
  .service-box p {
    font-size: 0.95rem;
  }

  .contact-form input,
  .contact-form textarea {
    font-size: 0.95rem;
  }

  .contact-form button {
    font-size: 1rem;
  }

  .footer-icons a {
    font-size: 1.3rem;
    margin: 0 0.5rem;
  }
}
