/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

/* GLOBAL BODY */
body {
  font-family: "Poppins", sans-serif;
  background: var(--bg-body);
  color: var(--text-color);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s ease;
  overflow-x: hidden; /* Allow vertical scroll */
}

/* LIGHT/DARK THEMES */
:root {
  --bg-body: #f5f6fa;
  --bg-card: #fff;
  --bg-sidebar: #ffffff;
  --text-color: #333;
  --shadow-color: rgba(0, 0, 0, 0.348);
  --bg: hsl(0 0% 10%);
  --project-img-border :rgba(76, 76, 76, 0.650);
  --svg-color: black;
}

body.dark {
  --bg-body: #1e1f25;
  --bg-card: #2a2b33;
  --bg-sidebar: #2a2b33;
  --text-color: #f5f6fa;
  --shadow-color: rgba(0, 0, 0, 0.5);
  --project-img-border: black;
  --svg-color: white;

}

/* LAYOUT: MAIN CARD + SIDEBAR + CONTENT */

/* MAIN CARD CONTAINER */
.portfolio-card {
  width: 90%;
  height: 90vh;
  display: flex;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.267);
  position: relative;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  background: var(--bg-card);
  height: 100%;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 3px 0 10px var(--shadow-color);
  transition: transform 0.3s ease-in-out;
  z-index: 10;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.profile {
  text-align: center;
}

.avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  box-shadow: 0 6px 18px var(--shadow-color);
  border: 3px solid var(--bg-body);
  transition: transform 0.3s;
}

.avatar:hover {
  transform: scale(1.05);
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  transition: all 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(0, 123, 255, 0.15);
  color: #007bff;
  font-weight: 500;
}

/* ------------underline effect-------------- */

.nav-links a {
  position: relative;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  padding-left: 1rem; /* space for the line */
  transition: color 0.3s ease;
}

/* --- line that grows from center --- */
.nav-links a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%; /* start in the middle */
  width: 3px; /* line thickness */
  height: 0; /* start invisible */
  background: linear-gradient(to bottom,#006aff);
  border-radius: 4px;
  box-shadow: 0 0 8px #006aff, 0 0 10px #006aff;
  transform: translateY(-50%); /* center align */
  transition: height 0.35s ease, top 0.35s ease, transform 0.35s ease;
}

/* when hovered or active */
.nav-links a:hover::before,
.nav-links a.active::before {
  height: 100%;
  top: 0; /* expand to top */
  transform: translateY(0);
}

/* optional hover text color */
.nav-links a:hover {
  background: rgba(0, 123, 255, 0.15);
  color: #007bff;
}

/* ------END underline-------- */

footer {
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.7;
}

/*------------------------------ TOGGLE BUTTONS--------------------------------------- */

.toggle-btn,
.mode-btn {
  position: absolute;
  top: 1rem;
  background: #111;
  color: #fff;
  border: none;
  font-size: 1.4rem;
  border-radius: 5px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  transition: background 0.3s;
  z-index: 30;
}

.toggle-btn:hover,
.mode-btn:hover {
  transform: scale(1.05);
  transition: 0.4s ease-in-out;
}

.toggle-btn {
  left: 1rem;
  display: none;
}

.mode-btn {
  right: 1rem;
  background-color: #6e6e6e1f;
  border-radius: 50px;
  padding: 4px;
}


.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}
.switch #input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #2196f3;
  transition: 0.4s;
  z-index: 0;
  overflow: hidden;
}
.sun-moon {
  position: absolute;
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: yellow;
  transition: 0.4s;
}
#input:checked + .slider {
  background-color: black;
}
#input:focus + .slider {
  box-shadow: 0 0 1px #2196f3;
}
#input:checked + .slider .sun-moon {
  transform: translateX(26px);
  background-color: white;
  animation: rotate-center 0.6s ease-in-out both;
}
.moon-dot {
  opacity: 0;
  transition: 0.4s;
  fill: gray;
}
#input:checked + .slider .sun-moon .moon-dot {
  opacity: 1;
}
.slider.round {
  border-radius: 34px;
}
.slider.round .sun-moon {
  border-radius: 50%;
}
#moon-dot-1 {
  left: 10px;
  top: 3px;
  position: absolute;
  width: 6px;
  height: 6px;
  z-index: 4;
}
#moon-dot-2 {
  left: 2px;
  top: 10px;
  position: absolute;
  width: 10px;
  height: 10px;
  z-index: 4;
}
#moon-dot-3 {
  left: 16px;
  top: 18px;
  position: absolute;
  width: 3px;
  height: 3px;
  z-index: 4;
}
#light-ray-1,
#light-ray-2,
#light-ray-3 {
  position: absolute;
  fill: white;
  opacity: 10%;
  z-index: -1;
}
#light-ray-1 { left: -8px; top: -8px; width: 43px; height: 43px; }
#light-ray-2 { left: -50%; top: -50%; width: 55px; height: 55px; }
#light-ray-3 { left: -18px; top: -18px; width: 60px; height: 60px; }
.cloud-light, .cloud-dark {
  position: absolute;
  animation-name: cloud-move;
  animation-duration: 6s;
  animation-iteration-count: infinite;
}
.cloud-light { fill: #eee; }
.cloud-dark { fill: #ccc; animation-delay: 1s; }
#cloud-1 { left: 30px; top: 15px; width: 40px; }
#cloud-2 { left: 44px; top: 10px; width: 20px; }
#cloud-3 { left: 18px; top: 24px; width: 30px; }
#cloud-4 { left: 36px; top: 18px; width: 40px; }
#cloud-5 { left: 48px; top: 14px; width: 20px; }
#cloud-6 { left: 22px; top: 26px; width: 30px; }
@keyframes cloud-move {
  0% { transform: translateX(0px); }
  40% { transform: translateX(4px); }
  80% { transform: translateX(-4px); }
  100% { transform: translateX(0px); }
}
.stars {
  transform: translateY(-32px);
  opacity: 0;
  transition: 0.4s;
}
.star {
  fill: white;
  position: absolute;
  transition: 0.4s;
  animation-name: star-twinkle;
  animation-duration: 2s;
  animation-iteration-count: infinite;
}
#input:checked + .slider .stars {
  transform: translateY(0);
  opacity: 1;
}
#star-1 { width: 20px; top: 2px; left: 3px; animation-delay: 0.3s; }
#star-2 { width: 6px; top: 16px; left: 3px; }
#star-3 { width: 12px; top: 20px; left: 10px; animation-delay: 0.6s; }
#star-4 { width: 18px; top: 0px; left: 18px; animation-delay: 1.3s; }
@keyframes star-twinkle {
  0% { transform: scale(1); }
  40% { transform: scale(1.2); }
  80% { transform: scale(0.8); }
  100% { transform: scale(1); }
}

/* ------------------------------end toggle theme------------------------ */

/* MAIN CONTENT AREA */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4rem;
  scroll-behavior: smooth;
}

.hero button {
  margin-top: 10px;
}

/* SECTION BASE */
.section {
  min-height: 100vh;
  opacity: 0;
  transform: translateY(60px) scale(0.96);
  transition: opacity 0.85s ease-out,
              transform 0.85s cubic-bezier(.18, .89, .32, 1.28);
  will-change: opacity, transform;
}

.section.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* First section (hero) is visible from the start */
.section:first-of-type {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.section.visible > * {
  opacity: 0;
  animation: childFadeRise 0.55s cubic-bezier(.18, .89, .32, 1.28) forwards;
  animation-delay: 0.15s;
}
@keyframes childFadeRise {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(.98);
  }
  60% {
    opacity: 1;
    transform: translateY(-4px) scale(1.01); /* slight overshoot */
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* TEXT & ELEMENTS (HEADINGS + H1/H2) */
/* HOME SECTION */
#home {
  margin-top: 20px;
}

.scroll-tip{
  position: relative;
  top: 160px;
  text-align: center;
  opacity: 0.2 !important; 
}

h1,
h2 {
  font-weight: 600;
  margin-bottom: 10px;
}

/* Section-level H2 styling (applies to all section headings) */
#projects h2,
#skills h2,
#contact h2,
#about h2,
#experience h2 {
  font-size: 2rem;
  color: #007bff;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  position: relative;
}

/* underline bar for section headings (shared) */
#experience h2::after,
#projects h2::after,
#skills h2::after,
#contact h2::after,
#about h2::after {
  content: "";
  display: block;
  width: 100%;
  height: 3px;
  background-color: #007bff;
  border-radius: 3px;
  margin-top: 6px;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.highlight {
  color: #007bff;
  text-shadow: 0 5px 10px #007bffa1;
}

.btn {
  padding: 0.8rem 1.5rem;
  border: none;
  background: rgb(20, 20, 20);
  color: #fff;
  border-radius: 2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.705);
  transition: all 0.3s;
  cursor: pointer;
  font-size: 1rem;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.btn:hover {
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 12px black;
}

.btn:after {
  content: "";
  background: #007bff;
  position: absolute;
  z-index: -1;
  left: -20%;
  right: -20%;
  top: 0;
  bottom: 0;
  transform: skewX(-45deg) scale(0, 1);
  transition: all 0.5s;
}

.btn:hover:after {
  transform: skewX(-45deg) scale(1, 1);
  -webkit-transition: all 0.5s;
  transition: all 0.5s;
}

/* CARDS */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px var(--shadow-color);
  transition: all 0.3s;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 25px var(--shadow-color);
}

/* SHARED SECTION LAYOUTS (merged paddings for skills/contact/about/experience) */
#skills,
#contact,
#about,
#experience {
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 1.5rem;
}
#contact{
  gap: 0.7rem;
}

/* ======= SKILLS ========= */

.skills-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  list-style: none;
  margin-top: 1.5rem;
  padding: 0;
}

.skills-list li {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-card, #0a0a0a);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  transition: 0.3s;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  color: var(--text-color);
  z-index: 0;
  overflow: hidden;
}

/* define animatable angle */
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes spin {
  from {
    --angle: 0deg;
  }
  to {
    --angle: 360deg;
  }
}

/* create the actual animated border layer */
.skills-list li::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px; /* border thickness */
  border-radius: 8px;
  background: conic-gradient(from var(--angle), transparent 70%, #007bff);
  animation: spin 3s linear infinite;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: -1;
}

/* dual-color border only when hovered */
.skills-list li:hover::after {
  background: conic-gradient(
    from var(--angle),
    transparent 10%,
    #ff4545,
    #00ff99,
    #006aff,
    #ff0095,
    #ff4545
  );
  animation: spin 2s linear infinite;
}

.skills-list li:hover {
  transform: translateY(-6px);
  box-shadow: 0 4px 10px var(--shadow-color);
  cursor: pointer;
}

.skills-list img {
  display: inline-block;
  vertical-align: middle;
  height: 30px;
}

/* ABOUT SECTION & CONTACT */
#about p {
  background: var(--bg-card);
  color: var(--text-color);
  padding: 1.5rem 2rem;
  border-radius: 12px;
  box-shadow: 0 5px 20px var(--shadow-color);
  line-height: 1.8;
  font-size: 1rem;
  letter-spacing: 0.2px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#about p:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 123, 255, 0.15);
}

.contact-me{
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

#contact a {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  color: var(--text-color);
  font-weight: 500;
  text-decoration: none;
  background: var(--bg-card);
  padding: 0.8rem 1.4rem;
  border-radius: 8px;
  box-shadow: 0 4px 15px var(--shadow-color);
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}


#contact a:hover {
  outline: 3px solid #007bff;
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.25);
  transform: scale(0.90);
}

/* EXPERIENCE SECTION */
#experience h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1rem;
  position: relative;
}

#experience h3::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #007bff;
}

/* Experience List Styling */
.experience-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding-left: 1rem;
  border-left: 3px solid rgba(0, 123, 255, 0.3);
}

.experience-list li {
  background: var(--bg-card);
  color: var(--text-color);
  padding: 1rem 1.2rem;
  border-radius: 8px;
  box-shadow: 0 4px 15px var(--shadow-color);
  line-height: 1.6;
  font-size: 0.95rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.experience-list li:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.2);
}

/*------------------ PROJECT SECTION ---------------------*/
#projects h2 {
  padding: 0 2rem;
}

.card-container{
  display: flex;
  gap: 2rem;
  flex-wrap:wrap;
  justify-content: center;
  padding-top: 50px;
}


.article-wrapper {
  width: 250px;
  -webkit-transition: 0.15s all ease-in-out;
  transition: 0.15s all ease-in-out;
  border-radius: 16px;
  padding: 8px;
  border: 4px solid transparent;
  background-color: var(--bg-card);
  border: 2px solid rgba(0, 0, 0, 0.237);
  box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.267);
}

.article-wrapper:hover {
  -webkit-box-shadow: 10px 10px 0 #4e84ff, 20px 20px 0 #4444bd;
  box-shadow: 10px 10px 0 #4e84ff, 20px 20px 0 #4444bd;
  border-color: #0578c5;
  -webkit-transform: translate(-20px, -20px);
  -ms-transform: translate(-20px, -20px);
  transform: translate(-20px, -20px);
}

.article-wrapper:hover .project-hover {
  -webkit-transform: rotate(-45deg);
  -ms-transform: rotate(-45deg);
  transform: rotate(-90deg);
  background-color: #5656561e;
}

.project-info {
  padding: 10px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  gap: 10px;
}

.project-title {
  font-size: 1.5em;
  font-weight: 500;
  color: var(--text-color);
  white-space: normal;         /* allow wrapping */
  overflow-wrap: break-word;   /* break long words if needed */
  word-break: break-word;

}

.article-wrapper:hover .project-title{
  color: #007bff;
  text-decoration: underline;
}


.flex-pr {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.project-hover {
  flex-shrink: 0;
  border-radius: 100%;
  width: 40px;
  height: 40px;
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

line,
polyline {
  color: #007bff;
}


.container-project {
  width: 100%;
  height: 150px;
  background: gray;
  border-radius: 8px;
  border: 2px solid var(--project-img-border);
  border-right:4px solid var(--project-img-border) ;
  border-bottom: 4px solid var(--project-img-border);
  object-fit: cover;
  object-position: center;
}

.project-info hr {
  width: 100%;
  height: 0.1px;
  border: none;
  background-color: #9c9c9c;
  margin: 0;
}

.description{
  font-size: 0.9rem;
}

.project-name{
  text-decoration: none;
}


/* ---------------project end---------------------- */


/* ENTRY ANIMATIONS: sidebar & main-content from bottom */
body:not(.animate-in) .sidebar-inner,
body:not(.animate-in) .main-content {
  opacity: 0;
  transform: translateY(40px) scale(.96);
}

body.animate-in .sidebar-inner {
  animation: slideBounce 0.9s cubic-bezier(.18, .89, .32, 1.28) forwards;
  animation-delay: 0.1s;
}
body.animate-in .main-content {
  animation: slideBounce 0.9s cubic-bezier(.18, .89, .32, 1.28) forwards;
  animation-delay: 0s;
}

@keyframes slideBounce {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(.96);
  }
  60% {
    opacity: 1;
    transform: translateY(-6px) scale(1.01); /* overshoot */
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* === MODE BUTTON ENTRY ANIMATION === */
.mode-btn {
  opacity: 0;
  transform: translateY(-40px);
}

body.animate-in .mode-btn {
  animation: modeSlideDown 0.7s ease-out forwards;
  animation-delay: 0.6s; /* delay so it comes after sidebar/main */
}

@keyframes modeSlideDown {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === TOGGLE BUTTON ENTRY ANIMATION === */
.toggle-btn {
  opacity: 0;
  transform: translateX(-40px);
}

body.animate-in .toggle-btn {
  animation: toggleSlideIn 0.7s ease-out forwards;
  animation-delay: 0.8s; /* comes slightly after mode-btn */
}

@keyframes toggleSlideIn {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* === NAV LINKS ENTRY ANIMATION === */
.nav-links a {
  opacity: 0;
  transform: translateX(-40px);
}

/* Animate all links when page loads */
body.animate-in .nav-links a {
  animation: navLinkSlideIn 0.6s ease-out forwards;
}

/* Staggered delay for each link */
body.animate-in .nav-links a:nth-child(1) {
  animation-delay: 0.3s;
}
body.animate-in .nav-links a:nth-child(2) {
  animation-delay: 0.45s;
}
body.animate-in .nav-links a:nth-child(3) {
  animation-delay: 0.6s;
}
body.animate-in .nav-links a:nth-child(4) {
  animation-delay: 0.75s;
}
body.animate-in .nav-links a:nth-child(5) {
  animation-delay: 0.9s;
}
body.animate-in .nav-links a:nth-child(6) {
  animation-delay: 1.05s;
}

@keyframes navLinkSlideIn {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* === PROFILE ENTRY ANIMATION (Top → Down) === */
.profile {
  opacity: 0;
  transform: translateY(-50px);
}

body.animate-in .profile {
  animation: profileDropIn 0.8s ease-out forwards;
  animation-delay: 0.2s; /* before nav-links start */
}

@keyframes profileDropIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* RESPONSIVE DESIGN */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    position: absolute;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .toggle-btn {
    display: block;
  }

  .portfolio-card {
    flex-direction: column;
    height: 95vh;
  }

  .main-content {
    padding: 2rem;
  }

  #projects h2 {
    font-size: 1.6rem;
  }
}

@media (max-width: 768px) {
  #skills,
  #contact,
  #experience {
    padding: 2rem 1.2rem;
  }
  #skills h2,
  #contact h2,
  #experience h2 {
    font-size: 1.6rem;
  }
  #experience h3 {
    font-size: 1.1rem;
  }
  .experience-list li {
    font-size: 0.9rem;
    padding: 0.9rem 1rem;
  }
  #about p {
    font-size: 0.80rem;
    padding: 1.2rem 1.4rem;
  }
  #image-track  img {
    width: 40vmin;
    height: 50vmin;
  }

  .main-content{
    padding: 1.5rem;
  }
}
