/*
============================================================
|   PORTFOLIO STYLES - UJJWAL RUPAKHETI (REVISED)          |
|   Theme: Dual Mode, Elite, Interactive, Complete         |
|   VERSION: Updated for hero image and skill bubbles      |
============================================================
*/

/* 1. VARIABLES & THEME SETUP */
:root {
  --font-heading: "Inter", sans-serif;
  --font-name: "Playfair Display", serif;
  --font-body: "Inter", sans-serif;
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  --border-radius: 8px;
  --header-height: 4.5rem;
}
body.dark-mode {
  --bg-color: #0a0a0a;
  --surface-color: #121212;
  --primary-color: #7b2ff7;
  --primary-color-glow: rgba(123, 47, 247, 0.3);
  --text-color: #f0f0f0;
  --text-color-alt: #a0a0a0;
  --border-color: #2a2a2a;
  --grid-color: rgba(255, 255, 255, 0.05);
  --glass-bg: rgba(18, 18, 18, 0.5);
}
body.light-mode {
  --bg-color: #f5f5f7;
  --surface-color: #ffffff;
  --primary-color: #6610f2;
  --primary-color-glow: rgba(102, 16, 242, 0.2);
  --text-color: #1d1d1f;
  --text-color-alt: #515154;
  --border-color: #e0e0e0;
  --grid-color: rgba(0, 0, 0, 0.05);
  --glass-bg: rgba(255, 255, 255, 0.7);
}

/* 2. BASE & REUSABLE COMPONENTS */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  background: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background-color var(--transition-fast),
    color var(--transition-fast);
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-color);
  transition: color var(--transition-fast);
}
a {
  color: var(--primary-color);
  text-decoration: none;
}
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section {
  padding: 6rem 0;
}
.section__header {
  text-align: center;
  margin-bottom: 4rem;
}
.section__title {
  font-size: clamp(2rem, 6vw, 3rem);
  position: relative;
}
.section__title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 2px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  border: 2px solid transparent;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-smooth);
}
.btn--primary {
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 5px 20px var(--primary-color-glow);
}
.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px var(--primary-color-glow);
}
.btn--secondary {
  background: transparent;
  color: var(--text-color-alt);
  border-color: var(--border-color);
}
.btn--secondary:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 3. HEADER & THEME TOGGLE */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: all var(--transition-smooth);
}
.header.scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--header-height);
}
.nav__logo {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-color);
}
.nav__menu-container {
  flex-grow: 1;
  display: flex;
  justify-content: center;
}
.nav__menu {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  list-style-type: none;
}
.nav__link {
  color: var(--text-color-alt);
  font-weight: 500;
  transition: color var(--transition-fast);
}
.nav__link:hover {
  color: var(--text-color);
}
.theme-toggle {
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-color-alt);
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.theme-toggle:hover {
  color: var(--primary-color);
  transform: scale(1.1) rotate(15deg);
}
.theme-toggle .fa-sun {
  display: none;
}
body.light-mode .theme-toggle .fa-sun {
  display: block;
}
body.light-mode .theme-toggle .fa-moon {
  display: none;
}

/* 4. HERO SECTION */
.hero {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.hero__grid-background {
  position: absolute;
  inset: -200px;
  background-image: linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: pan-grid 60s linear infinite;
  z-index: 0;
}
@keyframes pan-grid {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -400px -400px;
  }
}
.hero__container {
  position: relative;
  z-index: 1;
}
.hero__content {
  display: flex;
  align-items: center;
  gap: 2rem;
  animation: zoomOut 1s ease-out;
}
@keyframes zoomOut {
  from {
    transform: scale(1.2);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.hero__text-wrapper {
  flex: 1;
  text-align: left;
}
.hero__name {
  font-family: var(--font-name);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 1rem;
}
.hero__tagline {
  font-family: var(--font-body);
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: var(--text-color-alt);
  margin-bottom: 2rem;
}
#typewriter::after {
  content: "|";
  animation: blink 0.7s infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
.hero__socials {
  display: flex;
  gap: 1.5rem;
}
.hero__socials a {
  font-size: 1.8rem;
  color: var(--text-color-alt);
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.hero__socials a:hover {
  color: var(--primary-color);
  transform: translateY(-3px);
}
.hero__image-wrapper {
  flex: 1;
  position: relative;
  max-width: 400px;
  width: 100%;
}
.hero__photo {
  width: 120%;
  max-width: 150%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}
.hero__skill-bubble {
  position: absolute;
  width: 50px;
  height: 50px;
  background: var(--surface-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  animation: float 6s ease-in-out infinite;
}
.hero__skill-bubble img {
  width: 30px;
  height: 30px;
}
.hero__skill-bubble[data-skill="javascript"] {
  top: 25%;
  left: 15%;
  animation-delay: 0s;
}
.hero__skill-bubble[data-skill="react"] {
  top: 50%;
  left: -5%;
  animation-delay: 1s;
}
.hero__skill-bubble[data-skill="photoshop"] {
  top: 25%;
  right: -5%;
  animation-delay: 2s;
}
.hero__skill-bubble[data-skill="python"] {
  top: 75%;
  right: -5%;
  animation-delay: 3s;
}
.hero__skill-bubble[data-skill="java"] {
  bottom: 15%;
  left: 10%;
  animation-delay: 4s;
}
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* ABOUT SECTION */
.about__container {
  max-width: 800px;
  text-align: center;
}
.about__description {
  color: var(--text-color-alt);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

/* 5. SKILLS MARQUEE */
.skills {
  background-color: var(--surface-color);
}
.skills__marquee {
  padding: 1rem 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 15%,
    black 85%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    black 15%,
    black 85%,
    transparent
  );
}
.skills__marquee-content {
  display: flex;
  gap: 3.5rem;
  animation: marquee-scroll 20s linear infinite;
}
.skill-item {
  position: relative;
  flex-shrink: 0;
}
.skill-item img {
  height: 50px;
  transition: all var(--transition-fast);
  filter: grayscale(1) opacity(0.8);
}
.skill-item:hover img {
  transform: scale(1.2);
  filter: grayscale(0) opacity(1);
}
#skill-tooltip {
  position: fixed;
  transform: translateX(-50%);
  color: var(--text-color-alt);
  font-size: 0.9rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 9999;
  text-shadow: 0 0 5px var(--bg-color);
}
@keyframes marquee-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* 6. EXPERIENCE TABS */
.experience__container {
  display: flex;
  gap: 3rem;
  max-width: 900px;
  margin: auto;
}
.experience__tabs {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.experience__tab-btn {
  background: none;
  border: none;
  color: var(--text-color-alt);
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  font-size: 1rem;
  position: relative;
  transition: color var(--transition-fast);
  border-left: 2px solid var(--border-color);
}
.experience__tab-btn.active {
  color: var(--primary-color);
  border-left-color: var(--primary-color);
}
.experience__content {
  flex-grow: 1;
}
.experience__panel {
  display: none;
  animation: fadeIn 0.5s;
}
.experience__panel.active {
  display: block;
}
.experience__title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.experience__company {
  color: var(--primary-color);
}
.experience__date {
  color: var(--text-color-alt);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.experience__duties {
  list-style: none;
}
.experience__duties li {
  color: var(--text-color-alt);
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
  position: relative;
}
.experience__duties li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--primary-color);
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 7. PROJECT SECTION */
.projects__grid,
.certificates__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  justify-content: center;
  gap: 1.5rem;
}
.project-card {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.project-card__image-wrapper {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.project-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}
.project-card__content {
  position: relative;
  z-index: 2;
  height: 320px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(
    180deg,
    transparent 60%,
    rgba(0, 0, 0, 0.85) 100%
  );
}
.project-card__text-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.project-card__title {
  font-size: 1.5rem;
  color: #fff;
  text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.8);
  position: absolute;
  bottom: 1rem;
  width: 100%;
  text-align: center;
  transition: opacity var(--transition-smooth);
}
.project-card__info {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-smooth), transform var(--transition-smooth);
  text-align: center;
}
.project-card__tech {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.project-card__tech span {
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  padding: 0.3rem 0.7rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.project-card__description {
  font-size: 0.9rem;
  color: #fff;
}
.project-card__link {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 4;
  font-size: 1.5rem;
  color: #fff;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
  transition: all var(--transition-fast);
}
.project-card__link:hover {
  color: var(--primary-color);
  transform: scale(1.1);
}
.project-card:hover {
  box-shadow: 0 0 30px var(--primary-color-glow);
  border-color: var(--primary-color);
}
.project-card:hover .project-card__image {
  transform: scale(1.05);
}
.project-card:hover .project-card__title {
  opacity: 0;
}
.project-card:hover .project-card__info {
  opacity: 1;
  transform: translateY(0);
}

/* 8. CERTIFICATE SECTION */
.cert-card {
  position: relative;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
}
.cert-card::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    var(--primary-color-glow) 0%,
    transparent 60%
  );
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
  transition: transform 0.6s var(--transition-smooth),
    opacity 0.6s var(--transition-smooth);
}
.cert-card:hover {
  border-color: var(--primary-color);
}
.cert-card:hover::before {
  opacity: 1;
  transform: translate(-25%, -25%) scale(1);
}
.cert-card__info {
  position: relative;
  z-index: 1;
}
.cert-card h3 {
  font-size: 1.25rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
  transition: color var(--transition-fast);
}
.cert-card p {
  color: var(--text-color-alt);
  font-size: 0.9rem;
}
.cert-card__icon {
  position: absolute;
  top: 5rem;
  right: 0rem;
  font-size: 2.5rem;
  color: var(--text-color-alt);
  opacity: 0.5;
  transition: color var(--transition-fast), transform var(--transition-fast);
  z-index: 1;
}
.cert-card:hover .cert-card__icon {
  color: var(--primary-color);
  transform: scale(1.1);
}
.cert-card:hover h3 {
  color: var(--text-color);
}
.section__actions {
  text-align: center;
  margin-top: 3rem;
}

/* SHOW MORE ANIMATION */
.project-card,
.cert-card {
  transition: max-height 0.7s cubic-bezier(0.23, 1, 0.32, 1),
    opacity 0.5s ease-in-out,
    margin-top 0.7s cubic-bezier(0.23, 1, 0.32, 1),
    padding-top 0.7s cubic-bezier(0.23, 1, 0.32, 1),
    padding-bottom 0.7s cubic-bezier(0.23, 1, 0.32, 1),
    border-width 0.7s cubic-bezier(0.23, 1, 0.32, 1),
    min-height 0.7s cubic-bezier(0.23, 1, 0.32, 1);
  max-height: 500px;
  opacity: 1;
  overflow: hidden;
}
.project-card.hidden,
.cert-card.hidden {
  max-height: 0;
  opacity: 0;
  min-height: 0;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-width: 0 !important;
}

/* 9. EDUCATION */
.education__accordion {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.education__item {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}
.education__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  cursor: pointer;
}
.education__header i:first-child {
  color: var(--primary-color);
  font-size: 1.5rem;
}
.education__title {
  flex-grow: 1;
}
.education__status {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-left: auto;
  margin-right: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.education__status--current {
  background-color: var(--primary-color);
  color: #fff;
}
.education__status--completed {
  background-color: var(--border-color);
  color: var(--text-color-alt);
}
.education__arrow {
  transition: transform 0.3s;
}
.education__item.active .education__arrow {
  transform: rotate(180deg);
}
.education__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}
.education__body p {
  padding: 0 1.5rem 0.5rem 1.5rem;
  color: var(--text-color-alt);
}
.education__body p:last-child {
  padding-bottom: 1.5rem;
}
.education__item.active .education__body {
  max-height: 200px;
}

/* 10. CONTACT, FOOTER, MODALS */
.contact {
  background-color: var(--surface-color);
}
.contact__container {
  text-align: center;
  max-width: 600px;
}
.contact__title {
  font-size: clamp(2rem, 6vw, 3rem);
  margin-bottom: 1rem;
}
.contact__text {
  color: var(--text-color-alt);
  margin-bottom: 2.5rem;
  font-size: 1.1rem;
}
.footer {
  padding: 3rem 1.5rem;
  text-align: center;
}
.footer__socials {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.footer__socials a {
  font-size: 1.5rem;
  color: var(--text-color-alt);
  transition: color 0.2s, transform 0.2s;
}
.footer__socials a:hover {
  color: var(--primary-color);
  transform: translateY(-3px);
}
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.modal.active {
  opacity: 1;
  visibility: visible;
}
.modal__close {
  position: fixed;
  top: 2rem;
  right: 2rem;
  font-size: 2.5rem;
  color: var(--text-color-alt);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1002;
  transition: transform 0.2s, color 0.2s;
}
.modal__close:hover {
  color: var(--primary-color);
  transform: rotate(90deg);
}
.modal__content {
  position: relative;
  background: var(--surface-color);
  padding: 3rem;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 500px;
  border: 1px solid var(--border-color);
}
#certificate-modal .modal__image {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--border-radius);
}
.modal__title {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 2rem;
}
.modal__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.modal__option {
  padding: 0.75rem;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color-alt);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s;
}
.modal__option:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}
.modal__option.selected {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}
.modal__input {
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-color);
  font-size: 1rem;
  margin-bottom: 0.5rem;
  transition: all var(--transition-fast);
}
.modal__input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-color-glow);
}
.modal__error {
  color: #ff4d4d;
  text-align: center;
  height: 1.2rem;
}
.modal__content--thanks {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.modal__content--thanks .fa-check-circle {
  font-size: 3rem;
  color: #28a745;
}
#send-email-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 11. RESPONSIVE DESIGN */
@media (max-width: 992px) {
  .nav__menu {
    display: none;
  }
  .hero__content {
    flex-direction: column;
    text-align: center;
  }
  .hero__image-wrapper {
    order: -1;
    margin: 0 auto;
    max-width: 300px;
  }
  .hero__text-wrapper {
    order: 0;
    text-align: center;
  }
  .hero__socials {
    justify-content: center;
  }
  .hero__skill-bubble {
    width: 40px;
    height: 40px;
  }
  .hero__skill-bubble img {
    width: 24px;
    height: 24px;
  }
  .hero__skill-bubble[data-skill="javascript"] {
    top: 10%;
    left: -10%;
  }
  .hero__skill-bubble[data-skill="react"] {
    top: 90%;
    left: -10%;
  }
  .hero__skill-bubble[data-skill="photoshop"] {
    top: 20%;
    right: -10%;
  }
  .hero__skill-bubble[data-skill="python"] {
    top: 80%;
    right: -10%;
  }
  .hero__skill-bubble[data-skill="java"] {
    bottom: 10%;
    left: -5%;
  }
}
@media (max-width: 768px) {
  .experience__container {
    flex-direction: column;
  }
  .experience__tabs {
    flex-direction: row;
    overflow-x: auto;
  }
}
@media (max-width: 480px) {
  .hero__image-wrapper {
    max-width: 250px;
  }
  .modal__options {
    grid-template-columns: 1fr;
  }
}