/* ===== GLOBAL STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(to bottom right, #FED9B7, #00AFB9, #0081A7);
  color: #333;
  text-align: center;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

section {
  padding: 80px 20px;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

h2 {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 50px;
  color: #0081A7;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 4px;
  background: #F07167;
  border-radius: 2px;
}

/* ===== NAVIGATION - PERBAIKAN BUG 1 ===== */
.navbar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 129, 167, 0.2);
  border-radius: 50px;
  padding: 12px 30px;
  box-shadow: 0 8px 32px rgba(0, 129, 167, 0.1);
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar:hover {
  box-shadow: 0 12px 40px rgba(0, 129, 167, 0.2);
}

.nav-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.nav-links li {
  display: inline-block;
}

.nav-links a {
  text-decoration: none;
  color: #0081A7;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  padding: 8px 18px;
  border-radius: 25px;
  position: relative;
}

.nav-links a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 175, 185, 0.1), transparent);
  transition: 0.5s;
}

.nav-links a:hover::before {
  left: 100%;
}

.nav-links a:hover {
  background: rgba(0, 175, 185, 0.1);
  color: #F07167;
}

.nav-links a.active {
  background: #00AFB9;
  color: white;
  font-weight: 600;
}

/* ===== HERO SECTION ===== */
.hero {
  background: linear-gradient(135deg, #FED9B7 0%, #00AFB9 50%, #0081A7 100%);
  color: white;
  text-align: center;
  background-position-y: 0px;padding-top: 90px;  overflow: hidden;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.05)"/></svg>');
  background-size: cover;
}

.profile-pic {
  margin-bottom: 30px;
  position: relative;
  z-index: 2;
}

.profile-pic img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.profile-pic img:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.6);
}

.name {
  font-size: 3.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: white;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2;
}

.role {
  font-size: 1.8rem;
  color: rgba(255, 255, 255, 0.9);
  height: 45px;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}

.cursor {
  display: inline-block;
  margin-left: 3px;
  animation: blink 0.7s infinite;
  color: #F07167;
}

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

.desc {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 40px;
  max-width: 700px;
  line-height: 1.6;
  position: relative;
  z-index: 2;
}

/* ===== BUTTONS ===== */
.buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}

.btn {
  padding: 14px 32px;
  border-radius: 30px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 180px;
}

.btn i {
  font-size: 1.1rem;
}

.primary {
  background: #F07167;
  color: white;
  border: 2px solid #F07167;
}

.primary:hover {
  background: transparent;
  color: #F07167;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(240, 113, 103, 0.3);
}

.secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.secondary:hover {
  background: white;
  color: #0081A7;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.3);
}

/* ===== SOCIAL LINKS ===== */
.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  position: relative;
  z-index: 2;
}

.icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: white;
  transition: all 0.3s ease;
  text-decoration: none;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.icon:hover {
  transform: translateY(-5px) scale(1.1);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.email:hover { color: #F07167; }
.linkedin:hover { color: #0077B5; }
.github:hover { color: #333; }
.instagram:hover { color: #E4405F; }

/* ===== ABOUT SECTION ===== */
.about {
  background: linear-gradient(to bottom right, #FED9B7, white);
}

.about-content {
  max-width: 900px;
  text-align: left;
  line-height: 1.8;
}

.about-content p {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 25px;
}

.about-content strong {
  color: #0081A7;
}

.academic-info {
  background: rgba(0, 175, 185, 0.1);
  padding: 15px;
  border-radius: 15px;
  border-left: 5px solid #00AFB9;
  margin-top: 10px;
}

.academic-info h3 {
  color: #0081A7;
  margin-bottom: 0px;
  font-size: 1.4rem;
}

.academic-info ul {
  list-style: none;
  padding-left: 20px;
}

.academic-info li {
  padding: 0px 0;
  position: relative;
  color: #555;
}

.academic-info li::before {
  content: '▸';
  color: #F07167;
  font-weight: bold;
  position: absolute;
  left: -20px;
}

/* ===== PROJECTS SECTION ===== */
.projects {
  background: linear-gradient(to bottom right, white, #FED9B7);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  max-width: 1400px;
  margin: 0 auto;
}

.project-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
  border: 1px solid rgba(0, 175, 185, 0.1);
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 129, 167, 0.15);
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #F07167, #00AFB9, #0081A7);
}

.project-category {
  position: absolute;
  top: 15px;
  left: 15px;
  background: #0081A7;
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 2;
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid #eee;
}

.project-card h3 {
  font-size: 1.4rem;
  color: #0081A7;
  margin: 50px 20px 20px 20px;
  text-align: left;
}

.project-desc {
  font-size: 0.95rem;
  color: #666;
  margin: 0 20px 15px;
  text-align: left;
  line-height: 1.6;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 20px 20px;
  text-align: left;
}

.project-tech span {
  background: rgba(0, 175, 185, 0.1);
  color: #0081A7;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 500;
}

.project-link {
  display: block;
  margin: 0 20px 20px;
  padding: 10px 0;
  background: #00AFB9;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: center;
}

.project-link:hover {
  background: #0081A7;
  transform: scale(1.02);
}

/* ===== SKILLS SECTION ===== */
.skills {
  background: linear-gradient(to bottom right, #00AFB9, #0081A7);
  color: white;
}

.skills h2 {
  color: white;
}

.skills h2::after {
  background: #FED9B7;
}

.skills-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  height: 200px;
  margin: 20px 0;
}

.slide-track {
  display: flex;
  width: calc(250px * 16);
  animation: scroll 20s linear infinite;
  height: 100%;
  align-items: center;
}

.skill-item {
  width: 220px;
  margin: 0 15px;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.skill-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-5px);
}

.skill-item img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 15px;
  filter: brightness(0) invert(1);
}

.skill-item p {
  font-size: 1rem;
  font-weight: 500;
  color: white;
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-220px * 8));
  }
}

/* ===== EXPERIENCE SECTION ===== */
.experience {
  background: linear-gradient(to bottom right, #FED9B7, white);
}

.timeline {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 6px;
  background: linear-gradient(to bottom, #F07167, #00AFB9, #0081A7);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -3px;
  border-radius: 3px;
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
  box-sizing: border-box;
}

.timeline-item::after {
  content: '';
  position: absolute;
  width: 25px;
  height: 25px;
  background: white;
  border: 4px solid #00AFB9;
  border-radius: 50%;
  top: 20px;
  z-index: 1;
}

.timeline-item.left {
  left: 0;
  text-align: right;
}

.timeline-item.left::after {
  right: -12px;
}

.timeline-item.right {
  left: 50%;
  text-align: left;
}

.timeline-item.right::after {
  left: -12px;
}

.timeline-content {
  padding: 25px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0, 129, 167, 0.1);
  border: 1px solid rgba(0, 175, 185, 0.1);
  position: relative;
  transition: all 0.3s ease;
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 129, 167, 0.15);
}

.timeline-content h3 {
  color: #0081A7;
  margin-bottom: 8px;
  font-size: 1.3rem;
}

.timeline-content .role {
  color: #F07167;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 1rem;
  height: auto;
}

.timeline-content p {
  color: #666;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* ===== CONTACT SECTION ===== */
.contact {
  background: linear-gradient(to bottom right, #0081A7, #00AFB9);
  color: white;
}

.contact h2 {
  color: white;
}

.contact h2::after {
  background: #FED9B7;
}

.contact p {
  font-size: 1.1rem;
  max-width: 700px;
  margin-bottom: 50px;
  opacity: 0.9;
}

.contact-options {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

.contact-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 30px;
  width: 320px;
  transition: all 0.3s ease;
}

.contact-card:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-10px);
}

.contact-icon {
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.8rem;
}

.contact-card h3 {
  color: white;
  margin-bottom: 10px;
  font-size: 1.5rem;
}

.contact-card p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 20px;
  font-size: 1rem;
}

.contact-btn {
  display: inline-block;
  padding: 12px 25px;
  background: #F07167;
  color: white;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid #F07167;
}

.contact-btn:hover {
  background: transparent;
  color: #F07167;
  transform: scale(1.05);
}

/* ===== FOOTER ===== */
.footer {
  background: linear-gradient(to right, #0081A7, #005f73);
  color: white;
  padding: 30px 20px;
  text-align: center;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
}

.footer p {
  margin: 10px 0;
  opacity: 0.9;
}

.footer-links {
  margin-top: 20px;
}

.footer-links a {
  color: #FED9B7;
  text-decoration: none;
  margin: 0 10px;
  transition: all 0.3s ease;
}

.footer-links a:hover {
  color: #F07167;
  text-decoration: underline;
}

/* ===== CERTIFICATES SECTION ===== */
.certificates {
  background: linear-gradient(to bottom right, #0081A7, #00AFB9);
}

.certificates h2 {
  color: white;
}

.certificates h2::after {
  background: #FED9B7;
}

.certificates-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  height: 280px;
  margin: 20px 0;
  border-radius: 15px;
}

.certificates-track {
  display: flex;
  width: calc(300px * 16); /* 8 original + 8 duplicate */
  height: 100%;
  align-items: center;
  animation: scroll-certificates 20s linear infinite;
  animation-direction: normal; /* dari kiri ke kanan */
}

.certificate-item {
  width: 400px;
  height: 283px;
  margin: 0 20px;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.4s ease;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.certificate-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
  border-radius: 10px;
}

.certificate-item:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 20px 40px rgba(0, 129, 167, 0.3);
  z-index: 10;
}

.certificate-item:hover img {
  transform: scale(1.05);
}

.certificate-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 129, 167, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 10px;
  color: white;
}

.certificate-item:hover .certificate-overlay {
  opacity: 1;
}

.certificate-overlay i {
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: #FED9B7;
}

.certificate-overlay span {
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  padding: 0 15px;
}

/* Fallback jika gambar gagal load */
.certificate-item::before {
  content: '\f15c';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  font-size: 3rem;
  color: #00AFB9;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  opacity: 0;
  z-index: 1;
}

.certificate-item img:not([src]), 
.certificate-item img[src=""], 
.certificate-item img.error {
  display: none;
}

.certificate-item img:not([src]) + .certificate-overlay,
.certificate-item img[src=""] + .certificate-overlay,
.certificate-item img.error + .certificate-overlay {
  opacity: 1;
  background: rgba(0, 175, 185, 0.9);
}

/* Animasi scroll untuk certificates (kiri ke kanan) */
@keyframes scroll-certificates {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-280px * 8)); /* Move by half (8 items) */
  }
}

/* Pause animation on hover */
.certificates-slider:hover .certificates-track {
  animation-play-state: paused;
}

/* ===== SMOOTH CERTIFICATES LOOP FIX ===== */
.certificates {
  position: relative;
  overflow: hidden;
}

.certificates-slider::after {
  content: '';
  position: absolute;
  top: 0;
  width: 150px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* Smooth transition at the end of animation */
@keyframes scroll-certificates {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-280px * 8));
  }
}

/* Pause animation at the end for a moment before reset */
.certificates-track {
  animation: scroll-certificates 20s linear infinite;
  animation-fill-mode: forwards;
}

/* JavaScript-controlled smooth reset */
.certificates-track.paused {
  animation-play-state: paused;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 992px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .timeline::after {
    left: 31px;
  }
  
  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }
  
  .timeline-item.right {
    left: 0;
  }
  
  .timeline-item.left::after,
  .timeline-item.right::after {
    left: 19px;
  }
  
  .timeline-item.left {
    text-align: left;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 10px 20px;
  }
  
  .nav-links {
    gap: 10px;
  }
  
  .nav-links a {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
  
  .name {
    font-size: 2.5rem;
  }
  
  .role {
    font-size: 1.4rem;
  }
  
  h2 {
    font-size: 2.2rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-options {
    flex-direction: column;
    align-items: center;
  }
  
  .contact-card {
    width: 100%;
    max-width: 400px;
  }
  
  .buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .name {
    font-size: 2rem;
  }
  
  .role {
    font-size: 1.2rem;
  }
  
  section {
    padding: 60px 15px;
  }
  
  .profile-pic img {
    width: 150px;
    height: 150px;
  }
  
  .social-links {
    gap: 15px;
  }
  
  .icon {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }
}