/* === RESET STYLES === */
:root {
  --scrollbar-width: 16px; /* Approx for Windows; macOS may hide it but this ensures consistency */
}

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

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Montserrat', sans-serif;
  background-color: #ffffff;
  color: #333;
  overflow-x: hidden;
}

/* === HEADER SECTION (Hero) === */
header#home {
  width: 100vw;
  height: 100vh;
  background-image: url('./assets/YNPBackgrounds.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
  position: relative;
  z-index: 1;
}

header#home > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

header#home h1 {
  font-size: 3rem;
}

header#home p {
  font-size: 1.5rem;
}

/* === TYPING EFFECT === */
#typed {
  font-size: 3rem;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  display: inline-block;
  padding-left: 1rem;
  padding-right: 1rem;
  max-width: 100%;
  z-index: 2;
  border-right: 2px solid transparent;
  opacity: 0;                 /* Start fully invisible */
  pointer-events: none;
  visibility: hidden;         /* Prevent blinking */
  transition: opacity 0.4s ease-in-out, visibility 0s 0.4s;
}

body.loaded #typed {
  opacity: 1;                 /* Fade in with delay match */
  visibility: visible;
  pointer-events: auto;
  border-right: 2px solid white;
  transition-delay: 0.2s; /* Sync with startDelay: 200ms */
}


/* Hide source strings used by Typed.js */
#typed-strings {
  display: none;
}

/* Remove cursor after done */
#typed.done-typing {
  border-right: none !important;
}

#typed.done-typing + .typed-cursor {
  display: none !important;
}

/* Cursor animation */
.typed-cursor {
  font-size: 3rem;
  color: white;
  animation: blink-caret 0.8s step-end infinite;
}

@keyframes blink-caret {
  0%, 100% { border-color: transparent; }
  50% { border-color: white; }
}

/* Optional: Render workaround (keeps text sharp in some browsers) */
@keyframes typing-glitch-fix {
  0% {
    transform: translateZ(0);
  }
}

/* === MOBILE STYLES === */
@media (max-width: 768px) {
  #typed {
    font-size: 2rem;
    padding-left: 2rem;
    padding-right: 2rem;
    text-align: center;
  }

  .typed-cursor {
    font-size: 2rem;
  }
}


/* === NAVBAR STYLING === */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0; /* Ensures it doesn't exceed viewport */
  width: 100%;
  height: 60px;
  background-color: #0B318F;
  /*padding: 1rem 0;*/
  z-index: 1000;
  display: flex;
    justify-content: center; /* Center nav-content */
  /*justify-content: space-between;*/
  align-items: center;
  transition: background-color 0.3s ease;
    box-sizing: border-box;
    overflow-x: hidden; /* Prevents horizontal overflow on small screens */
}

.nav-content {
  width: calc(100% - var(--scrollbar-width, 0px)); /* Subtract scrollbar width */
  max-width: 1280px;
    margin: 0 auto;         /* ✅ Horizontally center the container */
    padding: 0 2rem;
      display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.desktop-nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
  margin-right: 2rem;
  justify-content: flex-end;
}

.desktop-nav a {
  color: white;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active {
  color: #CC0000;
}
.navbar.scrolled {
  background-color: #0B318F;
}
/* === HAMBURGER MENU === */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 24px;
  cursor: pointer;
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  z-index: 1103;
}

.menu-toggle span {
  height: 4px;
  width: 100%;
  background-color: #CC0000;
  border-radius: 2px;
  transition: all 0.4s ease;
  transform-origin: center;
}

.menu-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translateY(10px);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translateY(-10px);
}

/* === DROPDOWN MENU === */
.dropdown-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  background-color: #0B318F;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  z-index: 1100;
  pointer-events: none;
}

/* Active menu state (slide-in) */
.dropdown-menu.active {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* Closing state for animation */
.dropdown-menu.closing {
  transform: translateX(100%);
  opacity: 0;
}

.dropdown-menu a {
  color: white;
  font-size: 1.5rem;
  margin: 1rem 0;
  text-decoration: none;
  transition: color 0.3s ease;
}

.dropdown-menu a:hover {
  color: #CC0000;
}
#about, #skills, #experience, #projects, #contact {
  scroll-margin-top: 60px; /* Adjust based on your navbar height */
}
/* === RESPONSIVE RULES === */
@media (max-width: 768px) {
  .navbar{
    background-color: transparent;
  }
  .menu-toggle {
    display: flex;
  }

  .desktop-nav {
    display: none;
  }

  .close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    color: white;
    cursor: pointer;
  }

  /* Let JS control visibility on mobile */
  .dropdown-menu {
    display: flex;
  }
   .dropdown-menu.active {
    pointer-events: auto;
  }

}

@media (min-width: 769px) {
  .menu-toggle {
    display: none;
  }

  /* Keep hidden on desktop view */
  .dropdown-menu {
    display: none !important;
  }

  .desktop-nav {
    display: flex;
  }
}

/* === Utility: Prevent scroll when menu is open === */
body.no-scroll {
  overflow: hidden;
}



/* === MAIN SECTION === */
main {
  background-color: #ffffff;
  padding-top: 0;
}

/* === SECTION STYLING === */
section {
  padding: 2rem;
  max-width: 1200px;
  margin: auto;
}

section > div {
  padding: 0;
  margin: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
}

h2 {
  color: #2c3e50;
  margin-bottom: 1rem;
}

a {
  color: #2980b9;
}

.social-links {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding-inline: calc(var(--scrollbar-width, 0px) / 2);
  min-height: 3rem; /* Prevent layout shift by reserving height */
    box-sizing: border-box;

}

/* Optional: Consistent icon container sizing */
.social-links a {
  font-size: 2rem;
  color: white;
  transition: transform 0.3s ease, color 0.3s ease;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  min-height: 3rem;
}

/* Hover animation */
.social-links a:hover {
  color: #2980b9;
  transform: scale(1.2);
}

/* Fixed position version for floating icons */
.social-links.fixed {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

#home .social-links {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding-inline: calc(var(--scrollbar-width, 0px) / 2);
  min-height: 3rem;         /* Lock vertical space */
  height: 3rem;             /* 👈 Add fixed height to lock layout */
  box-sizing: border-box;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0s 0.3s; /* Prevent jump on preload removal */
}

body.loaded #home .social-links{
  visibility: visible;
  opacity:1;
}
/* === CONTACT SECTION === */
#contact h2 {
  text-align: center;
}

#contact {
  color: navy;
  margin-bottom: 0;
  padding-bottom: 0;
}

#contact a {
  color: navy;
}

#contact a:hover {
  color: #000080;
}

#contact .bx {
  color: navy;
}

/* About Section Styling */
#about {
  padding: 2rem;
  max-width: 1200px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #fff;
}

/* Flex layout for content */
.about-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  width: 100%;
}

/* Profile Container */
#about .profile-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem auto;
}

/* Profile Picture Styling */
.profile-picture {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

/* About Text Styling */
.about-description {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 600px;
  text-align: left;
  color: #333;
}

#about .about-description p {
  font-size: 1.2rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* About Heading */
#about h2 {
  color: #0B318F;
  font-size: 2rem;
  margin-right: auto;
  margin-bottom: 1rem;
}

/* Desktop Layout: Two-column */
@media (min-width: 769px) {
  .about-content {
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
  }

  #about .profile-container {
    flex: 0 0 200px;
    margin: 0;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .profile-picture {
    margin: 0;
  }

  .about-description {
    flex: 1;
  }
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
  .about-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-picture {
    width: 200px;
    height: 200px;
    margin-bottom: 1rem;
  }

  .about-description {
    font-size: 1rem;
    text-align: center;
  }

  #about h2 {
    margin: auto;
  }
}


/* === SKILLS SECTION === */
#skills {
  padding: 2rem;
  max-width: 1200px; /* Match the experience section width */
  margin: auto;
}

/* Skills Grid: Fix alignment and reduce spacing */
.skills-grid {
  display: grid;
  gap: 5px; /* Reduced gap for tighter spacing */
  justify-content: start; /* Align to the left */
  padding-bottom: 50px;
  align-items: stretch;
  background-color: white;
  width: 100%; /* Full width within the parent */
  grid-auto-rows: 1fr; /* Ensures uniform height for all items */
  box-sizing: border-box;
}

/* Icon Box Styling */
.icon-box {
  background-color: navy;
  color: white;
  border-radius: 10px;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: auto;
  width: 100%;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
}

.icon-box:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.icon img {
  width: 30px;
  height: 32px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.icon-box h4 {
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0;
  color: white;
}

/* Desktop Specific Adjustment: Fixed horizontal gap */
@media (min-width: 1046px) {
  .skills-grid {
    grid-template-columns: repeat(8, 1fr); /* Medium-sized screen layout */
    column-gap: 5px; /* Reduced horizontal gap */
    row-gap: 5px; /* Reduced vertical gap */
  }
}

@media (min-width: 768px) and (max-width: 1045px) {
  .skills-grid {
    grid-template-columns: repeat(4, 1fr); /* Medium-sized screen layout */
    column-gap: 5px; /* Reduced horizontal gap */
    row-gap: 5px; /* Reduced vertical gap */
  }
}

@media (min-width: 261px) and (max-width: 767px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr); /* Adjusted for smaller screens */
    column-gap: 5px; /* Reduced horizontal gap */
    row-gap: 5px; /* Reduced vertical gap */
    margin: auto;
  }
}

@media (max-width: 260px) {
  .skills-grid {
    grid-template-columns: 1fr;
    column-gap: 5px; /* Reduced horizontal gap */
    row-gap: 5px; /* Reduced vertical gap */
    margin: auto;
  }
}

/* Ensuring consistent height and width */
.icon-box {
  min-height: 120px;
  max-width: 160px;
}

/* Skills Header */
#skills h2 {
  color: #0B318F;
  font-size: 2rem;
  margin-left: 0; /* Align with experience heading */
  margin-bottom: 1rem;

}

/* === EXPERIENCE & PROJECT SECTION === */
#experience, #projects {
  padding: 2rem;
  max-width: 1200px;
  margin: auto;
}

#experience h2, #projects h2 {
  color: #0B318F;
  font-size: 2rem;
  margin-left: 0; /* Align headers to the left */
}


.experience-grid, .project-grid {
  display: grid;
  column-gap: 15px; /* Reduced horizontal gap */
  row-gap: 20px; /* Reduced vertical gap */
  justify-content: center;
  padding-bottom: 50px;
  align-items: stretch;
  background-color: transparent;
}

/* Box Styling */
.experience-box, .project-box {
  background-color: navy;
  color: white;
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); */
  width: 100%;
  min-height: 400px; /* Increased height for better image fit */
  text-align: center;
}

/* Remove the unwanted black background */
.experience-grid, .project-grid {
  background: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

/* Hover Effect */
/*.experience-box:hover, .project-box:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}*/

/* Text Styling */
.experience-box h4, .project-box h4 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0.5rem 0;
  color: white;
}

.experience-box p, .project-box p {
  font-size: 1rem;
  margin: 0.25rem 0;
  color: white;
}

/* Image Styling for Project Boxes */
.project-box .icon img {  
  width: 100%;         /* Make image take the full width of the box */
  height: auto;        /* Maintain the original aspect ratio */
  object-fit: contain; /* Ensure the entire image fits without cropping */
  max-height: 200px;   /* Limit height for better presentation */
  margin: 0.5rem 0;
  border-radius: 5px;
}
/* Image Styling for Experience Boxes */
.experience-box .icon img {  
  width: 100%;         /* Make image take the full width of the box */
  height: auto;        /* Maintain the original aspect ratio */
  object-fit: contain; /* Ensure the entire image fits without cropping */
  max-height: 200px;   /* Limit height for better presentation */
  margin: 0.5rem 0;
  border-radius: 5px;
}
/* Bulllet Points */
.experience-box ul, .project-box ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin: 0.5rem 0;
  text-align: left;
}

.experience-box li, .project-box li {
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

/* Responsive Grid Layout */
@media (min-width: 992px) {
  .experience-grid, .project-grid {
    grid-template-columns: auto;
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .experience-grid, .project-grid {
    grid-template-columns: auto;
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 261px) and (max-width: 767px) {
  .experience-grid, .project-grid {
    grid-template-columns: 1fr;
    margin: auto;
    column-gap: 15px; /* Reduced horizontal gap */
    row-gap: 25px; /* Reduced vertical gap */
  }
}

@media (max-width: 260px) {
  .experience-grid, .project-grid {
    grid-template-columns: 1fr;
    margin: auto;
    column-gap: 15px; /* Reduced horizontal gap */
    row-gap: 25px; /* Reduced vertical gap */
  }
}

/* Mobile Adjustment */
@media (max-width: 767px) {
  .experience-box, .project-box {
    min-height: 250px; /* Reduced height for mobile */
    padding: 0.75rem;
    margin: auto;
  }

  .experience-box h4, .project-box h4 {
    font-size: 1.1rem; /* Adjusted font size for mobile */
  }

  .experience-box p, .project-box p {
    font-size: 0.9rem; /* Slightly smaller text */
  }

  /* Mobile Image Fix for Project */
 .project-box .icon img {
    width: 90%;         /* Reduce size for mobile devices */
    max-height: 180px;  /* Adjusted max height for better fit */
  }
  /* Mobile Image Fix for Experience */
 .experience-box .icon img {
    width: 90%;         /* Reduce size for mobile devices */
    max-height: 180px;  /* Adjusted max height for better fit */
  }
#experience h2, #projects h2, #skills h2 {
  color: #0B318F;
  font-size: 2rem;
  margin: auto; /* Align headers to the left */
  text-align: center; /* Explicitly centers the text */
  display: block; /* Ensures proper block layout */
  margin-bottom: 1.5rem;
}

}


/* === FOOTER === */
footer {
  margin: 0;
  padding: 20px;
  background-color: black;
  color: white;
  text-align: center;
  margin-top: 0;
}

/* === Preloader === */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  overflow: hidden;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}

#preloader .music-loader {
  display: flex;
  gap: 5px;
  align-items: center;
  height: 80px;
}

#preloader .music-loader span {
  display: block;
  width: 6px;
  height: 40px;
  background: red;
  transform-origin: center center;
  animation: wave-scale 1s infinite ease-in-out;
}

#preloader .music-loader span:nth-child(1) { animation-delay: 0s; }
#preloader .music-loader span:nth-child(2) { animation-delay: 0.15s; }
#preloader .music-loader span:nth-child(3) { animation-delay: 0.3s; }
#preloader .music-loader span:nth-child(4) { animation-delay: 0.15s; }
#preloader .music-loader span:nth-child(5) { animation-delay: 0s; }

@keyframes wave-scale {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(2); }
}

body.preloading {
  overflow: hidden;
  width: 100vw; /* Prevents layout shift caused by scrollbar toggle */
}

/* === AOS Reset for Mobile === */
@media screen and (max-width: 768px) {
  [data-aos-delay] {
    transition-delay: 0 !important;
  }
}


/* Experience Link Styling */
.experience-link {
  color: white;           /* Match text color */
  text-decoration: none;  /* Remove underline */
  transition: color 0.3s ease;
}

.experience-link:hover {
  color: white;         /* Light blue on hover */
}

/* Maintain font size and styling within the Experience Box */
.experience-box h4 a {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

#contact {
  text-align: center;
}

/* Skills Header */
#contact h2 {
  color: #0B318F;
  font-size: 2rem;
   margin-bottom: 1rem;
}
/* Social links adjustment */
#contact .social-links {
  background: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  margin-bottom: 5rem; /* Add space below social buttons */
  display: flex;
  justify-content: center;
  align-items: center;        /* ✅ Align vertically */
  gap: 0.75rem; /* Space between each button */
  flex-wrap: wrap;
  margin: 0 auto;            /* Ensures horizontal centering */
  width: fit-content;        /* Shrinks container to icon width */
}

#contact .social-links a {
  font-size: 1.5rem;
  color: white;
  transition: transform 0.3s ease, color 0.3s ease;
}



/* Project Box Styling */
.project-box {
  background-color: navy;
  color: white;
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  width: 100%;
  min-height: 300px;
  text-align: center;
}

.view-project-btn {
  background-color: #CC0000;
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 5px;
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.view-project-btn:hover {
  background-color: darkred;
}

.view-project-btn i {
  font-size: 1rem;
}

body {
  padding-right: var(--scrollbar-fix, 0px);
  transition: none !important; /* Prevent animation during shift */
}
