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

:root {
  --primary-color: #4f46e5;
  --secondary-color: #818cf8;
  --text-color: #1f2937;
  --light-text: #6b7280;
  --background: #f9fafb;
  --card-background: #ffffff;
  --dark-background: #111827;
  --dark-card: #1f2937;
  --contact-accent: #2353e6;
  --contact-accent-dark: #7ea2ff;
  /* popup colors for light theme */
  --popup-bg: var(--card-background); /* white card background */
  --popup-text: var(--text-color); /* dark text */
}

[data-theme="dark"] {
  --primary-color: #818cf8;
  --secondary-color: #4f46e5;
  --text-color: #f9fafb;
  --light-text: #d1d5db;
  --background: #111827;
  --card-background: #1f2937;
  --contact-accent: #7ea2ff;
  --contact-accent-dark: #2353e6;
  /* popup colors for dark theme */
  --popup-bg: var(--dark-card); /* dark card background */
  --popup-text: var(--text-color); /* light text */
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background);
  transition: background-color 0.3s, color 0.3s;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
  transition: background 0.3s ease;
}

.navbar.scrolled {
  background: var(--card-background);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--secondary-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

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

/* Theme Toggle Button Styles */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  font-size: 1.2rem;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
  margin-left: 0.5rem;
}

.theme-toggle:hover {
  color: var(--primary-color);
}

.theme-toggle .fa-sun {
  display: none;
}

.theme-toggle .fa-moon {
  display: block;
}

[data-theme="dark"] .theme-toggle .fa-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .fa-moon {
  display: none;
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-menu-btn span {
  display: block;
  width: 25px;
  height: 2px;
  background-color: var(--text-color);
  transition: 0.3s;
}

/* Hero Section */
.hero {
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 2rem;
  text-align: center;
}

.gradient-text {
  font-size: 4rem;
  font-weight: bold;
  margin-bottom: 0.3rem;
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--secondary-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}

.hero p {
  font-size: 1.5rem;
  color: var(--light-text);
  margin-bottom: 2rem;
}

.cta-button {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  background: var(--primary-color);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
}

.cta-button:hover {
  transform: translateY(-2px);
  background: var(--secondary-color);
}

.typer.typewriter-effect {
  font-size: 4rem;
  font-weight: bold;
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--secondary-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  text-align: center;
  display: block;
  margin-bottom: 1.5rem;
  white-space: nowrap;
}

.typer-text {
  border-right: 2px solid var(--primary-color);
  animation: blink-cursor 0.8s steps(1) infinite;
}

@keyframes blink-cursor {
  0%,
  100% {
    border-color: var(--primary-color);
  }

  50% {
    border-color: transparent;
  }
}

/* About Section */
.about {
  padding: 6rem 2rem;
  background-color: var(--background);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

h2 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 1rem;
}

.section-divider {
  width: 60px;
  height: 4px;
  background: var(--primary-color);
  margin: 0 auto 3rem;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: var(--light-text);
}

.about-text h3 {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.about-text a {
  text-decoration: none;
  color: var(--primary-color);
  transition: color 0.2s;
}

.about-text a:hover {
  color: var(--secondary-color);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.skill-card {
  background: var(--card-background);
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

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

.skill-card h3 {
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.skill-card ul {
  list-style: none;
  padding-left: 0;
}

.skill-card li {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.skill-card li::before {
  content: none;
}

.skill-card li i {
  margin-right: 0.5rem;
  font-size: 1.2em;
}

/* Projects Section */
.projects {
  padding: 6rem 2rem;
  background-color: var(--card-background);
}

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

.project-card {
  background: var(--card-background);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, border-color 0.3s;
  border: 2px solid var(--project-card-border, #e0e0e0);
}

[data-theme="dark"] .project-card {
  border-color: rgba(255, 255, 255, 0.18);
}

.project-card:hover {
  transform: translateY(-10px);
}

.project-image {
  height: 200px;
  background: linear-gradient(
    45deg,
    var(--primary-color),
    var(--secondary-color)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
}

.project-image h3 {
  color: white;
  font-size: 1.5rem;
}

.project-content {
  padding: 1.5rem;
}

.project-content h3 {
  margin-top: 1rem;
  margin-bottom: 0.7rem;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary-color);
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tech-stack span {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
}

.project-link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 25px;
  transition: background 0.3s ease;
}

.project-link:hover {
  background: var(--secondary-color);
}

/* Contact Section */
.contact {
  position: relative;
  overflow: hidden;
  padding: 0 2rem 2rem 2rem;
  background-color: var(--background);
  transform: translateZ(0);
  isolation: isolate;
}

#contact-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.contact .container {
  position: relative;
  z-index: 1;
  transform: translateZ(0);
}

.contact-intro {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3rem;
  color: var(--light-text);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-top: 2.5rem;
}

.contact-card {
  display: flex;
  background: var(--card-background);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin: 2.5rem 0 2rem 0;
  align-items: stretch;
}

.contact-image {
  flex: 0 0 220px;
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  border-right: 1px solid var(--light-text);
}

.contact-image img {
  width: 100%;
  max-width: 180px;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.contact-content {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
  padding: 2rem 2rem 2rem 2rem;
}

.contact-info {
  margin-bottom: 0;
  background: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}

.contact-info h3 {
  color: var(--primary-color);
  margin-bottom: 1.2rem;
  font-size: 1.2rem;
}

.contact-info p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.contact-info a {
  color: var(--primary-color);
  text-decoration: none;
  word-break: break-all;
}

.contact-form {
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--card-background);
  padding: 2rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--primary-color);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--light-text);
  border-radius: 6px;
  font-size: 1rem;
  background-color: var(--card-background);
  color: var(--text-color);
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.submit-button {
  width: 100%;
  padding: 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
  margin-top: 0.5rem;
}

.submit-button:hover {
  background: var(--secondary-color);
}

/* Social Links */
.social-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 3rem;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  font-size: 1.5rem;
  transition: transform 0.3s ease, background 0.3s ease;
}

.social-icon:hover {
  transform: translateY(-5px);
  background: var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 900px) {
  .nav-content {
    padding: 1rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-background);
    flex-direction: column;
    gap: 1.2rem;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    z-index: 999;
    align-items: center;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-link {
    text-align: center;
    width: 100%;
    padding: 0.5rem 0;
  }

  .theme-toggle {
    margin: 0.5rem 0;
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .mobile-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-left: 1rem;
    z-index: 1001;
  }

  .mobile-menu-btn span {
    display: block;
    width: 28px;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: 0.3s;
  }

  /* Hamburger animation when active */
  .mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  .mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  .hero-content {
    padding: 1.5rem 1rem;
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .project-card {
    margin-bottom: 1.5rem;
  }

  .contact-form-modern,
  .contact-form {
    padding: 1.2rem 0.5rem;
  }

  .contact-title,
  .typer.typewriter-effect {
    font-size: 2.2rem;
  }
}

@media (max-width: 700px) {
  .navbar {
    padding: 0.5rem 0;
  }

  .nav-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
  }

  .logo {
    margin-bottom: 0;
  }

  .nav-links {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    align-items: flex-start;
  }

  .mobile-menu-btn {
    display: flex;
    margin-left: auto;
    padding: 8px;
  }

  .hero-content {
    padding: 1rem 0.5rem;
  }

  .gradient-text {
    font-size: 2.5rem;
  }

  .typer.typewriter-effect {
    font-size: 2.5rem;
  }

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

  .contact-title {
    font-size: 1.5rem;
  }

  .about,
  .projects,
  .contact {
    padding: 2rem 0.5rem;
  }

  .container {
    padding: 0 0.5rem;
  }

  .project-image {
    margin-bottom: 0;
  }

  .project-content h3 {
    margin-top: 0.7rem;
    font-size: 1.1rem;
  }

  .social-links,
  .social-links-modern {
    gap: 1.2rem;
  }

  .form-row {
    flex-direction: column;
    gap: 1rem;
  }

  .contact-form-modern {
    max-width: 100%;
  }

  .contact-email {
    font-size: 1.5rem;
  }
}

@media (max-width: 500px) {
  .hero-content {
    padding: 0.5rem 0.2rem;
  }

  .gradient-text {
    font-size: 2rem;
  }

  .typer.typewriter-effect {
    font-size: 2rem;
  }

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

  .gradient-text,
  .contact-title {
    font-size: 1.1rem;
  }

  .cta-button,
  .submit-button,
  .submit-button-modern {
    font-size: 0.95rem;
    padding: 0.7rem 1.2rem;
  }

  .project-content {
    padding: 1rem 0.5rem;
  }

  .contact-form-modern,
  .contact-form {
    padding: 0.7rem 0.2rem;
  }

  .contact-email {
    font-size: 1.2rem;
  }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  /* Remove this entire block */
}

.contact-title {
  text-align: center;
  font-size: 2.7rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -1px;
}

.contact-email {
  display: block;
  text-align: center;
  font-size: 2rem;
  font-weight: 600;
  color: var(--contact-accent);
  margin-bottom: 0.3rem;
  text-decoration: none;
  word-break: break-all;
}

.contact-email:hover {
  text-decoration: underline;
}

.contact-desc {
  text-align: center;
  color: var(--light-text);
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}

.contact-form-modern {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: none;
  box-shadow: none;
  padding: 0;
}

.form-row {
  display: flex;
  gap: 2rem;
}

.form-group-modern {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group-modern label {
  font-size: 1rem;
  color: var(--contact-accent);
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.form-group-modern input,
.form-group-modern textarea {
  border: none;
  border-bottom: 2px solid var(--contact-accent);
  border-radius: 0;
  background: transparent;
  font-size: 1.1rem;
  padding: 0.5rem 0 0.3rem 0;
  color: var(--text-color);
  transition: border-color 0.3s;
  resize: none;
}

.form-group-modern input:focus,
.form-group-modern textarea:focus {
  outline: none;
  border-bottom: 2px solid var(--contact-accent-dark);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.submit-button-modern {
  padding: 0.7rem 2.2rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--contact-accent);
  background: transparent;
  border: 2px solid var(--contact-accent);
  border-radius: 2rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.submit-button-modern:hover {
  background: var(--contact-accent);
  color: #fff;
}

.social-links-modern {
  display: flex;
  justify-content: center;
  gap: 2.2rem;
  margin-top: 2.5rem;
}

.social-links-modern .social-icon {
  color: var(--contact-accent);
  background: none;
  font-size: 1.6rem;
  transition: color 0.2s;
  text-decoration: none;
}

.social-links-modern .social-icon:hover {
  color: var(--contact-accent-dark);
  text-decoration: none;
}

@media (max-width: 700px) {
  .form-row {
    flex-direction: column;
    gap: 1rem;
  }

  .contact-form-modern {
    max-width: 100%;
  }
}

.contact-top-image {
  display: block;
  margin: 0 auto -1.1rem auto;
  max-width: 130px;
  width: 100%;
  height: auto;
}

.navbar-logo {
  height: 42px;
  width: auto;
  display: block;
}

/* new */
/* Popup Container */
#maintenance-popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  width: 90%;
  max-width: 400px;
  text-align: center;
}

/* Popup Content */
#maintenance-popup .popup-content {
  position: relative; /* makes close button position relative */
  background-color: var(--popup-bg, white); /* supports light/dark toggle */
  color: var(--popup-text, black);
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

/* Close Button */
#maintenance-popup .close-btn {
  position: absolute;
  top: 10px;
  right: 10px; /* top-right corner */
  font-size: 1.5rem;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--popup-text); /* matches light/dark mode */
}

/* Maintenance Buttons */
.maintenance-btn {
  border: none; /* remove button border */
  outline: none; /* remove focus outline */
  cursor: pointer; /* pointer on hover */
  background: var(--primary-color); /* same as other project links */
  color: white; /* match text color */
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-size: 1rem;
  transition: background 0.3s ease;
}

.maintenance-btn:hover {
  background: var(--secondary-color);
}

/* Modified to remove card look and fix padding */
.achievement-container {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding-bottom: 2rem; /* Added bottom padding here */
  background: transparent;
  border: none;
}

.achievement-icon {
  font-size: 2.5rem;
  color: #ffd700; /* Gold color for trophy */
  min-width: 60px;
  text-align: center;
  padding-top: 5px;
}

.achievement-content h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.achievement-meta {
  color: #aaa;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  font-family: monospace;
}

@media (max-width: 768px) {
  .achievement-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
