/* ===============================================
   STYLE.CSS
   Core layout, structure, and component styles
   =============================================== */

/* ================= SCROLL SNAP BEHAVIOR ================= */

/* Enable smooth snap scrolling on the body/main container */
html {
  scroll-behavior: smooth;
}

body {
  /* Prevent horizontal overflow */
  overflow-x: hidden;
  /* Enable vertical scroll with snap */
  overflow-y: scroll;
  /* Set up scroll snap container */
  scroll-snap-type: y mandatory;
  /* Smooth scrolling for better UX */
  -webkit-overflow-scrolling: touch;
}

/* Each section should be a snap point and fill the viewport */
main > section {
  /* Full viewport height minimum */
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile */
  
  /* Snap to start of section */
  scroll-snap-align: start;
  scroll-snap-stop: always;
  
  /* Ensure proper positioning */
  position: relative;
  
  /* Account for fixed navbar - add padding at top */
  padding-top: 5rem;
  
  /* Ensure sections display properly */
  display: flex;
  flex-direction: column;
  
  /* Default: center content vertically for short sections */
  justify-content: center;
  
  /* Prevent content compression */
  width: 100%;
  
  /* Allow natural height expansion beyond viewport */
  height: auto;
}

/* Ensure child containers take full width and don't shrink */
main > section > div {
  width: 100%;
  flex-shrink: 0;
  flex-grow: 0;
}

/* For sections with grids or lots of content, align to top instead of center */
main > section:has(.grid) {
  justify-content: flex-start;
  padding-bottom: 3rem;
}

/* Specific handling for work section with project cards */
#work {
  justify-content: flex-start;
  padding-bottom: 4rem;
}

/* Same for education, certifications, and publications */
#education,
#certifications,
#publications {
  justify-content: flex-start;
  padding-bottom: 3rem;
}

@media (min-width: 768px) {
  main > section {
    padding-top: 6rem;
  }
}

/* Remove scroll-margin-top as we're using padding instead */
main section[id] {
  scroll-margin-top: 0;
}

/* Disable snap scrolling when mobile menu or chat is open */
body.no-snap {
  scroll-snap-type: none !important;
}

/* ===== REAL MOBILE MENU SCROLL FIX ===== */

#sideMenu {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

/* Prevent backdrop from eating touch */
#menuBackdrop {
  touch-action: none;
  pointer-events: auto;
}

/* Ensure links are touchable */
.mobile-nav-link {
  touch-action: manipulation;
}



/* ================= NAVBAR ================= */

#navbar {
  transition: background-color 0.25s ease,
              backdrop-filter 0.25s ease,
              padding 0.25s ease,
              box-shadow 0.25s ease;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

#navbar.nav-shrink {
  backdrop-filter: blur(12px);
  background-color: rgba(255,255,255,0.8);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dark #navbar.nav-shrink {
  background-color: rgba(15,15,15,0.8);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}


/* ================= NAV ACTIVE LINK ================= */

.nav-link {
  position: relative;
  transition: all 0.3s ease;
}

.nav-link.active {
  background: linear-gradient(to right, rgba(184, 32, 230, 0.1), rgba(218, 125, 32, 0.1));
  color: #b820e6;
}

.dark .nav-link.active {
  color: #c4b5fd;
}


/* ================= MOBILE MENU ================= */

#sideMenu {
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}

.dark #sideMenu {
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
}

.mobile-nav-link {
  position: relative;
  overflow: hidden;
}

.mobile-nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: linear-gradient(to bottom, #b820e6, #da7d20);
  border-radius: 0 2px 2px 0;
  transition: height 0.3s ease;
}

.mobile-nav-link:hover::before {
  height: 70%;
}


/* ================= PROJECT CARD ================= */

.project-card {
  transition: transform 0.3s ease;
}

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


/* ================= INFO CARD (ABOUT SECTION) ================= */

.info-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.info-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  border-color: rgba(184, 32, 230, 0.3);
}

.dark .info-card:hover {
  box-shadow: 0 12px 28px rgba(255, 255, 255, 0.08);
  border-color: rgba(184, 32, 230, 0.5);
}


/* ================= SKILL BAR ANIMATIONS ================= */

.skill-bar-container {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.6s ease-out forwards;
}

.skill-bar-container:nth-child(1) {
  animation-delay: 0.1s;
}

.skill-bar-container:nth-child(2) {
  animation-delay: 0.2s;
}

.skill-bar-container:nth-child(3) {
  animation-delay: 0.3s;
}

.skill-bar-container:nth-child(4) {
  animation-delay: 0.4s;
}

.skill-bar {
  animation: skillFill 1.2s ease-out forwards;
}

.skill-bar-container:nth-child(1) .skill-bar {
  animation-delay: 0.3s;
}

.skill-bar-container:nth-child(2) .skill-bar {
  animation-delay: 0.4s;
}

.skill-bar-container:nth-child(3) .skill-bar {
  animation-delay: 0.5s;
}

.skill-bar-container:nth-child(4) .skill-bar {
  animation-delay: 0.6s;
}


/* ================= TOOL ITEM ================= */

.tool-item {
  width: 5rem;
  height: 5rem;
  border-radius: .75rem;
  background: white;
  border: 2px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.dark .tool-item {
  background: #1f2937;
  border-color: rgba(255,255,255,0.1);
}

.tool-item:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  border-color: rgba(184, 32, 230, 0.3);
}

.dark .tool-item:hover {
  box-shadow: 0 8px 20px rgba(255,255,255,0.08);
  border-color: rgba(184, 32, 230, 0.4);
}

/* Grayscale by default, color on hover - NO SIZE CHANGE */
.tool-icon {
  filter: grayscale(100%);
  transition: filter 0.3s ease;
}

.tool-item:hover .tool-icon {
  filter: grayscale(0%);
}

@media(min-width:640px) {
  .tool-item {
    width: 5.5rem;
    height: 5.5rem;
  }
}


/* ================= EDUCATION ITEMS ================= */

.education-item {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.education-item.animate-in {
  opacity: 1;
  transform: translateX(0);
}


/* ================= CERTIFICATE CARDS ================= */

.cert-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.cert-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}


/* ================= PUBLICATION CARDS ================= */

.publication-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.publication-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}


/* ================= CERTIFICATE MODAL ================= */

#certOverlay {
  opacity: 0;
  transition: opacity .25s ease;
}

#certOverlay.flex {
  opacity: 1;
}

#certPopup {
  animation: certZoom .25s ease forwards;
  
}

/* ================= PROJECT WORK CARD ================= */

/* Project card background images */
.project-1 {
  background-image: url('../images/work-1.png');
}

.project-2 {
  background-image: url('../images/work-2.png');
}

.project-3 {
  background-image: url('../images/work-3.jpg');
}

.project-4 {
  background-image: url('../images/work-4.jpg');
}

/* Common settings */
.project-card {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}



/* ================= ACCESSIBILITY ================= */

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    animation-duration: .01ms!important;
    animation-iteration-count:1!important;
    transition-duration: .01ms!important;
    scroll-behavior:auto!important;
  }
  
  body {
    scroll-snap-type: none !important;
  }
}

a:focus-visible,
button:focus-visible {
  outline:2px solid #7c3aed;
  outline-offset:2px;
  border-radius: .25rem;
}

.dark a:focus-visible,
.dark button:focus-visible {
  outline-color:#c4b5fd;
}


