:root {
  --bg-color: #1f242d;
  --second-bg-color: #323946;
  --text-color: #fff;
  --main-color: #0ef;
  --accent-color: #00ff41;
  --shadow-color: rgba(0, 0, 0, 0.2);
}

body.light-theme {
  --bg-color: #ffffff;
  --second-bg-color: #f8f9fa;
  --text-color: #333333;
  --main-color: #007bff;
  --accent-color: #28a745;
  --shadow-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .header {
  background: rgba(255, 255, 255, 0.9) !important;
}

body.light-theme .navbar a {
  color: var(--text-color);
}

body.light-theme .logo-text {
  background: linear-gradient(45deg, var(--main-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  transition: all 0.3s ease;
  overflow-x: hidden;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  background: var(--second-bg-color);
  padding: 10px;
  border-radius: 5px;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-color);
  margin: 3px 0;
  transition: 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 10%;
  background: rgba(31, 36, 45, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  transition: all 0.3s ease;
}

.logo {
  font-size: 25px;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
}

.logo-text {
  background: linear-gradient(45deg, var(--main-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 5px var(--main-color), 0 0 10px var(--main-color);
  }
  to {
    text-shadow: 0 0 10px var(--main-color), 0 0 20px var(--main-color);
  }
}

.navbar a {
  font-size: 18px;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  margin-left: 35px;
  transition: 0.3s;
  position: relative;
}

.navbar a:hover {
  color: var(--main-color);
}

.navbar a::before {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -6px;
  left: 0;
  background-color: var(--main-color);
  transition: 0.3s;
}

.navbar a:hover::before {
  width: 100%;
}

.theme-toggle {
  cursor: pointer;
  font-size: 20px;
  color: var(--text-color);
  transition: 0.3s;
  padding: 10px;
  border-radius: 50%;
  background: var(--second-bg-color);
}

.theme-toggle:hover {
  color: var(--main-color);
  transform: rotate(180deg);
}

.home {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 100vh;
  padding: 80px 10% 0;
  background: var(--bg-color);
}

.home-content {
  max-width: 600px;
  flex: 1;
}

.home-content h3 {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  margin-bottom: 10px;
}

.animated-name {
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 600;
  margin: 10px 0;
  display: flex;
  flex-wrap: wrap;
  line-height: 1.2;
}

.letter {
  display: inline-block;
  animation: bounce 2s infinite;
  color: var(--main-color);
  margin-right: 2px;
}

.letter:nth-child(odd) {
  animation-delay: 0.1s;
}

.letter:nth-child(even) {
  animation-delay: 0.2s;
}

.space {
  width: clamp(10px, 2vw, 20px);
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.typing-text {
  color: var(--accent-color);
  animation: typing 3s infinite;
}

@keyframes typing {
  0%,
  50% {
    opacity: 1;
  }
  25%,
  75% {
    opacity: 0.5;
  }
}

.home-content p {
  font-size: clamp(14px, 2vw, 16px);
  margin: 20px 0 40px;
  line-height: 1.6;
}

.home-sci {
  margin: 30px 0 40px;
}

.home-sci a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 2px solid var(--main-color);
  border-radius: 50%;
  font-size: 20px;
  color: var(--main-color);
  text-decoration: none;
  margin: 0 15px 0 0;
  transition: 0.5s ease;
}

.home-sci a:hover {
  background: var(--main-color);
  color: var(--second-bg-color);
  transform: scale(1.3) translateY(-5px);
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--main-color);
  border-radius: 40px;
  font-size: 16px;
  color: var(--second-bg-color);
  letter-spacing: 1px;
  text-decoration: none;
  font-weight: 600;
  transition: 0.5s ease;
  box-shadow: 0 0 5px var(--main-color);
  border: none;
  cursor: pointer;
}

.btn:hover {
  box-shadow: 0 0 25px var(--main-color);
  transform: translateY(-3px);
}

.home-img {
  width: clamp(250px, 30vw, 400px);
  height: clamp(250px, 30vw, 400px);
  position: relative;
  flex-shrink: 0;
}

.img-container {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--main-color);
  box-shadow: 0 0 30px var(--main-color);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

.img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.5s ease;
}

.lighting-effect {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, var(--main-color), transparent, var(--accent-color), transparent);
  animation: rotate 4s linear infinite;
  z-index: -1;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.about,
.skills,
.contact {
  padding: 100px 10%;
  background: var(--second-bg-color);
}

.about:nth-child(even),
.skills:nth-child(even),
.contact:nth-child(even) {
  background: var(--bg-color);
}

.heading {
  text-align: center;
  font-size: clamp(32px, 5vw, 45px);
  margin-bottom: 50px;
}

.heading span {
  color: var(--main-color);
}

.about-content h3 {
  font-size: clamp(20px, 3vw, 26px);
  margin-bottom: 20px;
  color: var(--main-color);
}

.about-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--main-color);
}

.info-label {
  font-weight: 600;
  color: var(--main-color);
}

.skills-container {
  max-width: 1000px;
  margin: 0 auto;
}

.skill-category {
  margin-bottom: 50px;
}

.category-title {
  font-size: 24px;
  color: var(--main-color);
  margin-bottom: 30px;
  text-align: center;
  position: relative;
}

.category-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: var(--main-color);
}

.skill-item {
  margin-bottom: 30px;
}

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.skill-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.skill-icon {
  font-size: 24px;
  width: 30px;
  text-align: center;
}

.html-icon {
  color: #e34c26;
}
.css-icon {
  color: #1572b6;
}
.js-icon {
  color: #f7df1e;
}
.react-icon {
  color: #61dafb;
}
.php-icon {
  color: #777bb4;
}
.python-icon {
  color: #3776ab;
}
.c-icon {
  color: #a8b9cc;
}

.skill-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color);
}

.skill-percentage {
  font-size: 16px;
  font-weight: 600;
  color: var(--main-color);
  background: var(--second-bg-color);
  padding: 5px 10px;
  border-radius: 15px;
  border: 1px solid var(--main-color);
}

.skill-bar {
  width: 100%;
  height: 12px;
  background: var(--bg-color);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.skill-progress {
  height: 100%;
  background: linear-gradient(45deg, var(--main-color), var(--accent-color));
  border-radius: 6px;
  width: 0;
  transition: width 2s ease;
  position: relative;
}

.skill-progress::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: start;
}

.contact-item {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
}

.contact-item i {
  font-size: 24px;
  color: var(--main-color);
  margin-right: 20px;
  width: 40px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-form input,
.contact-form textarea {
  padding: 15px;
  background: var(--bg-color);
  border: 2px solid var(--main-color);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 16px;
  transition: 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  box-shadow: 0 0 10px var(--main-color);
}

.footer {
  background: var(--second-bg-color);
  padding: 20px 0;
  text-align: center;
  border-top: 1px solid var(--main-color);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .header {
    padding: 15px 5%;
  }

  .navbar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: 0.3s ease;
    z-index: 1000;
  }

  .navbar.active {
    right: 0;
  }

  .navbar a {
    display: block;
    font-size: 24px;
    margin: 20px 0;
    color: var(--text-color);
  }

  .theme-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
  }

  .home {
    flex-direction: column;
    padding: 100px 5% 50px;
    text-align: center;
    min-height: auto;
  }

  .home-content {
    max-width: 100%;
    margin-bottom: 40px;
  }

  .animated-name {
    justify-content: center;
    font-size: clamp(28px, 8vw, 40px);
  }

  .home-img {
    width: clamp(200px, 50vw, 300px);
    height: clamp(200px, 50vw, 300px);
  }

  .about,
  .skills,
  .contact {
    padding: 50px 5%;
  }

  .contact-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .skills-container {
    padding: 0 10px;
  }

  .skill-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .skill-info {
    flex: 1;
    min-width: 200px;
  }

  .skill-percentage {
    font-size: 14px;
    padding: 3px 8px;
  }
}

@media (max-width: 480px) {
  .home {
    padding: 80px 3% 30px;
  }

  .animated-name {
    font-size: clamp(24px, 7vw, 32px);
  }

  .home-content h3 {
    font-size: clamp(18px, 5vw, 24px);
  }

  .home-content p {
    font-size: 14px;
  }

  .home-img {
    width: clamp(180px, 45vw, 250px);
    height: clamp(180px, 45vw, 250px);
  }

  .about,
  .skills,
  .contact {
    padding: 40px 3%;
  }

  .heading {
    font-size: clamp(24px, 6vw, 32px);
  }

  .skill-info {
    gap: 10px;
  }

  .skill-icon {
    font-size: 20px;
    width: 25px;
  }

  .skill-name {
    font-size: 16px;
  }
}

/* Landscape orientation for mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .home {
    flex-direction: row;
    padding: 20px 5%;
    min-height: 100vh;
  }

  .home-content {
    margin-bottom: 0;
    text-align: left;
  }

  .animated-name {
    justify-content: flex-start;
    font-size: clamp(20px, 4vw, 32px);
  }
}
/* --- PROJECTS SECTION CSS --- */
.projects {
    background: var(--bg-color); /* Uses your existing theme variable */
    min-height: 100vh;
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.project-card {
    background: var(--second-bg-color, #1f242d); /* Fallback color if variable missing */
    border-radius: 2rem;
    overflow: hidden;
    box-shadow: 0 0 1rem rgba(0, 0, 0, 0.1);
    transition: 0.5s ease;
    border: 1px solid transparent;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--main-color, #0ef);
    box-shadow: 0 0 20px rgba(0, 238, 255, 0.2);
}

.project-img {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s ease;
}

.project-card:hover .project-img img {
    transform: scale(1.1);
}

.project-content {
    padding: 2rem;
}

.project-content h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color, #fff);
}

.project-content p {
    font-size: 1.4rem;
    color: var(--text-color, #eee);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.project-links {
    display: flex;
    gap: 1.5rem;
}

.project-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4rem;
    height: 4rem;
    background: transparent;
    border: 2px solid var(--main-color, #0ef);
    border-radius: 50%;
    color: var(--main-color, #0ef);
    font-size: 2rem;
    text-decoration: none;
    transition: 0.5s ease;
    width: auto;
    padding: 0.8rem 1.5rem;
    border-radius: 3rem;
    font-size: 1.4rem;
    gap: 0.5rem;
}

.project-links a:hover {
    background: var(--main-color, #0ef);
    color: var(--bg-color, #323946);
    box-shadow: 0 0 1rem var(--main-color, #0ef);
}

/* Mobile Responsive adjustment */
@media (max-width: 768px) {
    .projects-container {
        grid-template-columns: 1fr;
    }
}