/* CSS Variables for Theme Switching */
:root {
  /* Light Theme */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --accent: #3a86ff;
  --accent-light: #a5d8ff;
  --border: #eaeaea;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-hover: rgba(0, 0, 0, 0.12);
  --gradient: linear-gradient(135deg, #3a86ff, #8338ec);
  --header-height: 80px;
}

.dark-theme {
  /* Dark Theme */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --accent: #60a5fa;
  --accent-light: #1e40af;
  --border: #334155;
  --shadow: rgba(0, 0, 0, 0.25);
  --shadow-hover: rgba(0, 0, 0, 0.35);
  --gradient: linear-gradient(135deg, #60a5fa, #a78bfa);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation - FIXED */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--bg-primary);
  box-shadow: 0 2px 10px var(--shadow);
  z-index: 1000;
  height: var(--header-height);
  transition: all 0.3s ease;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
}

.logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.logo span {
  font-weight: 300;
}

.subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: -5px;
  display: none;
}

/* Desktop Navigation - FIXED SELECTOR */
.desktop-nav {
  display: flex;
}

.desktop-nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.desktop-nav li {
  list-style: none;
}

.desktop-nav a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
  white-space: nowrap;
  padding: 0.5rem 0;
}

.desktop-nav a:hover {
  color: var(--accent);
}

.desktop-nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: width 0.3s;
}

.desktop-nav a:hover::after {
  width: 100%;
}

.desktop-contact {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.desktop-contact a {
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  transition: all 0.3s;
  white-space: nowrap;
}

.desktop-contact a:first-child {
  color: var(--text-primary);
  border: 2px solid var(--border);
}

.desktop-contact a:first-child:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.desktop-contact a:last-child {
  background: var(--gradient);
  color: white;
}

.desktop-contact a:last-child:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--shadow-hover);
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-primary);
  cursor: pointer;
  margin-left: 1rem;
  transition: transform 0.3s;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.theme-toggle:hover {
  transform: rotate(30deg);
  background-color: var(--bg-secondary);
}

/* Mobile Menu Toggle Button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background-color 0.3s;
  z-index: 1001;
}

.menu-toggle:hover {
  background-color: var(--bg-secondary);
}

/* Mobile Menu - FIXED */
.mobile-menu {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  background-color: var(--bg-primary);
  box-shadow: 0 10px 20px var(--shadow);
  padding: 2rem;
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  z-index: 999;
  transform: translateY(-100%);
  opacity: 0;
  transition:
    transform 0.3s ease-in-out,
    opacity 0.3s ease-in-out;
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
}

.mobile-menu.active {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

.mobile-menu a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 1.1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}

.mobile-menu a:hover {
  color: var(--accent);
}

.mobile-contact {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.mobile-contact a {
  border: none;
  text-align: center;
  padding: 0.8rem;
  border-radius: 6px;
  font-weight: 500;
}

.mobile-contact a:first-child {
  color: var(--text-primary);
  border: 2px solid var(--border);
}

.mobile-contact a:first-child:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mobile-contact a:last-child {
  background: var(--gradient);
  color: white;
}

.mobile-contact a:last-child:hover {
  transform: translateY(-2px);
}

.mobile-menu .theme-toggle {
  margin: 1rem auto 0;
  display: flex;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-height) + 2rem) 0 4rem;
}

.hero-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
}

.hero-left {
  flex: 1;
}

.text-emphasis {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub-heading {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.description {
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
  max-width: 600px;
  color: var(--text-secondary);
}

.btn-section {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  padding: 0.9rem 2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  display: inline-block;
  text-align: center;
  min-width: 150px;
}

.btn-primary {
  background: var(--gradient);
  color: white;
  border: none;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px var(--shadow-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-secondary:hover {
  background-color: var(--accent);
  color: white;
  transform: translateY(-3px);
}

.hero-right {
  flex: 1;
  display: flex;
  justify-content: center;
}

.img-profile {
  width: 100%;
  max-width: 400px;
  height: auto;
  aspect-ratio: 1/1;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 20px 40px var(--shadow);
  transition: transform 0.5s;
}

.img-profile:hover {
  transform: translateY(-10px);
}

/* Skills Section */
.skills-icon {
  padding: 4rem 0;
  background-color: var(--bg-secondary);
}

.skills-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2.5rem;
}

.icon-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s;
  min-width: 80px;
}

.icon-wrapper:hover {
  transform: translateY(-10px);
}

.icon {
  font-size: clamp(2.5rem, 5vw, 3rem);
  margin-bottom: 0.5rem;
}

.fa-html5 {
  color: #e34f26;
}
.fa-css3-alt {
  color: #1572b6;
}
.fa-js-square {
  color: #f7df1e;
}
.fa-react {
  color: #61dafb;
}
.fa-node-js {
  color: #339933;
}
.fa-git-alt {
  color: #f05032;
}
.fa-github {
  color: var(--text-primary);
}
.fa-npm {
  color: #cb3837;
}
.fa-figma {
  color: #f24e1e;
}
.fa-wordpress {
  color: #21759b;
}

.icon-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: center;
}

/* Section Common Styles */
.section {
  padding: 4rem 0;
}

.section h2 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.section h2::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--gradient);
  border-radius: 2px;
}

/* About Section */
#about p {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 2rem;
  max-width: 800px;
  color: var(--text-secondary);
}

.sliding-gallery {
  display: flex;
  gap: 1.5rem;
  margin-top: 3rem;
  overflow-x: auto;
  padding: 1rem 0;
  scrollbar-width: thin;
}

.sliding-gallery::-webkit-scrollbar {
  height: 8px;
}

.sliding-gallery::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.sliding-gallery img {
  width: 260px;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 5px 15px var(--shadow);
  transition: transform 0.3s;
  flex-shrink: 0;
}

.sliding-gallery img:hover {
  transform: scale(1.05);
}

/* Services Section */
#services {
  background-color: var(--bg-secondary);
}

.services-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.service-item {
  background-color: var(--bg-card);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 5px 15px var(--shadow);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}

.service-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px var(--shadow-hover);
}

.service-item h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.service-item .icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
}

.service-item p {
  color: var(--text-secondary);
}

/* Projects Section */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-top: 3rem;
}

.project-item {
  display: flex;
  gap: 2rem;
  background-color: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px var(--shadow);
  transition: transform 0.3s;
}

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

.project-item .left {
  flex: 1;
  padding: 2rem;
}

.project-item .right {
  flex: 1;
  overflow: hidden;
  min-height: 300px;
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.project-item:hover .project-image {
  transform: scale(1.05);
}

.listings {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.listings li {
  margin-bottom: 0.5rem;
}

.project-menu-container {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.read-more,
.live-demo {
  text-decoration: none;
  font-weight: 600;
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  transition: all 0.3s;
  display: inline-block;
  text-align: center;
  flex: 1;
  min-width: 150px;
}

.read-more {
  color: var(--accent);
  border: 2px solid var(--accent);
}

.read-more:hover {
  background-color: var(--accent);
  color: white;
}

.live-demo {
  background: var(--gradient);
  color: white;
  border: none;
}

.live-demo:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px var(--shadow-hover);
}

/* Contact Section */
#contact {
  background-color: var(--bg-secondary);
}

#contactContainer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
}

.form {
  background-color: var(--bg-card);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 5px 15px var(--shadow);
}

.form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form input,
.form textarea {
  width: 100%;
  padding: 0.9rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  transition: border-color 0.3s;
  font-size: 1rem;
}

.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.social-media-icons {
  background-color: var(--bg-card);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 5px 15px var(--shadow);
}

.social-media-icons h3 {
  margin-bottom: 1rem;
  color: var(--accent);
}

.icons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2rem 0;
}

.icons i {
  font-size: 1.5rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-secondary);
  border-radius: 50%;
  transition: all 0.3s;
  cursor: pointer;
  flex-shrink: 0;
}

.icons i:hover {
  background: var(--gradient);
  color: white;
  transform: translateY(-5px);
}

.downloads {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.downloads p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.picture-section {
  display: flex;
  justify-content: center;
  align-items: center;
  grid-column: span 2;
}

.picture-section img {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 15px 30px var(--shadow-hover);
}

/* Popup */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s,
    visibility 0.3s;
}

.popup.active {
  opacity: 1;
  visibility: visible;
}

.popup-content {
  background-color: var(--bg-card);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  margin: 1rem;
}

.popup-content h2 {
  margin-bottom: 1rem;
  color: var(--accent);
}

.popup-content p {
  margin-bottom: 2rem;
  color: var(--text-secondary);
}

.popup-content button {
  background: var(--gradient);
  color: white;
  border: none;
  padding: 0.9rem 2rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s;
  width: 100%;
  max-width: 200px;
}

.popup-content button:hover {
  transform: translateY(-3px);
}

/* Footer */
footer {
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-secondary);
}

/* RESPONSIVE DESIGN FIXES */
@media (max-width: 1200px) {
  .container {
    padding: 0 30px;
  }
}

@media (max-width: 992px) {
  .hero-container {
    flex-direction: column;
    text-align: center;
    gap: 3rem;
  }

  .hero-left,
  .hero-right {
    width: 100%;
  }

  .description {
    margin: 0 auto 2.5rem;
  }

  .btn-section {
    justify-content: center;
  }

  .project-item {
    flex-direction: column;
  }

  .project-item .right {
    min-height: 250px;
    order: -1;
  }

  #contactContainer {
    grid-template-columns: 1fr;
  }

  .picture-section {
    grid-column: span 1;
    margin-top: 2rem;
  }
}

@media (max-width: 768px) {
  /* Hide desktop nav on mobile */
  .desktop-nav,
  .desktop-contact {
    display: none !important;
  }

  /* Show mobile menu toggle */
  .menu-toggle {
    display: flex;
  }

  /* Show subtitle on mobile */
  .subtitle {
    display: block;
  }

  /* Adjust hero padding */
  .hero {
    padding: calc(var(--header-height) + 1rem) 0 3rem;
  }

  /* Adjust section padding */
  .section {
    padding: 3rem 0;
  }

  /* Adjust button sizes */
  .btn-primary,
  .btn-secondary {
    padding: 0.8rem 1.5rem;
    min-width: 140px;
  }

  /* Adjust project menu */
  .project-menu-container {
    flex-direction: column;
  }

  .read-more,
  .live-demo {
    width: 100%;
  }

  /* Adjust contact form */
  .form {
    padding: 1.5rem;
  }

  /* Adjust picture section */
  .picture-section img {
    width: 250px;
    height: 250px;
  }

  /* Adjust skills icons */
  .skills-container {
    gap: 1.5rem;
  }

  .icon-wrapper {
    min-width: 70px;
  }
}

@media (min-width: 769px) {
  /* Show desktop nav on larger screens */
  .desktop-nav,
  .desktop-contact {
    display: flex !important;
  }

  /* Hide mobile menu toggle */
  .menu-toggle {
    display: none !important;
  }

  /* Hide mobile menu */
  .mobile-menu {
    display: none !important;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 0 20px;
  }

  .logo h1 {
    font-size: 1.5rem;
  }

  .text-emphasis {
    font-size: 1.8rem;
  }

  .sub-heading {
    font-size: 1.2rem;
  }

  .description {
    font-size: 1rem;
  }

  .btn-section {
    flex-direction: column;
    align-items: center;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    max-width: 300px;
  }

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

  .sliding-gallery img {
    width: 250px;
  }

  .project-item .left {
    padding: 1.5rem;
  }

  .project-menu-container {
    gap: 0.5rem;
  }

  .read-more,
  .live-demo {
    padding: 0.7rem 1rem;
  }

  #contactContainer {
    gap: 1.5rem;
  }

  .form,
  .social-media-icons {
    padding: 1.5rem;
  }

  .picture-section img {
    width: 200px;
    height: 200px;
  }

  .skills-container {
    gap: 1rem;
  }

  .icon-wrapper {
    min-width: 60px;
  }

  .icon {
    font-size: 2rem;
  }
}

@media (max-width: 400px) {
  .container {
    padding: 0 15px;
  }

  .logo h1 {
    font-size: 1.3rem;
  }

  .text-emphasis {
    font-size: 1.6rem;
  }

  .btn-primary,
  .btn-secondary {
    padding: 0.7rem 1.2rem;
  }

  .sliding-gallery img {
    width: 200px;
    height: 150px;
  }

  .service-item {
    padding: 1.5rem;
  }

  .project-item .left {
    padding: 1.2rem;
  }

  .picture-section img {
    width: 180px;
    height: 180px;
  }
}
