* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Quicksand", sans-serif;
}
.right::-webkit-scrollbar {
  width: 0;

  border-radius: 5px;
}

.main::-webkit-scrollbar {
  width: 0;
}

body {
  background-color: #1f1f1f;
  color: #ffffff;
}

/* Loading Screen Styles */
.loader-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #1f1f1f;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-in-out;
}

.loader-container.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-logo {
  font-family: "Quicksand", sans-serif;
  font-size: 3rem;
  font-weight: bold;
  color: #28e98c;
  margin-bottom: 2rem;
  animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
    transform: scale(1);
  }
  100% {
    opacity: 1;
    transform: scale(1.05);
  }
}

.loader {
  width: 300px;
  height: 6px;
  background-color: #333;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.loader-progress {
  height: 100%;
  background: linear-gradient(90deg, #28e98c, #20c77a, #28e98c);
  background-size: 200% 100%;
  border-radius: 3px;
  animation: loadingProgress 1s ease-in-out forwards, shimmer 0.8s ease-in-out infinite;
  width: 0%;
}

@keyframes loadingProgress {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.loader-text {
  margin-top: 1rem;
  font-family: "Quicksand", sans-serif;
  color: #28e98c;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Hide main content initially */
.main {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.main.show {
  opacity: 1;
}

aside {
  /* border: 1px solid rgba(128, 128, 128, 0.619); */
  position: fixed; /* keep sidebar visible while user scrolls */
  right: 4rem;
  display: flex;
  flex-direction: column;
  width: 55px;
  height: auto;
  border-radius: 30px;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 0.5rem;
  top: 30%;
  background-color: rgba(75, 75, 75, 0.739);
}
aside a {
  height: inherit;
  width: inherit;
  display: grid;
  place-items: center;
  margin-bottom: 0.5rem;
  text-decoration: none;
  color: rgba(128, 128, 128, 0.955);
  position: relative;
  color: #28e98c;
}

aside a:hover {
  color: gray;
}

aside a::after {
  content: "";
  min-height: 20px;
  width: 0px;
  background-color: #383838;
  position: absolute;
  right: 60px;
  top: 30%;
  border-radius: 2px;
  color: rgb(182, 182, 182);
  text-align: center;
  display: grid;
  place-items: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;

  opacity: 0;
}
.home_menu::after {
  content: "Home";
}
.about_menu::after {
  content: "About";
}
.education_menu::after {
  content: "Education";
}
.experience_menu::after {
  content: "Experience";
}
.skills_menu::after {
  content: "Skills";
}
.contact_menu::after {
  content: "Contact";
}
.achievements_menu::after {
  content: "Achievements";
}
.projects_menu::after {
  content: "Projects";
}
.cp_menu::after {
  content: "Competitive Programming";
}
.club_menu::after {
  content: "Club Activities";
}
.social_menu::after {
  content: "Social Activities";
}
.volunteer_menu::after {
  content: "Volunteering";
}
.blog_menu::after {
  content: "Blog";
}

aside a:hover::after {
  width: auto;
  transition: all 0.3s;
  opacity: 1;
}

.main {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 420px auto;
  align-items: start; /* anchor content to top to avoid large bottom gaps */
}

.left {
  margin-left: 2rem;

  padding-top: 2rem;
  padding-bottom: 2rem;
  width: 400px;
  border: 1px solid rgba(128, 128, 128, 0.619);
  border-radius: 30px;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky; /* keep left column visible while user scrolls */
  top: 1.5rem;
  z-index: 5;
}
.left p {
  text-align: justify;
}

.intro img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 30px;
}

.intro p {
  font-size: 1rem;
  text-align: center;
  margin-top: 0.5rem;
  color: #b3b3b3;
}

.contact {
  text-align: center;
  margin-top: 1rem;
}

.contact a {
  text-decoration: none;
  color: #ffffff;
}

.contact h5,
h4 {
  margin-bottom: 0.5rem;
}

.left .reservedMsg {
  margin-top: 1rem;
  text-align: center;
}

.left .social {
  margin-top: 1rem;
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.left .social a {
  text-decoration: none;
  color: #ffffff9f;

  border: 2px solid #ffffff9f;
  height: 45px;
  min-width: 45px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  transition: all 0.3s;
}

.left .social a:hover {
  color: #28e98c;
  border: 2px solid #28e98c;
}

.left button {
  margin-top: 2rem;
  width: 100%;
  height: 55px;
  border-radius: 30px;
  background-color: #28e98c;
  border: 2px solid #28e98c;
  border: none;
  color: #000000;
  font-size: 1.2rem;
  transition: all 0.1s;
  font-weight: bold;
}

.left button:hover {
  background-color: #1f1f1f;
  border: 2px solid #28e98c;
  color: #28e98c;
}

/* right side design */
.right {
  border-radius: 30px;
  max-height: none;
  padding: 2rem;
  padding-left: 2.5rem; /* ensure spacing from sticky left column */
  width: 70%;
  margin: auto;
  margin-top: 2rem;
  overflow-y: visible; /* let the page (body) scroll so sticky left works */
}

.right .tag {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.right .tag p {
  border-radius: 30px;
  /* width: 150px; */
  border: 1px solid rgba(128, 128, 128, 0.603);
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  height: 40px;
  height: 100%;
  color: rgb(189, 189, 189);
}

.right .tag p span {
  margin-left: 0.75rem;
}

@media screen and (min-width: 769px) {
  .right {
    overflow-y: scroll;
  }
}

/* media query */
@media screen and (max-width: 768px) {
  .main {
    display: grid;
    grid-template-columns: auto;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    padding-top: 1rem;
    padding-bottom: 2rem;
  }

  .left {
    width: 100%;
    border: 1px solid rgba(128, 128, 128, 0.619);
    border-radius: 30px;
    padding: 2rem;
    /* on mobile the left panel should flow with the document, not be sticky */
    position: static;
    top: auto;
    margin: 0 0 1.25rem 0;
    padding-bottom: 4rem;
  }

  .intro img {
    width: 100%;
    height: 350px;
    object-fit: contain;
    border-radius: 30px;
  }

  /* right side design */
  .right {
    border-radius: 30px;
    padding: 0.5rem;
    width: 100%;
  }

  aside {
    border: none;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    inset: auto 0 0 0 !important;
    display: flex !important;
    margin: 0 !important;
    transform: none !important;
    flex-direction: row !important;
    width: 100% !important;
    height: calc(60px + env(safe-area-inset-bottom, 0)) !important;
    border-radius: 18px 18px 0 0 !important;
    justify-content: space-around !important;
    align-items: center !important;
    padding: 0 8px !important;
    padding-bottom: env(safe-area-inset-bottom, 0) !important;
    background-color: rgb(75, 75, 75) !important;
    z-index: 99999 !important;
    overflow: visible !important;
    gap: 0 !important;
  }

  aside a {
    flex: 1 1 0 !important;
    width: auto !important;
    height: 100% !important;
    min-width: 30px !important;
    min-height: 44px !important;
    max-width: 50px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 1.1rem !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative !important;
    text-decoration: none !important;
  }

  /* Hide the ::after tooltip labels on mobile completely */
  aside a::after {
    display: none !important;
    content: none !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  aside a i {
    pointer-events: none !important;
    font-size: 1.1rem !important;
  }

  /* Prevent page content being covered by the bottom bar */
  .main {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0) + 16px);
  }

  /* Hide cursor trail on mobile */
  .cursor-trail {
    display: none;
  }
}

/* Interactive Cursor Trail */
.cursor-trail {
  position: fixed;
  width: 4px;
  height: 4px;
  background: #28e98c;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  z-index: 9999;
  animation: trailFade 0.5s ease-out forwards;
}

@keyframes trailFade {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0);
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .cursor-trail {
    display: none !important;
  }
}

/* Typewriter Effect Styles */
.typewriter {
  font-family: "Quicksand", sans-serif;
  display: inline-block;
  color: #ffffff;
  min-height: 1.2em; /* Prevent layout shift */
  font-size: 2.8rem !important; /* Perfect size at 3.8rem */
  font-weight: bold;
  line-height: 1.1; /* Tighter line height for better appearance */
}

.typewriter .cursor {
  display: inline-block;
  background-color: #28e98c;
  margin-left: 4px;
  width: 4px;
  height: 1.2em;
  animation: blink 1s infinite;
  vertical-align: top;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* Hide cursor when typing is complete */
.typewriter.typing-complete .cursor {
  display: none;
}

/* Ensure typewriter text maintains proper styling */
#typewriter-text {
  color: #ffffff;
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
  display: inline;
}

/* Style for the highlighted name portion */
#typed-text span {
  color: #28e98c !important;
}

/* Responsive font sizing for typewriter */
@media screen and (max-width: 768px) {
  .typewriter {
    font-size: 2.5rem !important; /* Smaller for tablets */
  }
}

@media screen and (max-width: 480px) {
  .typewriter {
    font-size: 1.8rem !important; /* Smaller for mobile phones */
  }
}

/* Disable typewriter effect for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .typewriter .cursor {
    animation: none;
    opacity: 1;
  }
  
  /* Instantly show full text for reduced motion users */
  .typewriter.reduced-motion #typed-text:before {
    content: "Hi — I'm ";
  }
  
  .typewriter.reduced-motion #typed-text:after {
    content: "Anowar Hossen Farvez";
    color: #28e98c;
  }
}