/* ------------ Reset ------------ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  scroll-behavior: smooth;
  background: linear-gradient(135deg, #f4f4f4, #e0e0e0);
  color: #222;
  transition: background 0.3s ease, color 0.3s ease;
  padding-top: 70px;
  line-height: 1.6;
}

body.dark {
  background: linear-gradient(135deg, #1e1e1e, #121212);
  color: #eee;
}

/* ------------ Navbar ------------ */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #333;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 50px;
  z-index: 1000;
  transition: background 0.3s ease;
}

body.dark nav {
  background: #222;
}

nav .logo {
  font-size: 1.5rem;
  font-weight: 600;
}

nav > div {
  display: flex;
  align-items: center;
  gap: 20px;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

nav a:hover,
nav a:focus {
  color: #00bcd4;
  outline: 2px solid #00bcd4;
  outline-offset: 2px;
}

.toggle-btn {
  cursor: pointer;
  background: #00bcd4;
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.3s ease;
}

.toggle-btn:hover,
.toggle-btn:focus {
  background: #0097a7;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

body.dark .toggle-btn {
  background: #0097a7;
}

body.dark .toggle-btn:hover,
body.dark .toggle-btn:focus {
  background: #00bcd4;
}

/* ------------ Sections (General) ------------ */
section {
  padding: 80px 50px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center; 
}

section.show {
  opacity: 1;
  transform: translateY(0);
}

h1, h2 {
  font-weight: 600;
  margin-bottom: 20px;
  color: inherit;
}

h1 {
  font-size: 3rem;
}

h2 {
  font-size: 2rem;
}

p {
  font-size: 1rem;
  max-width: 800px;
  margin: 0 auto 20px;
}

/* ------------ Hero ------------ */
.home{
  min-height: 100vh;
  padding: 5rem 9%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8rem;
  color: black;
}

.home .home-content h1{
  font-size: 6rem;
  font-weight: 700;
  line-height: 1.3;
}

span{
  color: skyblue;
}

.home-content h3{
  font-size: 4rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.home-content p{
  font-size: 1.6rem;
}

.social-icons a{
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 4rem;
  height: 4rem;
  background-color: transparent;
  border: 0.2rem solid black;
  font-size: 2rem;
  border-radius: 50%;
  margin: 3rem 1.5rem 3rem 0;
  transition: 0.3s ease;
  color: black;
}

.social-icons a:hover{
  color: white;
  transform: scale(1.3) translateY(-5px);
  background-color: black;
  box-shadow: 0  0 25px #b74b4b;
}

.btn{
  display: inline-block;
  text-decoration: none;
  padding: 1rem 2.8rem;
  background-color: black;
  border-radius: 4rem;
  font-size: 1.6rem;
  color: white;
  letter-spacing: 0.3rem;
  font-weight: 600;
  transition: 0.3s ease;
  cursor: pointer;
}

.btn:hover{
  transform: scale3d(1.03);
  background-color: #dadada;
  color: black;
  box-shadow: 0 0 25px rgb(146, 149, 146);
}

.typing-text{
  font-size: 34px;
  font-weight: 600;
  min-width: 280px;
}

.typing-text span{
  position: relative;
}

.typing-text span::before{
  content: "software Developer";
  color: skyblue;
  animation: words 20s infinite;
}

.typing-text span::after{
  content: "";
  background-color: none;
  position: absolute;
  width: calc(100% + 8px);
  height: 100%;
  border-left: 3px solid black;
  right: -8;
  animation: cursor 0.6s infinite;
}

@keyframes cursor{
  to{
    border-left: 3px solid #b74b4b;
  }
}

@keyframes words{
  0%, 20%{
      content: "Web Developer";
  }
  21%, 40%{
      content: "Developer";
  }
  41%, 60%{
      content: "Web Designer";
  }
  61%, 80%{
      content: "Youtuber";
  }
  81%, 100%{
      content: "Script Writer";
  }
}

@media (max-width: 1000px){
  .home{
      gap: 4rem;
  }
}

@media(max-width:995px){
  .home{
      flex-direction: column;
      margin: 5rem 4rem;
  }

  .home .home-content h3{
      font-size: 2.5rem;
  }

  .home-content h1{
      font-size: 5rem;
  }

  .home-img img{
      width: 70vw;
      margin-top: 4rem;
  }
}


/* ------------ About ------------ */
#about {
  padding: 30px 50px;   /* kam padding */
  margin-bottom: 10px;
  min-height: auto;     /* default full screen hataya */
}

#about h2 {
  margin-bottom: 10px;
}

#about p {
  margin: 5px 0;
}

#about img {
  display: block;
  margin: 10px auto;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #00bcd4;
  transition: border-color 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#about img:hover {
  transform: scale(1.05);
  border-color: #0097a7;
}

body.dark #about img {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* ------------ Skills ------------ */
/* ------------ Skills Section (Centered & Animated) ------------ */
#skills {
  max-width: 700px; /* Limits width for centering */
  width: 100%;
  margin: 0 auto;
}

#skills h2 {
  margin-bottom: 10px;
}

#skills p { /* Intro paragraph */
  margin-bottom: 40px;
  font-size: 1.1rem;
  color: #666;
}

body.dark #skills p {
  color: #ccc;
}

.skills-container {
  display: flex;
  flex-direction: column;
  align-items: center; /* Centers all skills vertically/horizontally */
  width: 100%;
  gap: 30px; /* Space between skills */
}

.skill {
  width: 100%;
  max-width: 500px; /* Keeps bars from being too wide on large screens */
  text-align: center; /* Centers text and bars */
}

.skill-label {
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 1.1rem;
  display: flex;
  justify-content: space-between; /* Pushes skill name left, % right */
  align-items: center;
}

.skill-percent {
  font-weight: bold;
  color: #00bcd4; /* Accent color for % */
  margin-left: 10px;
}

body.dark .skill-percent {
  color: #00e5ff; /* Brighter in dark mode */
}

.progress {
  width: 100%;
  height: 20px; /* Taller bar for better visibility */
  background: #e0e0e0; /* Light gray background */
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle inner shadow */
}

body.dark .progress {
  background: #444;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00bcd4, #0097a7); /* Gradient fill for smoothness */
  width: 0; /* Start at 0% for animation */
  border-radius: 10px;
  transition: width 1.5s ease-out; /* Smooth fill animation (1.5s) */
  position: relative;
  overflow: hidden;
}

.progress-bar::after { /* Optional: Shiny effect on fill */
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: translateX(-100%);
  animation: shine 2s infinite;
}

@keyframes shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

body.dark .progress-bar {
  background: linear-gradient(90deg, #00bcd4, #00e5ff); /* Brighter gradient in dark */
}

/* Responsiveness */
@media (max-width: 768px) {
  .skills-container {
    gap: 20px;
  }
  
  .skill-label {
    font-size: 1rem;
    flex-direction: column; /* Stack name and % on mobile */
    gap: 5px;
  }
  
  .skill-percent {
    margin-left: 0;
  }
  
  .progress {
    height: 15px; /* Slightly shorter on mobile */
  }
}

/* ------------ Projects (Grid Layout) ------------ */
#projects {
  display: flex;
  justify-content: center;
  width: 100%;
}

#projects p {
  margin-bottom: 40px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  width: 100%;
}

.project {
  background: #f9f9f9;
  padding: 30px;
  border-radius: 15px;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(30px);
  border-left: 4px solid #00bcd4;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  margin: 15px;
}

.project.show {
  opacity: 1;
  transform: translateY(0);
}

body.dark .project {
  background: #2a2a2a;
  border-left-color: #00bcd4;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.project:hover,
.project:focus-within {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

body.dark .project:hover,
body.dark .project:focus-within {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.project h3 {
  margin-bottom: 15px;
  color: #333;
  font-size: 1.3rem;
}
.project h4 {
  margin-bottom: 15px;
  color: #333;
  font-size: 1.3rem;
}


body.dark .project h3 {
  color: #eee;
}

.project a {
  text-decoration: none;
  color: #00bcd4;
  font-weight: bold;
  transition: color 0.3s ease;
  display: inline-block;
  margin-top: 10px;
}

.project a:hover,
.project a:focus {
  color: #0097a7;
  outline: 2px solid #00bcd4;
  outline-offset: 2px;
}

body.dark .project a {
  color: #00e5ff;
}

/* ------------ Contact ------------ */
#contact {
  display: flex;
  justify-content: center;
  width: 100%;
}

#contact p {
  margin-bottom: 40px;
}

.contact-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
}

.contact-info a {
  margin: 10px 10px;
  color: #00bcd4;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.2rem;
  transition: color 0.3s ease;
  padding: 10px;
  border-radius: 10px;
  border: 2px solid transparent;
}

.contact-info a:hover,
.contact-info a:focus {
  color: #0097a7;
  background: rgba(0, 188, 212, 0.1);
  border-color: #00bcd4;
}
