* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --secondary: #8b5cf6;
  --dark: #0f172a;
  --light: #f8fafc;
  --gray: #64748b;
}

/* Prevent zoom on form inputs on mobile and improve touch experience */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 8px;
  }

  /* Ensure touch targets are at least 44px */
  .btn,
  .nav-menu a,
  .contact-form input,
  .contact-form textarea,
  .cert-link,
  .see-more-btn {
    min-height: 44px;
  }

  /* Improve tap targets */
  .skill-card,
  .project-card,
  .achievement-card,
  .cert-card {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.1);
  }
}

/* Smooth scrolling optimization for mobile */
html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--dark);
  color: var(--light);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1rem 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--light);
  text-decoration: none;
}

.logo span {
  color: var(--primary);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-menu a {
  color: var(--light);
  text-decoration: none;
  transition: color 0.3s;
}

.nav-menu a:hover {
  color: var(--primary);
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 2rem;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.hero-content {
  text-align: center;
  z-index: 1;
  background: none;
}

.hero-animation {
  position: absolute;
  left: 5%;
  bottom: 2%;
  z-index: 0;
  filter: hue-rotate(240deg) saturate(1.2) brightness(0.9);
  mix-blend-mode: screen;
}

#lottie-rocket {
  width: 350px;
  height: 350px;
  opacity: 0.4;
}

@media (max-width: 1024px) {
  .hero-animation {
    opacity: 0.25;
    left: 2%;
    filter: hue-rotate(240deg) saturate(1.5) brightness(0.7);
  }

  #lottie-rocket {
    width: 250px;
    height: 250px;
  }
}

@media (max-width: 768px) {
  .hero-animation {
    display: none;
  }
}

.glitch {
  font-size: 4rem;
  font-weight: bold;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.subtitle {
  font-size: 1.5rem;
  color: var(--gray);
  margin-bottom: 2rem;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 0.8rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: white;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 5rem 0;
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 3rem;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.about {
  background: rgba(30, 41, 59, 0.5);
}

.about-content {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 3rem;
  align-items: center;
}

.about-photo {
  text-align: center;
}

.profile-img {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 4px solid var(--primary);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
  transition: all 0.3s ease;
}

.profile-img:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
}

.about-text p {
  font-size: 1.1rem;
  color: var(--gray);
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .profile-img {
    width: 200px;
    height: 200px;
  }
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.skill-card {
  background: rgba(30, 41, 59, 0.5);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  transition: all 0.3s;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.skill-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.skill-card i {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.skill-card h3 {
  margin-bottom: 0.5rem;
}

.skill-card p {
  color: var(--gray);
}

.education {
  background: rgba(30, 41, 59, 0.5);
}

.education-timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 0;
}

.education-timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.education-item {
  position: relative;
  margin-bottom: 3rem;
  display: flex;
  justify-content: flex-end;
  width: 50%;
}

.education-item:nth-child(even) {
  align-self: flex-end;
  justify-content: flex-start;
  margin-left: 50%;
}

.education-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: var(--primary);
  border: 4px solid var(--dark);
  border-radius: 50%;
  z-index: 1;
}

.education-item:nth-child(even) .education-dot {
  left: -10px;
}

.education-item:nth-child(odd) .education-dot {
  right: -10px;
  left: auto;
}

.education-content {
  background: rgba(15, 23, 42, 0.8);
  padding: 1.5rem;
  border-radius: 15px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  width: calc(100% - 40px);
  transition: all 0.3s;
}

.education-content:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.education-date {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.education-content h3 {
  margin-bottom: 0.3rem;
  font-size: 1.3rem;
}

.education-content h4 {
  color: var(--gray);
  font-weight: 500;
  margin-bottom: 0.8rem;
  font-size: 1rem;
}

.education-grade {
  color: var(--primary);
  font-weight: 600;
  font-size: 1rem;
}

@media (max-width: 768px) {
  .education-timeline::before {
    left: 20px;
  }

  .education-item,
  .education-item:nth-child(even) {
    width: 100%;
    margin-left: 0;
    padding-left: 50px;
  }

  .education-dot,
  .education-item:nth-child(even) .education-dot,
  .education-item:nth-child(odd) .education-dot {
    left: 11px;
    right: auto;
  }
}

.experience {
  background: rgba(30, 41, 59, 0.5);
}

.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  display: flex;
  justify-content: flex-end;
  width: 50%;
}

.timeline-item:nth-child(even) {
  align-self: flex-end;
  justify-content: flex-start;
  margin-left: 50%;
}

.timeline-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: var(--primary);
  border: 4px solid var(--dark);
  border-radius: 50%;
  z-index: 1;
}

.timeline-item:nth-child(even) .timeline-dot {
  left: -10px;
}

.timeline-item:nth-child(odd) .timeline-dot {
  right: -10px;
  left: auto;
}

.timeline-content {
  background: rgba(15, 23, 42, 0.8);
  padding: 1.5rem;
  border-radius: 15px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  width: calc(100% - 40px);
  transition: all 0.3s;
}

.timeline-content:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.timeline-date {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.timeline-content h3 {
  margin-bottom: 0.3rem;
  font-size: 1.3rem;
}

.timeline-content h4 {
  color: var(--gray);
  font-weight: 500;
  margin-bottom: 0.8rem;
  font-size: 1rem;
}

.timeline-content p {
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

.timeline-content ul {
  list-style: none;
  padding: 0;
}

.timeline-content ul li {
  color: var(--gray);
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.5rem;
}

.timeline-content ul li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--primary);
}

@media (max-width: 768px) {
  .timeline::before {
    left: 20px;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    width: 100%;
    margin-left: 0;
    padding-left: 50px;
  }

  .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot,
  .timeline-item:nth-child(odd) .timeline-dot {
    left: 11px;
    right: auto;
  }
}

.projects {
  background: rgba(30, 41, 59, 0.5);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  background: rgba(15, 23, 42, 0.8);
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.3s;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.3);
}

.project-image {
  height: 200px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  position: relative;
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-link {
  color: white;
  font-size: 2rem;
  text-decoration: none;
}

.project-info {
  padding: 1.5rem;
}

.project-info h3 {
  margin-bottom: 0.5rem;
}

.project-info p {
  color: var(--gray);
  margin-bottom: 1rem;
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.project-tags span {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
}

.achievements {
  background: rgba(30, 41, 59, 0.5);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.achievement-card {
  background: rgba(15, 23, 42, 0.8);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  transition: all 0.3s;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.achievement-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.achievement-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.achievement-icon i {
  font-size: 2rem;
  color: white;
}

.achievement-card h3 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.achievement-card p {
  color: var(--gray);
  line-height: 1.6;
}

.certifications {
  background: rgba(30, 41, 59, 0.5);
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.cert-card {
  background: rgba(15, 23, 42, 0.8);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  transition: all 0.3s;
  border: 1px solid rgba(99, 102, 241, 0.2);
  position: relative;
}

.cert-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.cert-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cert-icon i {
  font-size: 2rem;
  color: white;
}

.cert-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cert-issuer {
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.cert-date {
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.cert-link {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--primary);
  border-radius: 20px;
  transition: all 0.3s;
}

.cert-link:hover {
  background: var(--primary);
  color: white;
}

.cert-card.hidden {
  display: none;
}

.cert-footer {
  text-align: center;
  padding: 2rem;
}

.see-more-btn {
  cursor: pointer;
  border: none;
}

.contact-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  max-width: 900px;
  margin: 0 auto;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.1rem;
}

.contact-item i {
  color: var(--primary);
  font-size: 1.5rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea {
  padding: 1rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  color: var(--light);
  font-family: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.contact {
  background: rgba(30, 41, 59, 0.5);
}

footer {
  text-align: center;
  padding: 2rem;
  background: rgba(15, 23, 42, 0.95);
  color: var(--gray);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
  min-height: 44px; /* Apple touch target size */
  justify-content: center;
  align-items: center;
}

.bar {
  width: 25px;
  height: 3px;
  background: var(--light);
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.mobile-menu-toggle.active .bar:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active .bar:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .bar:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    left: -100%;
    top: 70px;
    flex-direction: column;
    background-color: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    padding: 2rem 0;
    gap: 0;
    z-index: 1000;
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-menu li {
    margin: 1rem 0;
  }

  .nav-menu a {
    display: block;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
  }

  .nav-menu a:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
  }

  .glitch {
    font-size: 2.5rem;
  }

  .subtitle {
    font-size: 1.2rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .container {
    padding: 0 1rem;
  }

  section {
    padding: 3rem 0;
  }

  .hero {
    padding: 1rem;
    text-align: center;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
  }

  .btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    width: 90%;
    max-width: 280px;
  }

  .about-content,
  .contact-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .projects-grid,
  .achievements-grid,
  .cert-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .education-timeline::before,
  .timeline::before {
    left: 20px;
  }

  .education-item,
  .education-item:nth-child(even),
  .timeline-item,
  .timeline-item:nth-child(even) {
    width: 100%;
    margin-left: 0;
    padding-left: 50px;
    justify-content: flex-start;
    align-self: flex-start;
  }

  .education-dot,
  .education-item:nth-child(even) .education-dot,
  .education-item:nth-child(odd) .education-dot,
  .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot,
  .timeline-item:nth-child(odd) .timeline-dot {
    left: 11px;
    right: auto;
  }

  .education-content,
  .timeline-content {
    width: calc(100% - 30px);
    padding: 1rem;
  }

  .profile-img {
    width: 200px;
    height: 200px;
  }

  .hero-animation {
    display: block;
    position: relative;
    right: auto;
    bottom: auto;
    margin: 2rem auto 0;
    opacity: 0.6;
    filter: hue-rotate(240deg) saturate(1.2) brightness(0.8);
  }

  #lottie-rocket {
    width: 200px;
    height: 200px;
    opacity: 0.6;
  }
}

@media (max-width: 480px) {
  .glitch {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .profile-img {
    width: 180px;
    height: 180px;
  }

  .hero-animation {
    margin: 1.5rem auto 0;
  }

  #lottie-rocket {
    width: 150px;
    height: 150px;
    opacity: 0.5;
  }

  .skill-card,
  .project-card,
  .achievement-card,
  .cert-card {
    padding: 1.5rem;
  }

  .contact-item {
    font-size: 1rem;
  }

  .contact-form input,
  .contact-form textarea {
    padding: 0.8rem;
  }
}

/* Chat Assistant Notification */
.chat-notification {
  position: fixed;
  bottom: 100px;
  right: 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(99, 102, 241, 0.3);
  padding: 1rem 1.2rem;
  z-index: 999;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  transition: all 0.3s ease;
  cursor: pointer;
  max-width: 320px;
  animation: pulse 2s ease-in-out infinite;
}

.chat-notification.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chat-notification:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 15px 50px rgba(99, 102, 241, 0.4);
}

.chat-notification-content {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  position: relative;
}

.chat-notification-icon {
  font-size: 2rem;
  animation: bounce 1s ease-in-out infinite;
}

.chat-notification-text {
  flex: 1;
  color: white;
}

.chat-notification-text strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.chat-notification-text p {
  font-size: 0.9rem;
  margin: 0;
  opacity: 0.95;
}

.chat-notification-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
  padding: 0;
}

.chat-notification-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.3);
  }
  50% {
    box-shadow: 0 10px 50px rgba(99, 102, 241, 0.5);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@media (max-width: 768px) {
  .chat-notification {
    bottom: 80px;
    right: 15px;
    left: 15px;
    max-width: calc(100% - 30px);
  }

  .chat-notification-text strong {
    font-size: 0.95rem;
  }

  .chat-notification-text p {
    font-size: 0.85rem;
  }
}
