@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

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

body {
  font-family: 'Poppins', sans-serif;
  display: flex;
  background: var(--bg);
  color: var(--text);
  transition: background 0.4s, color 0.4s;
}

/* ===== Variabel Warna ===== */
:root {
  --primary: #3b82f6;
  --bg: #f0f4ff;
  --bg-dark: #0a0f2c;
  --text: #111;
  --text-dark: #e0e8ff;
  --card-bg: #ffffff;
  --card-dark: #1a1f3b;
}

body.dark {
  --bg: var(--bg-dark);
  --text: var(--text-dark);
  --card-bg: var(--card-dark);
}

/* ===== Sidebar ===== */
.sidebar {
  width: 250px;
  height: 100vh;
  background: linear-gradient(180deg, #3b82f6, #1e3a8a);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 2rem;
  position: fixed;
  left: 0;
  top: 0;
}

.profile-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  margin-bottom: 1rem;
}

.sidebar h2 {
  margin-bottom: 2rem;
}

.sidebar a {
  color: #fff;
  text-decoration: none;
  margin: 0.8rem 0;
  font-weight: 500;
  transition: 0.3s;
}

.sidebar a:hover {
  color: #dbeafe;
  transform: scale(1.05);
}

.toggle-theme {
  margin-top: auto;
  margin-bottom: 2rem;
  padding: 0.5rem 1rem;
  border: none;
  background: #1e3a8a;
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
}

.toggle-theme:hover {
  background: #3b82f6;
}

/* ===== Konten Utama ===== */
main {
  margin-left: 250px;
  padding: 2rem;
  width: 100%;
}

section {
  margin-bottom: 4rem;
  padding: 2rem;
  background: var(--card-bg);
  border-radius: 15px;
  box-shadow: 0 0 15px rgba(0,0,0,0.1);
  transition: 0.3s;
}

section:hover {
  transform: translateY(-5px);
}

h1, h2 {
  color: var(--primary);
}

.highlight {
  color: #2563eb;
}

/* ===== Tentang Saya ===== */
.about-list {
  list-style: none;
  margin-bottom: 1rem;
}

.about-list li {
  margin: 0.5rem 0;
}

/* ===== Skill Bar ===== */
.skill {
  margin-bottom: 1.2rem;
}

.progress {
  background: #cbd5e1;
  border-radius: 10px;
  overflow: hidden;
  height: 20px;
}

.bar {
  background: var(--primary);
  color: #fff;
  height: 100%;
  text-align: right;
  padding-right: 10px;
  border-radius: 10px;
  font-size: 0.85rem;
  transition: width 1s ease-in-out;
  width: 0; /* mulai dari nol */
}

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

.certificate-img {
  width: 100%;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
}

.certificate-img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.modal iframe {
  display: block;
  margin: auto;
  border-radius: 10px;
  background: #fff;
}


/* ===== Modal Popup ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.8);
}

.modal-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 900px;
  border-radius: 10px;
}

.close {
  position: absolute;
  top: 30px;
  right: 50px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.close:hover {
  color: #3b82f6;
}

/* ===== Portofolio ===== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.portfolio-item {
  background: var(--bg);
  padding: 1rem;
  border-radius: 10px;
  text-align: center;
  transition: 0.3s;
}

.portfolio-item:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-5px);
}

.portfolio-item {
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}
.portfolio-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 20px rgba(59,130,246,0.3);
}

/* ===== Kontak ===== */
.contact-list {
  list-style: none;
}

.contact-list li {
  margin: 0.8rem 0;
}

.contact-list a {
  color: var(--primary);
  text-decoration: none;
}

.contact-list a:hover {
  text-decoration: underline;
}

/* ===== Responsif ===== */

.menu {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  font-size: 28px;
  width: 55px;
  height: 55px;
  background: linear-gradient(135deg, #3b82f6, #1e3a8a);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1100;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: transform 0.3s, background 0.3s;
}

.menu:hover {
  transform: scale(1.1);
  background: linear-gradient(135deg, #2563eb, #1e40af);
}

/* Sidebar hidden by default on mobile */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -250px;
    top: 0;
    height: 100%;
    width: 250px;
    transition: left 0.3s ease;
    z-index: 1000;
  }

  .sidebar.active {
    left: 0;
  }

  .menu {
    display: block;
  }

  main {
    margin-left: 0;
    padding-top: 70px;
  }
}