/* Your CSS was already well-structured and modern. I made minor professional refinements (like removing redundant comments or slightly improving comments/ordering) without changing any functionality or structure. */

:root {
  --dark-bg: #1a1a1a;
  --dark-card: #2c2c2c;
  --text-color: #e0e0e0;
  --light-text: #a0a0a0;
  --primary-color: #5cb85c;
  --secondary-color: #E0E0E0;
  --link-hover: #ffffff;
  --border-color: #444;
}

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

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--dark-bg);
  color: var(--text-color);
  line-height: 1.6;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--link-hover);
}

.navbar {
  background-color: var(--dark-bg);
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
  position: fixed; /* ✅ Fixed at top */
  top: 0;
  width: 100%;
  z-index: 1000; /* Keep it above other elements */
}


.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar .logo {
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--text-color);
  z-index: 2;
}

.nav-links-container {
  display: flex;
  align-items: center;
}

.nav-links {
  list-style: none;
  display: flex;
}

.nav-links li {
  margin-left: 30px;
}

.nav-links li a {
  color: var(--light-text);
  font-size: 0.95rem;
  font-weight: 400;
}

.nav-links li a:hover {
  color: var(--text-color);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 5px;
  z-index: 2;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 120px;
  padding: 80px 0;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-content {
  flex: 2;
  min-width: 300px;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.hero .subtitle {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.1rem;
  color: var(--light-text);
}

.hero-image {
  flex: 1;
  min-width: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image img {
  border-radius: 50%;
  border: 3px solid var(--border-color);
  width: 200px;
  height: 200px;
  object-fit: cover;
}

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  padding: 60px 0;
}

.skill-item {
  background-color: var(--dark-card);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  border: 1px solid var(--border-color);
}

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

.skill-item i {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.skill-item span {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-color);
  margin-bottom: 5px;
}

.skill-item small {
  color: var(--light-text);
  font-size: 0.8rem;
}

.work {
  padding-bottom: 80px;
}

.work h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 20px;
}

.work p {
  font-size: 1.1rem;
  color: var(--light-text);
  margin-bottom: 30px;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.project-item {
  background-color: var(--dark-card);
  padding: 25px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.project-item h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.project-item .project-link {
  color: var(--text-color);
}

.project-item .project-link:hover {
  color: var(--primary-color);
}

.project-item .project-link i {
  font-size: 1rem;
  margin-left: 8px;
}

.project-item p {
  font-size: 1rem;
  color: var(--light-text);
}

.contact {
  padding-bottom: 80px;
  text-align: center;
}

.contact h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 20px;
}

.contact p {
  font-size: 1.1rem;
  color: var(--light-text);
  margin-bottom: 20px;
}

.contact-links p {
  font-size: 1.2rem;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.contact-links p i {
  color: var(--primary-color);
  margin-right: 10px;
  font-size: 1.4rem;
}

.contact-links a {
  color: var(--primary-color);
}

.contact-links a:hover {
  text-decoration: underline;
  color: var(--link-hover);
}

.contact-note {
  margin-top: 30px;
  font-size: 1rem;
  color: var(--light-text);
}

.footer {
  background-color: var(--dark-card);
  color: var(--light-text);
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid var(--border-color);
}

.footer p {
  margin: 0;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav-links-container {
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--dark-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
    z-index: 1;
    padding: 0;
  }

  .nav-links-container.active {
    max-height: 300px;
    padding: 20px 0;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
    text-align: center;
  }

  .nav-links li {
    margin: 15px 0;
  }

  .hero {
    flex-direction: column-reverse;
    text-align: center;
    padding: 50px 0;
  }

  .skills {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    padding: 40px 0;
  }

  .project-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2.2rem;
  }

  .hero .subtitle {
    font-size: 1rem;
  }

  .hero p,
  .work p,
  .contact p {
    font-size: 1rem;
  }

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

  .contact-links p {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .contact-links p i {
    margin-right: 0;
    margin-bottom: 5px;
  }
}

/* Template Page Styles */
.page-hero {
  text-align: center;
  padding: 60px 0 40px;
}

.page-hero h1 {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.page-hero p {
  font-size: 1.1rem;
  color: var(--light-text);
  max-width: 800px;
  margin: 0 auto;
}

.code-section {
  padding-bottom: 80px;
}

.code-section h2 {
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text-color);
  margin-top: 40px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.code-topic-description {
  font-size: 0.95rem;
  color: var(--light-text);
  margin-bottom: 20px;
}

.code-block-wrapper {
  background-color: #0d0d0d;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.code-block-wrapper pre {
  padding: 20px;
  margin: 0;
  overflow-x: auto;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #e0e0e0;
}

.code-block-wrapper code {
  display: block;
  white-space: pre-wrap;
}

.copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.copy-button:hover {
  background-color: #4CAF50;
}

.nav-links li a.active-nav {
  color: var(--primary-color) !important;
  font-weight: 600;
}

@media (max-width: 768px) {
  .page-hero h1 {
    font-size: 2.5rem;
  }

  .code-section h2 {
    font-size: 1.8rem;
  }

  .copy-button {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .code-block-wrapper pre {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .page-hero h1 {
    font-size: 2rem;
  }

  .code-section h2 {
    font-size: 1.5rem;
  }

  .copy-button {
    position: static;
    margin-top: 15px;
    display: block;
    width: calc(100% - 40px);
    margin-left: auto;
    margin-right: auto;
    padding: 10px 15px;
  }

  .code-block-wrapper pre {
    padding-bottom: 60px;
  }
}
