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

:root {
  --duration: 35s;
  --totalitems: 9;
}
html,
body {
  height: auto;
  scroll-behavior: smooth;
  background-color: #ffffff;
  font-family: "Inter", "Montserrat", Arial, Helvetica, sans-serif;
  font-feature-settings: "liga" 1, "calt" 1; /* fix for Chrome */
  overflow-x: hidden;
}

section {
  scroll-margin-top: 80px; /* Adjust based on your navbar height */
}
/* Navbar styling */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #5465ff;
  padding-top: 1.4rem;
  padding-bottom: 1.4rem;
  height: auto; /* important: allow height to grow naturally */

  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  position: relative;
  transition: transform 0.6s ease, opacity 0.6s ease;
  
}

.navLeft {
  margin-left: 10%;
  font-weight: bold;
  font-size: 1.6rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.navRight {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-right: 10%;
  font-size: 1.2rem;
  font-weight: 500;
}
.navbar a {
  color: #fff;
  text-decoration: none;
}
.navbar.hidden {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  padding-top: 0;
  padding-bottom: 0;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  z-index: 20;
  position: relative;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: white;
  border-radius: 5px;
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  /* Navbar Container */
  /* Ensure navbar layout is responsive */
  .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 1rem 2rem;
    z-index: 1000;
  }

  /* Show hamburger menu only on mobile */
  .hamburger {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 1001; /* Make sure it's clickable */
    position: relative;
  }

  .hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 5px;
    transition: all 0.3s ease;
  }

  /* navRight hidden by default */
  .navRight {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #5465ff;
    flex-direction: column;
    align-items: center;
    padding: 0 1rem;
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    transition: transform 0.4s ease, opacity 0.4s ease;
    z-index: 999;
    padding-bottom: 2rem;
  }

  .navRight.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* top container styling (profile pic and intro text) */

.topContainer {
  padding: 2rem;
  border-radius: 1.5rem;
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 4rem;
  background: #f9fbff;
  font-family: "Montserrat";
  flex-wrap: wrap;
  /* for hover animation */
  border: 2px solid transparent;
}

body.lock-scroll {
  overflow: hidden;
}

.topContainer img {
  max-width: 400px;
  border: 0.2rem #0d1666 solid;
  border-radius: 100%;
}

.topContainerLeft {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.topContainerRight {
  font-size: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.topContainerRight h1 {
  font-weight: 500;
  font-size: 2.3rem;
  color: #6575ff;
}

.topContainerRight h2 {
  font-weight: 600;
  color: #2d42ff;
}

.topContainerRight h3 {
  font-size: 1.2rem;
  font-weight: 400;
  color: #000000;
}

/* Main Content Styling */

/*ABOUT ME */

.aboutContainer img {
  max-width: 400px;
}
.aboutContainer {
  max-width: 90%;
  margin-left: 5%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 5rem;
}

.aboutLeft {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 2px solid #b5b5b5;
  width: 65%;
  font-size: 1.6rem;
  line-height: 1.8;
  padding-right: 3rem;
}

.aboutLeft h1 {
  color: #5465ff;
  margin-bottom: 1rem;
}

.aboutLeft p {
  font-size: 1.4rem;
}

.aboutParagraphs {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  font-family: "Inter";
  font-weight: 300;
}

.aboutRight {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-left: 3px solid #525252;
  padding-left: 1rem;
}

.skillsContainer {
  margin: 10rem auto 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  color: #5465ff;
  font-size: 1.4rem;
}

.imgWrapper {
  position: relative;
  display: flex;
  height: 8vw;
  width: 80vw;
  overflow: hidden;
  mask-image: linear-gradient(
    to left,
    rgba(254, 254, 254, 0),
    #000 20%,
    #000 80%,
    rgba(254, 254, 254, 0)
  );
}

.img-item {
  position: absolute;
  height: inherit;
  width: 8vw;
  left: 100%;
  animation: scrollX var(--duration) linear infinite;
  animation-delay: calc(
    var(--duration) / var(--totalitems) * (var(--totalitems) - var(--i)) * -1
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes scrollX {
  to {
    left: -8vw;
  }
}
.img-item img {
  height: 100%;
  width: 100%;
  object-fit: contain;
  padding: 0.5rem;
}

/* Project section */
.projectsContainer {
  max-width: 80%;
  margin: 10rem auto 1rem auto;
  padding: 2rem;
  font-family: "Montserrat";
}
.projectsContainer h1 {
  text-align: center;
  color: #5465ff;
  margin-bottom: 0.5rem;
  font-size: 2rem;
}
.projectCard {
  background-color: #f5f7ff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  transition: box-shadow 0.3s ease;
}

.projectCard:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

.projectCard img {
  width: 100%;
  max-height: 300px;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.projectCard h3 {
  margin-bottom: 1rem;
  color: #2d42ff;
}

.projectDetails {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.2s ease, opacity 0.2s ease, padding-top 0.2s ease;
  padding-top: 0;
  margin-top: 1rem;
  font-size: 1rem;
  color: #333;
  line-height: 1.8rem;
}

.projectDetails.show {
  max-height: 700px; /* or larger if your content needs it */
  opacity: 1;
  padding-top: 1rem;
}
.hideShowBtn {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background-color: #5465ff;
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

.hideShowBtn:hover {
  background-color: #364aff;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  align-items: start;
}

/* Projects Section Cont. (Hidden Cards) */
.hiddenProjects {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.6s ease, opacity 0.6s ease;
}

.hiddenProjects.show {
  max-height: 2000px;
  opacity: 1;
}

.toggleExtraBtn {
  display: block;
  margin: 2rem auto;
  padding: 0.75rem 1.5rem;
  background-color: #ffc400;
  color: #000000;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.toggleExtraBtn:hover {
  background-color: #ffa600;
  transform: translateY(-2px);
}

/* Experience Section */
.expContainer {
  max-width: 80%;
  margin: 1rem auto;
  padding: 1rem;
  font-family: "Montserrat", sans-serif;
}

.expContainer h1 {
  text-align: center;
  color: #5465ff;
  margin-bottom: 0.5rem;
  font-size: 2rem;
}
.expCard h2 {
  color: #5465ff;
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
}

.expCard h3 {
  font-size: 1.1rem;
  font-weight: 500;
  color: #333;
  margin: 0.2rem 0;
}

.expCard ul {
  margin-top: 1rem;
  padding-left: 1.2rem;
  list-style-type: disc;
}

.expCard li {
  margin-bottom: 0.6rem;
  line-height: 1.5;
  color: #333;
  font-size: 1.4rem;
}

.expContainer > p {
  text-align: center;
  font-size: 1.1rem;
  color: #444;
  margin-bottom: 2rem;
}

.downloadBtn {
  display: block;
  margin: 0 auto 0 auto;
  padding: 0.75rem 1.5rem;
  background-color: #5465ff;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.openNewTab {
  display: grid;
  margin: 0 auto 2rem auto;
  align-items: center;
  justify-content: center;
}
.downloadBtn:hover {
  background-color: #364aff;
  transform: translateY(-2px);
}

#openNewTab {
  margin-bottom: 0;
  margin-top: 0;
}

#or {
  margin-bottom: 0.5rem;
  margin-top: 0.5rem;
}
/* Base styling for each experience card */
.expCard {
  display: flex;
  flex-direction: column;
  background-color: #f5f7ff; /* semi-transparent white */
  padding: 3rem 4rem 3rem 4rem;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  margin: 4rem 0;
  width: 60%;
}

/* Alternate left/right layout */
.expCard:nth-child(even) {
  margin-left: auto;
}

.expCard:nth-child(odd) {
  margin-right: auto;
}

@media (max-width: 768px) {
  .expCard {
    width: 100%;
    margin: 1rem 0 !important;
    padding: 1.5rem; /* shrink padding too so text doesn’t look cramped */
  }

  .expCard h2 {
    font-size: 1.1rem; /* company name */
  }

  .expCard h3 {
    font-size: 0.95rem; /* job title + dates */
  }

  .expCard li {
    font-size: 1rem;   /* bullet points */
    line-height: 1.4;
  }

  .expContainer > p {
    font-size: 1rem;
  }
}

/* Animate them on scroll later */

/* Contact Section */
.contactContainer {
  max-width: 80%;
  margin: 6rem auto;
  padding: 2rem;
  background-color: #f5f7ff;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  font-family: "Montserrat", sans-serif;
  color: #333;
}

.contactContainer h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #2d42ff;
}
.contactSubheading {
  font-size: 1.2rem;
  font-weight: 500;
  margin-top: 2rem;
  color: #333;
  text-align: center;
}

form#contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

form#contact-form input,
form#contact-form textarea {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #ccc;
  font-size: 1rem;
  font-family: "Inter", sans-serif;
}

form#contact-form button {
  padding: 0.75rem 1rem;
  background-color: #5465ff;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

form#contact-form button:hover {
  background-color: #364aff;
}

.socialLinks {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.socialLinks a {
  text-decoration: none;
  color: #5465ff;
  font-weight: 600;
  transition: color 0.3s ease;
}

.socialLinks a:hover {
  color: #2d42ff;
}

.footer {
  background: #5465ff;
  padding-top: 2rem;
  padding-bottom: 2rem;
  display: grid;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 1.2rem;
}

#backToTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  padding: 0.75rem 1.2rem;
  font-size: 1rem;
  background-color: #5465ff;
  color: white;
  border: none;
  border-radius: 2rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);

  /* Icon + text alignment */
  display: flex;
  align-items: center;
  gap: 0.5rem;

  /* Fade-in/out visibility control */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.2s ease;
}

/* Show class added by JS */
#backToTopBtn.show {
  opacity: 1;
  visibility: visible;
}

/* Optional hover effect */
#backToTopBtn:hover {
  background-color: #364aff;
  transform: translateY(-2px);
}

#backToTopBtn i {
  width: 20px;
  height: 20px;
}

/* responsiveness jazz */

/* about section responsive */
@media (max-width: 768px) {
  .aboutContainer {
    flex-direction: column;
    align-items: center;
  }

  .aboutLeft,
  .aboutRight {
    width: 100%;
    padding: 0;
    border: none;
    text-align: center;
  }

  .aboutLeft {
    padding-bottom: 2rem;
  }

  .aboutParagraphs {
    align-items: center;
  }

  .aboutRight img {
    max-width: 80%;
  }
}

@media (max-width: 768px) {
  .imgWrapper {
    height: 60px; /* smaller height for mobile */
    width: 90vw;
  }

  .img-item {
    width: 60px;
  }

  .skillsContainer {
    font-size: 1rem;
  }
}
@media (max-width: 768px) {
  .projectsContainer {
    max-width: 100%;
    padding: 1rem;
    margin: 3rem auto;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    margin: 0 auto;
  }

  .projectCard {
    margin: 0 auto 2rem auto;
    width: 100%;
    max-width: 90%;
  }
}
@media (max-width: 768px) {
  .topContainer img {
    max-width: 200px;
    width: 100%;
    height: auto;
    margin: 0 auto;
  }

  .topContainer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
  }

  .topContainerRight {
    font-size: 1.5rem;
  }

  .topContainerRight h1 {
    font-size: 2rem;
  }

  .topContainerRight h2 {
    font-size: 1.6rem;
  }

  .topContainerRight h3 {
    font-size: 1.1rem;
  }
}

/* for intersection observer */
@keyframes bounceInLeft {
  0% {
    opacity: 0;
    transform: translateX(-100px);
  }
  60% {
    opacity: 1;
    transform: translateX(20px);
  }
  80% {
    transform: translateX(-5px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Prepare cards to animate in */
.projectCard {
  opacity: 0;
  transform: translateX(-50px);
}

/* This gets added when card is in view */
.projectCard.animate-in {
  animation: bounceInLeft 0.8s ease forwards;
}

/* slide animation for exp section */
/* Slide and fade in animation for experience cards */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.expCard {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.expCard.animate-in {
  animation: fadeSlideIn 0.6s ease forwards;
}

/*Custom Scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #e3e6eb; /* Light background */
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background-color: #5465ff; /* Your theme color */
  border-radius: 10px;
  border: 3px solid #e3e6eb; /* Creates padding around the thumb */
}

::-webkit-scrollbar-thumb:hover {
  background-color: #2d42ff;
}

/* Toast Messages */
#toastContainer {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  background-color: #5465ff;
  color: white;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: fadeInOut 3s ease forwards;
  text-align: center;
}

.toast.success {
  background-color: #28a745;
}

.toast.error {
  background-color: #dc3545;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  10% {
    opacity: 1;
    transform: translateY(0);
  }
  90% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px);
  }
}

#alternatively {
  font-size: 1rem;
  color: #4e59be;
}

.navbar a {
  position: relative;
  color: #fff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.navbar a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background-color: #fff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.navbar a:hover {
  color: #ffc400; /* Slight color accent on hover */
}

.navbar a:hover::after {
  transform: scaleX(1); /* Slide in underline */
}
