/* Reset and Globals */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  border: none;
  outline: none;
  scroll-behavior: smooth;
  font-family: "Poppins", sans-serif;
}

:root {
  --bg-color: rgb(255, 255, 255);
  --second-bg-color: rgb(255, 255, 255);
  --text-color: rgb(0, 0, 0);
  --main-color: #d46fd9;
}

html {
  font-size: 60%;
  overflow-x: hidden;
}

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

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 4rem 12%;
  background-color: rgb(255, 255, 255);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
}

.logo {
  font-size: 2rem;
  font-weight: 800;
  transition: 0.3s ease;
}
.logo span {
  color: var(--main-color);
  text-shadow: 0 0 25px var(--main-color);
}
.logo:hover {
  transform: scale(1.1);
}

.navbar a {
  font-size: 1.5rem;
  color: var(--text-color);
  margin-left: 4rem;
  transition: 0.3s ease;
  border-bottom: 3px solid transparent;
}
.navbar a:hover,
.navbar a.active {
  color: var(--main-color);
  border-bottom: 3px solid var(--main-color);
}


#menu-icon {
  font-size: 3.6rem;
  color: var(--main-color);
  display: none;
  cursor: pointer;
}

/* Sections */
section {
  min-height: 100vh;
  padding: 10rem 12%;
}

/* Home */
.home {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10rem;
  flex-wrap: wrap;
}
.home-content h1 {
  font-size: 7rem;
  font-weight: 700;
  line-height: 1;
}
.home-content h3 {
  margin: 2rem 0;
  font-size: 3.5rem;
}
.home-content p {
  font-size: 1.5rem;
  max-width: 800px;
  line-height: 1.8;
}

.home-banner img {
  width: 100%;
  height: 300px;  
  object-fit: cover;
  border-radius: 10px;
}

/* Social Icons */
.social-icons a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 4.5rem;
  height: 4.5rem;
  border: 2px solid var(--main-color);
  border-radius: 50%;
  font-size: 2.5rem;
  color: var(--main-color);
  margin: 3rem 1.5rem 3rem 0;
  transition: 0.3s ease-in-out;
}
.social-icons a:hover {
  background: var(--main-color);
  color: var(--bg-color);
  transform: scale(1.2) translateY(-5px);
  box-shadow: 0 0 25px var(--main-color);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2.8rem;
  background: var(--main-color);
  border-radius: 4rem;
  font-size: 1.6rem;
  color: black;
  font-weight: 600;
  transition: 0.3s ease-in-out;
  cursor: pointer;
}
.btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 50px var(--main-color);
}
.btn-group {
  display: flex;
  gap: 1.5rem;
}
.btn-group a:nth-of-type(2) {
  background: black;
  color: var(--main-color);
  border: 2px solid var(--main-color);
}
.btn-group a:nth-of-type(2):hover {
  background: var(--main-color);
  color: black;
}

/* Typing Text Animation */
.text-animation {
  font-size: 34px;
  font-weight: 600;
  min-width: 280px;
}
.text-animation span {
  position: relative;
}
.text-animation span::before {
  content: "Frontend Developer";
  color: var(--main-color);
  animation: words 20s infinite;
}
.text-animation span::after {
  content: "";
  position: absolute;
  right: -8px;
  width: calc(100% + 8px);
  height: 100%;
  background: var(--bg-color);
  border-left: 3px solid var(--bg-color);
  animation: cursor 0.6s infinite, typing 20s steps(14) infinite;
}
@keyframes cursor {
  to { border-left: 2px solid var(--main-color); }
}
@keyframes words {
  0%,100% { content: "Web Developer"; }
}
@keyframes typing {
  10%,15%,30%,35%,50%,55%,70%,75%,90%,95% { width: 0; }
  5%,20%,25%,40%,45%,60%,65%,80%,85% { width: calc(100% + 8px); }
}

/* Education */
.heading {
  font-size: 8rem;
  text-align: center;
  margin: 5rem 0;
}
.education {
  background: var(--second-bg-color);
  padding: 100px 15px;
}
.timeline-items {
  max-width: 1200px;
  margin: auto;
  position: relative;
}
.timeline-items::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 100%;
  background: var(--main-color);
  left: calc(50% - 2.5px);
}
.timeline-item {
  width: 100%;
  margin-bottom: 40px;
  position: relative;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item:nth-child(odd) { text-align: right; padding-right: calc(50% + 30px); }
.timeline-item:nth-child(even) { padding-left: calc(50% + 30px); }
.timeline-dot {
  height: 21px;
  width: 21px;
  background: var(--main-color);
  position: absolute;
  left: calc(50% - 10px);
  top: 10px;
  border-radius: 50%;
  box-shadow: 0 0 25px var(--main-color), 0 0 50px var(--main-color);
}
.timeline-date {
  font-size: 20px;
  font-weight: 800;
  margin: 6px 0 15px;
}
.timeline-content {
  background: var(--bg-color);
  border: 3px solid var(--main-color);
  padding: 30px 50px;
  border-radius: 4rem;
  box-shadow: 0 0 10px var(--main-color);
  transition: 0.3s ease-in-out;
}
.timeline-content:hover {
  transform: scale(1.05);
  font-size: 20px;
  box-shadow: 0 0 25px var(--main-color);
}

/* Skills Section */
.skills {
  background: var(--bg-color);
  text-align: center;
  padding: 10rem 12%;
}
.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
}
.skill {
  background: var(--second-bg-color);
  border-radius: 2rem;
  padding: 3rem 2rem;
  transition: 0.3s ease-in-out;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
}
.skill:hover {
  transform: translateY(-10px);
  box-shadow: 0 0 25px var(--main-color);
}
.skill i {
  font-size: 4rem;
  color: var(--main-color);
  margin-bottom: 1rem;
}
.skill h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
}
.progress-bar {
  width: 100%;
  height: 10px;
  background: #333;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--main-color);
  border-radius: 5px;
  transition: width 2s ease;
}

.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project {
  background: var(--second-bg-color);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
}

.project:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 0 25px var(--main-color);
}

.project h3 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  color: var(--main-color);
}

.project p {
  font-size: 1.4rem;
  color: #ddd;
  margin-bottom: 1.5rem;
}

.project-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.project-links .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  font-size: 1.4rem;
  border-radius: 0.8rem;
  text-decoration: none;
  transition: 0.3s;
}

.project-links .btn.github {
  background: #24292f;
  color: #fff;
}

.project-links .btn.demo {
  background: var(--main-color);
  color: #000;
}

.project-links .btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 10px var(--main-color);
}

.toggle-buttons {
  text-align: center;
  margin-bottom: 3rem;
}
.toggle-buttons .btn {
  margin: 0 1rem;
}
.toggle-buttons .btn.active {
  background: var(--main-color);
  color: #000;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}
.project {
  background: var(--second-bg-color);
  padding: 2rem;
  border-radius: 1rem;
  transition: 0.3s;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
}
.project:hover { transform: translateY(-8px); box-shadow: 0 0 20px var(--main-color); }
.project h3 { font-size: 2rem; margin-bottom: 1rem; }
.project p { font-size: 1.4rem; color: #ccc; }

.certificate-card {
  background: #fff;
  border-radius: 15px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

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

.certificate-img {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 10px;
  margin-bottom: 1rem;
}

/* Contact */
.contact {
  background: var(--second-bg-color);
  text-align: center;
}

.contact form {
  max-width: 600px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact .input-box {
  position: relative;
}

.contact .input-box i {
  position: absolute;
  top: 50%;
  left: 1.5rem;
  transform: translateY(-50%);
  font-size: 2rem;
  color: var(--main-color);
  transition: 0.3s ease;
}

.contact input,
.contact textarea {
  width: 100%;
  padding: 1.5rem 1.5rem 1.5rem 4.5rem; 
  border-radius: 1rem;
  border: 2px solid var(--main-color);
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 1.6rem;
  outline: none;
  transition: 0.3s ease;
}

.contact textarea{
    width: 100%;
    padding: 1.5rem 1.5rem 4.5rem; 
    border-radius: 1rem;
    border: 2px solid var(--main-color);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1.6rem;
    outline: none;
    transition: 0.3s ease;
}

.contact input:focus,
.contact textarea:focus {
  border-color: var(--main-color);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}


.contact button {
  align-self: center;
}

.contact .input-box input:focus ~ i {
  color: var(--text-color);
  transform: translateY(-50%) scale(1.1);
}

/* === Footer === */
.footer {
  background: rgb(40, 39, 39);color: #ccc; text-align: center;
  padding: 3rem 1rem; margin-top: auto;
}
.footer h3 { font-size: 2rem; margin-bottom: 1rem; color: #fff; }
.footer p { max-width: 600px; margin: auto; margin-bottom: 1.5rem; font-size: 1.4rem; }
.footer .social-icons { margin: 1.5rem 0; }
.footer .social-icons a { font-size: 1.8rem; }
.footer-bottom { border-top: 1px solid rgb(40, 39, 39); padding-top: 1rem; font-size: 1.2rem; }

/* Scrollbar */
::-webkit-scrollbar { width: 15px; }
::-webkit-scrollbar-thumb { background: var(--main-color); }
::-webkit-scrollbar-track { background: var(--bg-color); }

/* Responsive */
@media (max-width: 768px) {
  #menu-icon { display: block; }
  .navbar {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--second-bg-color);
    padding: 2rem 0;
    text-align: center;
  }
  .navbar.active { display: block; }
  .navbar a { display: block; margin: 2rem 0; }
  .home { flex-direction: column; gap: 5rem; }
  .home-img img { width: 70vw; }
}

.footer {
  background: rgb(40, 39, 39);
  color: #fff;
  text-align: center;
  padding: 40px 20px;
  margin-top: 100px;
}

.footer h3 {
  font-size: 24px;
  margin-bottom: 15px;
}

.footer p {
  max-width: 600px;
  margin: 0 auto 20px;
  line-height: 1.6;
  font-size: 14px;
  color: #ccc;
}

.socials {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.socials li a {
  text-decoration: none;
  color: #fff;
  font-size: 16px;
  transition: color 0.3s;
}

.socials li a:hover {
  color: #00bcd4;
}

.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 10px;
  font-size: 13px;
  color: #aaa;
}

/* ========================= Responsive Enhancements ========================= */

/* Tablets (≤992px) */
@media (max-width: 992px) {
  html {
    font-size: 55%;
  }
  .header {
    padding: 3rem 8%;
  }
  section {
    padding: 8rem 8%;
  }
  .home {
    gap: 5rem;
  }
  .home-content h1 {
    font-size: 5.5rem;
  }
  .home-content h3 {
    font-size: 3rem;
  }
}

/* Mobile Landscape & Below (≤768px) */
@media (max-width: 768px) {
  html {
    font-size: 52%;
  }

  /* Navbar */
  #menu-icon {
    display: block;
  }

  .navbar {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-color);
    flex-direction: column;
    text-align: center;
    padding: 2rem 0;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
  }

  .navbar.active {
    display: flex;
  }

  .navbar a {
    margin: 1.5rem 0;
    font-size: 2rem;
  }

  /* Home Section */
  .home {
    flex-direction: column;
    text-align: center;
    gap: 4rem;
  }

  .home-content h1 {
    font-size: 5rem;
  }
  .home-content h3 {
    font-size: 2.8rem;
  }
  .home-content p {
    font-size: 1.6rem;
    margin: 0 auto;
  }
  .home-banner img {
    width: 90%;
    height: auto;
  }

  /* Home Section Buttons Centering on Mobile */
@media (max-width: 768px) {
  .btn-group {
    display: flex;
    justify-content: center; 
    gap: 1.5rem;
    flex-wrap: wrap; 
    margin-top: 2rem;
  }
}
  

/* Mobile timeline - same as desktop */
@media (max-width: 768px) {
  .timeline-items::before {
    left: 50%; /* center line */
    transform: translateX(-50%);
  }

  .timeline-item {
    width: 100%;
    margin-bottom: 40px;
    position: relative;
    text-align: left; /* keep alternating handled by nth-child */
    padding: 0;
  }

  .timeline-item:nth-child(odd) {
    text-align: right;
    padding-right: calc(50% + 30px);
    padding-left: 0;
  }

  .timeline-item:nth-child(even) {
    text-align: left;
    padding-left: calc(50% + 30px);
    padding-right: 0;
  }

  .timeline-dot {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
  }
}


  /* Skills Grid */
  .skills-container {
    grid-template-columns: 1fr 1fr;
  }

  /* Projects */
  .projects-container {
    grid-template-columns: 1fr;
  }
  .project {
    margin: 0 auto;
    max-width: 95%;
  }

  /* Contact */
  .contact form {
    width: 90%;
  }

  /* Footer */
  .footer {
    padding: 2.5rem 1rem;
  }
  .footer h3 {
    font-size: 2rem;
  }
  .footer p {
    font-size: 1.3rem;
  }
  .socials {
    gap: 10px;
  }
  .socials li a {
    font-size: 18px;
  }
}

/* Small Phones (≤480px) */
@media (max-width: 480px) {
  html {
    font-size: 50%;
  }

  .header {
    padding: 2rem 6%;
  }
  section {
    padding: 6rem 6%;
  }

  .skills-container {
    grid-template-columns: 1fr;
  }

  .timeline-content {
    padding: 20px 25px;
  }

  .btn {
    padding: 0.8rem 2.2rem;
    font-size: 1.4rem;
  }

  .footer p {
    font-size: 1.2rem;
  }
}