/* === GLOBAL RESET & FONT === */
/* Reset dan font global */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

* {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  background: var(--bg-light);
  color: var(--text-light);
  line-height: 1.6;
  transition: background 0.5s ease, color 0.5s ease;
}

/* === THEME VARIABLES === */
:root {
  --bg-light: #f4f7f9;
  --bg-dark: #1a202c;
  --text-light: #2d3748;
  --text-dark: #e2e8f0;
  --card-light: #ffffff;
  --card-dark: #2d3748;
  --accent: #4ca1af;
  --primary: #2c3e50;
  --hover: #5eb9c7;
  --light-border: #e2e8f0;
  --dark-bg: #2d3748;
  --dark-border: #4a5568;
  --accent-color: #4ca1af;
}

/* === DARK MODE === */
body.dark-theme {
  background: var(--bg-dark);
  color: var(--text-dark);
}

body.dark-theme h2 {
  color: var(--text-dark);
}

body.dark-theme a {
  color: var(--accent);
}
body.dark-theme a:hover {
  color: #ffffff;
}

body.dark-theme section {
  background-color: var(--card-dark);
  border: 1px solid var(--dark-border);
}

body.dark-theme header {
  background: var(--primary);
}

body.dark-theme footer {
  background-color: var(--primary);
  color: #a0aec0;
}

/* === HEADER === */
header {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  text-align: center;
  padding: 2rem 1rem;
  position: relative;
}

.profil-img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: block;
  border: 4px solid white;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}
.profil-img:hover {
  transform: scale(1.05);
}

/* === NAVIGATION === */
nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0;
  margin: 1rem 0 0;
}

nav ul li {
  margin: 0.5rem;
}

nav ul li a {
  background-color: rgba(255, 255, 255, 0.15);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s ease, color 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
nav ul li a:hover {
  background-color: #fff;
  color: var(--primary);
}

/* === SECTIONS === */
section {
  padding: 2.5rem 2rem;
  max-width: 1000px;
  margin: 1.5rem auto;
  background-color: var(--card-light);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  transition: background-color 0.5s ease;
  border: 1px solid #e2e8f0;
}

h2 {
  color: var(--primary);
  margin-top: 0;
  font-size: 1.8rem;
  font-weight: 700;
  position: relative;
  margin-bottom: 1.5rem;
}
h2::after {
  content: '';
  display: block;
  width: 50px;
  height: 4px;
  background-color: var(--accent);
  margin-top: 0.5rem;
  border-radius: 2px;
}

/* === LISTS === */
ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
ul li {
  margin-bottom: 0.6rem;
}

/* === PORTFOLIO GRID === */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.item {
  background-color: var(--card-light);
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.5s ease, opacity 0.4s ease;
  position: relative;
  cursor: pointer;
  border: 1px solid #e2e8f0;
}
.item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.1);
}

.item h3 {
  margin-top: 0;
}

.hover-info {
  font-size: 0.8rem;
  color: #999;
  transition: opacity 0.3s ease;
}

.info-box {
  display: none;
  font-size: 0.9rem;
  color: #333;
}

.item:hover .hover-info {
  opacity: 0;
}

.item:hover .info-box {
  display: block;
}

body.dark-theme .info-box {
    color: var(--text-dark);
}

/* === TYPING TEXT CURSOR === */
#typingText {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
  height: 2rem;
}
#typingText::after {
  content: "|";
  animation: blink 1s infinite;
  color: var(--accent);
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* === LINKS === */
a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}
a:hover {
  color: var(--primary);
}

/* === FOOTER === */
footer {
  background-color: #e2e8f0;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.9rem;
  color: #4a5568;
  transition: background-color 0.5s ease, color 0.5s ease;
}

/* === UI BUTTONS (THEME, LANG, SCROLL) === */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 999;
}

.language-switch {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  display: flex;
  gap: 0.5rem;
}

#toggleBtn, .language-switch button {
  background-color: #fff;
  color: var(--primary);
  border: 1px solid #e2e8f0;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  transition: all 0.3s ease;
}

.language-switch button.active {
  background-color: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

#toggleBtn:hover, .language-switch button:hover {
  background-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

body.dark-theme #toggleBtn, body.dark-theme .language-switch button {
    background-color: var(--card-dark);
    color: var(--text-dark);
    border-color: #4a5568;
}

body.dark-theme #toggleBtn:hover, body.dark-theme .language-switch button:hover {
    background-color: var(--accent);
    color: var(--primary);
}

#scrollTopBtn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99;
  background-color: var(--primary);
  color: #fff;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: background-color 0.3s ease, transform 0.3s ease;
}
#scrollTopBtn:hover {
  background-color: var(--accent);
  transform: scale(1.1);
}

/* === FADE-IN ANIMATION ON SCROLL === */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =================
   Skills Section
   ================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.skill-category {
  background-color: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  transition: background-color 0.3s ease;
}

body.dark-theme .skill-category {
  background-color: var(--dark-bg);
}

.skill-category h3 {
  color: var(--accent);
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.skill-category ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.skill-category ul li {
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.5rem;
}

.skill-category ul li::before {
  content: '\f00c'; /* Font Awesome check icon */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: var(--accent);
  position: absolute;
  left: 0;
  top: 2px;
}


/* =================
   Timeline (Experience & Education)
   ================= */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 2rem auto;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 4px;
  background-color: var(--accent);
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
  z-index: 0;
}

.timeline-item {
  padding: 10px 0;
  position: relative;
  width: 50%;
  margin-bottom: 3rem;
}

.timeline-item:nth-child(odd) {
  left: 0;
  padding-right: 50px; /* Ruang untuk logo */
}

.timeline-item:nth-child(even) {
  left: 50%;
  padding-left: 50px; /* Ruang untuk logo */
}

/* The dot on the timeline */
.timeline-item::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: var(--bg-light);
  border: 4px solid var(--accent);
  top: 20px; /* Disesuaikan agar sejajar dengan logo */
  border-radius: 50%;
  z-index: 1;
  transition: background-color 0.5s ease;
}

body.dark-theme .timeline-item::after {
  background-color: var(--bg-dark);
}

.timeline-item:nth-child(odd)::after {
  right: -12px;
}

.timeline-item:nth-child(even)::after {
  left: -12px;
}

/* The content box */
.timeline-content {
  padding: 1.5rem;
  background: var(--card-light);
  border-radius: 8px;
  border: 1px solid var(--light-border);
  position: relative;
}

body.dark-theme .timeline-content {
  background-color: var(--card-dark);
  border-color: var(--dark-border);
}

/* The logo image */
.timeline-logo {
  position: absolute;
  top: 10px;
  width: 60px;
  height: 60px;
  object-fit: contain;
  background-color: white;
  border-radius: 50%;
  padding: 5px;
  border: 2px solid var(--accent);
  z-index: 2;
}

.timeline-item:nth-child(odd) .timeline-logo {
  right: -30px;
  transform: translateX(50%);
}

.timeline-item:nth-child(even) .timeline-logo {
  left: -30px;
  transform: translateX(-50%);
}

.timeline-content h3 {
  margin-top: 0;
  color: var(--accent);
  font-size: 1.2rem;
}

.timeline-content h4, .timeline-content h5 {
  margin: 0.2rem 0;
  font-style: italic;
  font-size: 1rem;
  font-weight: normal;
  opacity: 0.8;
}

.timeline-content ul {
  list-style-position: outside;
  padding-left: 1.2rem;
  margin-top: 0.5rem;
}

.achievements {
  position: relative;
  z-index: 1;
  clear: both;
  width: 100%;
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: #eaf6f8;
  border-radius: 8px;
  text-align: center;
  border: 1px solid var(--light-border);
}

body.dark-theme .achievements {
    background-color: #252e3d;
    border-color: var(--dark-border);
}

/* === PORTFOLIO GRID - UPDATED === */
.portfolio-grid .item {
  position: relative;
  height: 250px;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  overflow: hidden;
  color: white;
  display: flex;
  align-items: flex-end;
  padding: 0;
}
.item-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  width: 100%;
  height: 100%;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: background 0.3s ease;
}
.portfolio-grid .item:hover .item-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.95) 20%, rgba(0,0,0,0.1) 100%);
}
.item-overlay h3 {
  color: white;
  margin: 0;
  transition: transform 0.3s ease;
}
.item-overlay .hover-info {
  color: rgba(255,255,255,0.7);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(10px);
}
.portfolio-grid .item:hover .hover-info {
  opacity: 1;
  transform: translateY(0);
}
.portfolio-grid .item:hover h3 {
  transform: translateY(-5px);
}

/* === PORTFOLIO FILTER === */
.filter-buttons {
  margin-bottom: 2rem;
  text-align: center;
}

.filter-buttons button {
  background-color: transparent;
  border: 1px solid var(--light-border);
  padding: 0.5rem 1.5rem;
  margin: 0.25rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-light);
  transition: all 0.3s ease;
}

.filter-buttons button:hover {
  background-color: var(--hover);
  color: #fff;
  border-color: var(--hover);
}

.filter-buttons button.active {
  background-color: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

body.dark-theme .filter-buttons button {
  color: var(--text-dark);
  border-color: var(--dark-border);
}

body.dark-theme .filter-buttons button:hover {
  background-color: var(--hover);
  color: var(--primary);
  border-color: var(--hover);
}

body.dark-theme .filter-buttons button.active {
  background-color: var(--accent);
  color: var(--primary);
  border-color: var(--accent);
}

/* === MODAL STYLES === */
.hidden {
  display: none !important;
}

#modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1010;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card-light);
  padding: 2rem;
  border-radius: 12px;
  z-index: 1020;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

body.dark-theme .modal {
  background: var(--card-dark);
  border: 1px solid var(--dark-border);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #aaa;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--text-light);
}

body.dark-theme .modal-close:hover {
  color: var(--text-dark);
}

.modal-content img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--light-border);
}

.modal-content #modal-links {
  margin-top: 1.5rem;
}

.modal-content #modal-links a {
  margin-right: 1rem;
  text-decoration: none;
  font-weight: 600;
  color: var(--accent);
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 5px;
  transition: all 0.3s ease;
}

.modal-content #modal-links a:hover {
  background-color: var(--accent);
  color: white;
}

body.dark-theme .modal-content #modal-links a:hover {
  color: var(--primary);
}


/* === CONTACT FORM === */
#contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#contact-form input,
#contact-form textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

#contact-form input:focus,
#contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(76, 161, 175, 0.2);
}

#contact-form button {
  background-color: var(--primary);
  color: #fff;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  align-self: flex-start;
}

#contact-form button:hover {
  background-color: var(--accent);
}

body.dark-theme #contact-form input,
body.dark-theme #contact-form textarea {
  background-color: #1a202c;
  border-color: #4a5568;
  color: var(--text-dark);
}

body.dark-theme #contact-form button {
  background-color: var(--accent);
  color: var(--primary);
}

body.dark-theme #contact-form button:hover {
  background-color: var(--hover);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    align-items: center;
  }

  .profil-img {
    width: 120px;
    height: 120px;
  }

  h2 {
    font-size: 1.6rem;
  }

  section {
    padding: 2rem 1.5rem;
    margin: 1rem auto;
  }

  .language-switch, .theme-toggle {
      top: 0.5rem;
  }
  .language-switch { left: 0.5rem; }
  .theme-toggle { right: 0.5rem; }

  /* Responsive Timeline */
  .timeline::after {
    left: 20px;
  }

  .timeline-item {
    width: 100%;
    padding-left: 40px; /* Ruang untuk garis */
    padding-right: 0;
  }

  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    left: 0;
    padding-left: 40px; /* Pastikan padding konsisten */
  }

  .timeline-item::after {
    left: 10px;
  }

  /* On mobile, move logo inside the content box */
  .timeline-logo {
    position: static;
    transform: none;
    float: left;
    margin-right: 1rem;
    margin-bottom: 1rem;
    width: 50px;
    height: 50px;
  }

  .timeline-content h3 {
    clear: both;
  }
}
