/* Google Font import for Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600&display=swap');

/* General body and element styling */
body {
  transition: 0.3s;
  margin: 0;
  padding: 0;
  background-color: rgb(244, 241, 241);
  font-family: 'Poppins', sans-serif;
  color: rgb(57, 57, 57);
}

html {
  scroll-behavior: smooth;
}

/* Preloader */
#preloader {
  background: white url(images/loader.gif) no-repeat center center;
  background-size: 60%;
  height: 100vh;
  width: 100%;
  position: fixed;
  z-index: 100;
}

.dark #preloader {
  background: #21242d url(images/loaderD.webp) no-repeat center center;
  background-size: 60%;
}

/* Typography */
h1 {
  font-size: 70px;
  line-height: 70px;
  font-weight: 300;
  margin: 10px 0;
}

h2 {
  padding: 30px;
  margin-bottom: 10px;
  font-size: 50px;
  font-weight: 500;
  text-align: center;
}

p {
  margin: 0px;
  font-size: 20px;
}

/* Dark mode base styles */
.dark {
  background-color: rgb(57, 57, 57);
  transition: 0.3s;
}

.dark > * {
  color: rgb(255, 255, 255);
}

/* --- Header and Navigation --- */
.header-wrapper { position: fixed; top: 0; left: 0; width: 100%; box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; padding: 30px; z-index: 99; background-color: transparent; transition: background-color 0.4s ease, box-shadow 0.4s ease; }
.header-wrapper.scrolled {
  background-color: rgba(244, 241, 241, 0.85);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
}
.dark .header-wrapper.scrolled {
  background-color: rgba(57, 57, 57, 0.85);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 30px;
}
.header-brand {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
}
.pageicon { margin-left: 28px; height: 30px; width: 30px; transition: width 0.3s ease, height 0.3s ease; border-radius: 8px; }
.header-title { display: none; font-family: 'Poppins', sans-serif; font-weight: 500; color: rgb(57, 57, 57); white-space: nowrap; transition: color 0.3s ease; }
.dark .header-title { color: white; }

.menu {
  display: flex;
  align-items: center;
  gap: 30px;
}

.menu-bar {
  padding-top: 5px;
  font-family: 'Poppins', sans-serif;
  text-decoration: none;
  font-size: 20px;
  color: black;
  display: inline-block;
  position: relative;
}
.dark .menu-bar { color: white; }

.menu-bar::after {
  content: " ";
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background-color: rgb(0, 150, 255);
  transition: width 0.2s ease-in-out;
}

.menu-bar:hover::after {
  width: 100%;
}
.dark .menu-bar:hover::after {
  background-color: rgb(105, 229, 235);
}

.menu-bar .idu {
  border-bottom: 2.5px solid green;
  padding-bottom: 2px;
}
.dark .menu-bar .idu {
  border-bottom: 2.5px solid #DB4105;
}

.header-controls { display: flex; align-items: center; gap: 20px; }
.hamburger { display: none; cursor: pointer; padding: 5px; z-index: 101; }
.bar { display: block; width: 25px; height: 3px; margin: 5px auto;
  transition: all 0.3s ease-in-out; background-color: rgb(57, 57, 57); }
.dark .bar { background-color: white; }

/* --- Dark mode toggle switch --- */
.switch {
  width: 80px; height: 40px; border-radius: 20px;
  background-color: rgb(39, 38, 38); position: relative;
  transition: background-color 0.3s;
}
.switch:hover { cursor: pointer; }

.flicker {
  width: 30px; height: 30px; border-radius: 15px;
  background-color: rgb(255, 255, 255); position: absolute;
  top: 5px; left: 5px; transition: 0.3s;
  box-shadow: inset 4px 4px 4px rgb(255, 255, 255), inset -4px -4px 4px rgb(195 193 198 / 90%);
}

.moon {
  width: 20px; height: 20px; border-radius: 10px;
  box-shadow: 4px 4px 0 0 rgb(255, 255, 255); position: absolute;
  top: 5px; left: 45px; transition: box-shadow 0.3s;
}

.sun {
  width: 20px; height: 20px; position: absolute;
  top: 10px; opacity: 0; margin-left: 10px;
  transition: opacity 0.3s;
}

.dark .switch { background-color: rgb(255, 255, 255); }
.dark .flicker {
  transform: translateX(40px);
  background-color: rgb(39, 38, 38);
  box-shadow: inset 4px 4px 4px rgb(50 50 50 / 50%), inset -4px -4px 4px rgb(0 0 0 / 90%);
}
.dark .moon { box-shadow: 4px 4px 0 0 rgb(39, 38, 38); }
.dark .sun { opacity: 1; }

/* Main section styling */
.main {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 120px 30px 30px 30px;
  box-sizing: border-box;
}

.main-text {
  padding: 30px;
  max-width: 600px;
}

.typewrite {
  display: inline-block;
  border-right: 3px solid rgb(57, 57, 57);
  animation: blink-caret .75s step-end infinite;
  white-space: nowrap;
  overflow: hidden;
}
@keyframes blink-caret {
  50% { border-color: transparent; }
}
.typewrite.typing-done {
  animation: none;
  border-right-color: transparent;
}
.dark .typewrite {
  border-right-color: white;
}

.links {
  color: rgb(0, 150, 255); font-size: 20px; text-decoration: none;
  font-weight: 500; position: relative; transition: transform 0.3s ease;
}
.links:hover { color:  rgb(0, 110, 215); }
.dark .links { color: rgb(105, 229, 235); }
.dark .links:hover { color: rgb(84, 183, 188); }

/* === MODIFIED SECTION: Profile Picture Styles === */
.pfp-container {
  width: 500px;
  height: 500px;
  margin-right: 10px;
  border-radius: 50%;
  animation: fadeIn 3s ease-in-out forwards;
  opacity: 0;
  padding: 8px; /* Creates the glass border effect */
  box-sizing: border-box;
  
  /* Glassmorphism Styles */
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 24px 0 rgba(31, 38, 135, 0.15);
  transition: all 0.3s ease;
}
.dark .pfp-container {
  background: rgba(71, 71, 71, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.2);
}

.pfp {
  height: 100%;
  width: 100%;
  border-radius: 50%;
  object-fit: cover;
  /* Layout and animation properties moved to container */
}
/* === END MODIFIED SECTION === */

@keyframes fadeIn { to { opacity: 1; } }

.mentors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  width: 100%;
  max-width: 1000px; /* MODIFIED: This limits the grid to a max of 3 columns */
  margin: 0 auto 10px auto;
  padding: 20px;
}

.mentor-card {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 16px 0 rgba(31, 38, 135, 0.15);
  border-radius: 20px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}
.mentor-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px 0 rgba(31, 38, 135, 0.2);
  background: rgba(255, 255, 255, 0.6);
}
.mentor-card img {
  height: 120px;
  width: 120px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 20px;
  border: 3px solid #eee;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}
.dark .mentor-card img {
  border-color: #555;
}
.mentor-card:hover img {
  transform: scale(1.05);
}
.mentor-name {
  font-weight: 500;
  font-size: 1.1rem;
}
.dark .mentor-card {
  background: rgba(71, 71, 71, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}
.dark .mentor-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px 0 rgba(0, 0, 0, 0.3);
  background: rgba(71, 71, 71, 0.5);
}


/* ==================================================== */
/* START: New Career & Contributions Section Styles     */
/* ==================================================== */
.career-section {
  padding: 20px;
  margin-bottom: 40px;
}

/* --- MODIFIED: Career Card Layout --- */
.career-card {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px;
  border-radius: 24px;
  
  /* Glassmorphism Styles */
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

  /* Flexbox Layout - CHANGED TO COLUMN */
  display: flex;
  flex-direction: column; /* Stacks the rows vertically */
  gap: 40px; /* Space between the rows */
  align-items: flex-start; /* Aligns content to the left */
}

/* --- MODIFIED: New Row Container Styles --- */
.resume-container, .github-container {
  width: 100%; /* Ensure rows take full width */
}

/* Style for the separator line */
.resume-container {
  padding-top: 40px;
  border-top: 1px solid rgba(57, 57, 57, 0.15);
}
.dark .resume-container {
  border-top-color: rgba(255, 255, 255, 0.15);
}
/* --- END MODIFICATION --- */


.career-card h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 28px;
  font-weight: 500;
}
.career-card p {
  font-size: 16px;
  line-height: 1.6;
  opacity: 0.8;
  max-width: 650px; /* Increased width for better readability in the new layout */
}

/* Button Styles */
.button-group {
  margin-top: 25px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.btn {
  padding: 12px 24px;
  border: 2px solid transparent;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
}
.btn i {
  font-size: 1.1em;
}
.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}
.btn:active {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background-color: rgb(0, 119, 255);
  color: white;
}
.btn-primary:hover {
  background-color: rgb(0, 100, 220);
}
.btn-secondary {
  background-color: transparent;
  border-color: rgb(0, 119, 255);
  color: rgb(0, 119, 255);
}
.btn-secondary:hover {
  background-color: rgba(0, 119, 255, 0.1);
}

/* GitHub Stats Card Styles */
.github-cards-wrapper {
  margin-top: 25px;
  display: flex;
  flex-wrap: wrap; /* Allows cards to stack on smaller screens */
  gap: 40px;       /* MODIFIED: Increased gap for more spacing */
  justify-content: flex-start; /* Aligns cards to the left */
  align-items: center; /* Vertically center-aligns the cards */
}

.github-card-item {
  flex: 1; /* Allows cards to grow and share space */
  min-width: 320px; /* Defines the minimum width before wrapping */
  max-width: 450px;
}

.github-card-item img {
  width: 100%;
  height: auto;
}

/* Reusable class-based dark mode toggling for images */
.light-mode-img {
  display: block; /* Show by default in light mode */
}
.dark-mode-img {
  display: none;  /* Hide by default in light mode */
}
.dark .light-mode-img {
  display: none; /* Hide in dark mode */
}
.dark .dark-mode-img {
  display: block; /* Show in dark mode */
}

/* Dark Mode for Career Section */
.dark .career-card {
  background: rgba(71, 71, 71, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}
.dark .career-card p {
  opacity: 0.7;
}
.dark .btn-primary {
  background-color: rgb(105, 229, 235);
  color: #212121;
}
.dark .btn-primary:hover {
  background-color: rgb(84, 183, 188);
}
.dark .btn-secondary {
  border-color: rgb(105, 229, 235);
  color: rgb(105, 229, 235);
}
.dark .btn-secondary:hover {
  background-color: rgba(105, 229, 235, 0.1);
}

/* ==================================================== */
/* END: New Career & Contributions Section Styles       */
/* ==================================================== */


/* "To Top" Button */
.to-top2 {
  background: rgba(255, 255, 255, 0.4); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 8px 16px 0 rgba(31, 38, 135, 0.15);
  position: fixed; bottom: 30px; right: 35px; width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 24px; color: rgb(57, 57, 57);
  text-decoration: none; opacity: 0; pointer-events: none;
  transition: opacity 0.4s, bottom 0.4s, background 0.3s, transform 0.3s, box-shadow 0.3s;
  z-index: 2;
}
.to-top2:hover {
  transform: translateY(-5px); box-shadow: 0 12px 20px 0 rgba(31, 38, 135, 0.2);
  background: rgba(255, 255, 255, 0.6);
}
.dark .to-top2 {
  background: rgba(71, 71, 71, 0.3); border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2); color: whitesmoke;
}
.dark .to-top2:hover {
  transform: translateY(-5px); box-shadow: 0 12px 20px 0 rgba(0, 0, 0, 0.3);
  background: rgba(71, 71, 71, 0.5);
}

/* Footer & Socials */
footer {
  display: flex; flex-direction: column; justify-content: center;
  align-items: center; padding: 40px 15px 20px;
  background-color: transparent;
}
#footer .wrapper {
  display: flex; justify-content: center; align-items: center;
  padding: 20px 30px; margin-bottom: 20px;
  transition: background 0.3s, border 0.3s, padding 0.3s;
  background: rgba(255, 255, 255, 0.4); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}
.dark #footer .wrapper {
  background: rgba(71, 71, 71, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}
.wrapper a.icon {
  margin: 0 20px; text-align: center; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-direction: column;
  position: relative; z-index: 2;
  transition: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  text-decoration: none;
}
.wrapper a.icon span {
  display: block; height: 60px; width: 60px; background: #fff;
  border-radius: 50%; position: relative; z-index: 2;
  box-shadow: 0px 10px 10px rgba(0,0,0,0.1);
  transition: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.wrapper a.icon span i { line-height: 60px; font-size: 25px; color: #333; }
.wrapper a.icon .tooltip {
  position: absolute; top: 0; z-index: 1; background: #fff; color: #fff;
  padding: 10px 18px; font-size: 20px; font-weight: 500; border-radius: 25px;
  opacity: 0; pointer-events: none; box-shadow: 0px 10px 10px rgba(0,0,0,0.1);
  transition: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.wrapper a.icon:hover .tooltip { top: -70px; opacity: 1; pointer-events: auto; }
.icon .tooltip:before {
  position: absolute; content: ""; height: 15px; width: 15px;
  background: #fff; left: 50%; bottom: -6px;
  transform: translateX(-50%) rotate(45deg);
  transition: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.wrapper a.icon:hover span i { color: white; } /* MODIFIED: Correctly targets the icon on hover */
.wrapper a.icon:hover span, .wrapper a.icon:hover .tooltip { text-shadow: 0px -1px 0px rgba(0,0,0,0.4); }
.wrapper .linkedin:hover span, .wrapper .linkedin:hover .tooltip, .wrapper .linkedin:hover .tooltip:before { background: #0072b1; }
.wrapper .twitter:hover span, .wrapper .twitter:hover .tooltip, .wrapper .twitter:hover .tooltip:before { background: #46C1F6; }
.wrapper .instagram:hover span, .wrapper .instagram:hover .tooltip, .wrapper .instagram:hover .tooltip:before { background: #e1306c; }
.wrapper .github:hover span, .wrapper .github:hover .tooltip, .wrapper .github:hover .tooltip:before { background: #333; }
.wrapper .envelope:hover span, .wrapper .envelope:hover .tooltip, .wrapper .envelope:hover .tooltip:before { background: #DE463B; }
.dark .wrapper a.icon span i { color: black; }
.dark .wrapper a.icon:hover span i { color: white; }

.credit { font-size: 12px; text-align: center; }
.credit a { color: rgb(57, 57, 57); text-decoration: none; font-weight: 500; }
.dark .credit a { color: white; }


/* Scrollbar Styles */
html::-webkit-scrollbar { width: 0.5vw; }
html::-webkit-scrollbar-thumb { background-color: rgb(90, 110, 130); border-radius: 100px; }
.dark::-webkit-scrollbar-thumb { background-color: #555; border-radius: 100px; }
html.menu-open { position: fixed; width: 100%; overflow-y: scroll; }

@media only screen and (max-width: 992px) {
  h2 { font-size: 36px; padding: 15px; }
  h1 { font-size: 50px; line-height: 50px; }
  .main { flex-direction: column; height: auto; padding: 110px 20px 20px 20px; } /* MODIFIED: Reduced top padding from 150px to 110px */
  .main-text {
    width: 100% !important;
    margin-bottom: 40px;
    text-align: left;
  }
  .pfp-container { height: 350px; width: 350px; margin: 0; }
  .career-card { padding: 30px; }
}


@media only screen and (max-width: 768px) {
  .main-text { width: 100%; }
  .pfp-container { height: 300px; width: 300px; }
  .header-wrapper { padding: 15px; }
  /* MODIFIED: Removed display:block since it's now the default */
  .header-title { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
  .header-brand { margin-right: 10px; }
  .pageicon { margin: 0 !important; width: 36px; height: 36px; }
  .hamburger { display: block; order: 2; }
  .bar { width: 30px; height: 4px; margin: 6px auto; }
  .switch { order: 1; width: 65px; height: 32px; margin-top: 4px; }
  .flicker { width: 24px; height: 24px; top: 4px; left: 4px; }
  .moon { width: 15px; height: 15px; top: 4px; left: 38px; }
  .sun { width: 15px; height: 15px; top: 8px; margin-left: 8px; }
  .dark .flicker { transform: translateX(33px); }
  .hamburger.active .bar:nth-child(2) { opacity: 0; }
  .hamburger.active .bar:nth-child(1) { transform: translateY(10px) rotate(45deg); }
  .hamburger.active .bar:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }
  .hamburger.active { position: fixed; top: 25px; right: 15px; }
  .menu {
    position: fixed; left: -100%; top: 0; gap: 0; flex-direction: column;
    background-color: rgb(244, 241, 241); width: 100%; height: 100vh;
    transition: 0.3s; z-index: 100; display: flex;
    justify-content: center; align-items: center; padding-top: 0;
  }
  .dark .menu { background-color: rgb(57, 57, 57); }
  .menu.active { left: 0; }
  /* REMOVED .nav.menu and .menu.active { display: flex } rules */
  .menu-bar { margin: 16px 0; font-size: 24px; }
  .menu-bar:hover::after { width: 100%; }
  .to-top2 { right: 20px; background: rgba(255, 255, 255, 0.6); }
  .to-top2:hover { background: rgba(255, 255, 255, 0.8); }
  .dark .to-top2 { background: rgba(71, 71, 71, 0.5); }
  .dark .to-top2:hover { background: rgba(71, 71, 0.7); }
  .career-card h3 { font-size: 24px; }
  .career-card p { font-size: 15px; }
  .career-card { padding: 20px; }
  
}

@media only screen and (max-width: 576px) {
  .header-controls { gap: 15px; }
  .header-title { font-size: 14px; }
  h1 { font-size: 36px; line-height: 40px; }
  p { font-size: 16px; }
  h2 { font-size: 30px; }
  .links { font-size: 16px; }
  .pfp-container { height: 250px; width: 250px; }
  .wrapper a.icon { margin: 0 10px; }
  .wrapper a.icon span { height: 50px; width: 50px; }
  .wrapper a.icon span i { line-height: 50px; font-size: 20px; }
  .mentors-grid { width: 100%; padding: 15px; gap: 15px; box-sizing: border-box;}
  .career-section { padding: 10px; }
  .career-card { padding: 20px; }
}

/* === MODIFIED SECTION FOR SMALL VIEWPORTS === */
@media only screen and (max-width: 420px) {
  .header-controls { gap: 10px; }
  .career-section { padding: 0 15px; }
  .career-card { padding: 20px 15px; margin-left: 0; }
  .header-title { font-size: 14px; }
  .wrapper a.icon { margin: 0 8px; }
  .wrapper a.icon span { height: 45px; width: 45px; }
  .wrapper a.icon span i { line-height: 45px; font-size: 20px; }
  #footer .wrapper { padding: 15px 20px; }

  /* ADDED: Adjustments for mentor cards on very small screens */
  .mentors-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  .mentor-card {
    padding: 20px;
  }
}