/* ========== HEADER CONTAINER ========== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 40px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  flex-wrap: wrap; /* agar tidak overflow di layar kecil */
}

/* ======== Posisikan logo & teks sejajar tengah ======== */
.header .logo {
  display: flex;
  align-items: center; /* sejajarkan vertikal */
  gap: 10px;
}

.logo-img {
  height: 55px;  /* bisa 50–60px tergantung proporsinya */
  width: auto;
}

.logo-link {
  font-size: 1.5rem;
  font-weight: bold;
  color: #008000;
  text-decoration: none;
  line-height: 1; /* biar teks pas tengah */
}

.logo h1 {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}


/* ========== NAVIGATION LINK ========== */
.header nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.header nav a {
  text-decoration: none;
  color: #0056b3;
  font-weight: 600;
  transition: color 0.3s ease, background 0.3s ease;
}

.header nav a:hover {
  color: #2e8b57;
}

/* ========== DROPDOWN ========== */
.dropdown {
  position: relative;
}

.dropbtn {
  background: none;
  border: none;
  color: #0056b3;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.dropbtn:hover {
  color: #2e8b57;
}

.dropdown-content {
  display: none;
  position: absolute;
  background: #ffffff;
  min-width: 180px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
  border-radius: 6px;
  overflow: hidden;
  z-index: 999;
}

.dropdown-content a {
  display: block;
  color: #0056b3;
  padding: 10px 16px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.3s ease, color 0.3s ease;
}

.dropdown-content a:hover {
  background-color: #f0f8f5;
  color: #2e8b57;
}

.dropdown-content.show {
  display: block;
}

/* ========== BUTTONS ========== */
.login-btn,
.register-btn,
.dashboard-btn,
.logout-btn {
  padding: 8px 18px;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  white-space: nowrap; /* biar tidak terpotong di layar kecil */
}

.login-btn {
  background: #2e8b57;
  color: #fff !important;
}

.login-btn:hover {
  background: #ffffff;
  color: #2e8b57 !important;
  border-color: #2e8b57;
}

.register-btn {
  background: #0056b3;
  color: #fff !important;
}

.register-btn:hover {
  background: #ffffff;
  color: #0056b3 !important;
  border-color: #0056b3;
}

.dashboard-btn {
  background: #eaf4ff;
  color: #004AAD;
}

.dashboard-btn:hover {
  background: #004AAD;
  color: #ffffff;
}

.logout-btn {
  background: #ff4b4b;
  color: #fff !important;
}

.logout-btn:hover {
  background: #d73838;
}

/* ========== USER INFO ========== */
.user-info {
  color: #004AAD;
  font-weight: 600;
  margin-right: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
}

/* ======================================
   RESPONSIVE DESIGN (untuk HP & tablet)
====================================== */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 20px;
  }

  .logo {
    width: 100%;
    justify-content: space-between;
  }

  .header nav {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-top: 10px;
  }

  .header nav a,
  .dropbtn,
  .login-btn,
  .register-btn,
  .dashboard-btn,
  .logout-btn {
    width: 100%;
    text-align: left;
  }

  .dropdown-content {
    position: static;
    box-shadow: none;
    background: transparent;
    min-width: 100%;
  }

  .dropdown-content a {
    padding-left: 25px;
  }

  .dropdown-content.show {
    display: block;
  }
}

/* Lebih kecil lagi (HP kecil seperti 375px) */
@media (max-width: 480px) {
  .logo-link {
    font-size: 18px;
  }

  .logo-img {
    width: 40px;
    height: 40px;
  }

  .header nav {
    gap: 10px;
  }

  .login-btn,
  .register-btn {
    padding: 6px 14px;
    font-size: 14px;
  }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {

  nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    background: #ffffff;
    padding: 12px 20px;
    border-top: 1px solid #e0e0e0;
  }

  nav.show-menu {
    display: flex;
  }

  nav a,
  .dropbtn,
  .login-btn,
  .register-btn,
  .dashboard-btn,
  .logout-btn {
    width: 100%;
    text-align: left;
    padding: 10px 0;
  }

  .dropdown-content {
    position: static;
    box-shadow: none;
    padding-left: 20px;
  }
}

/* ===============================
   RESPONSIVE UNTUK HP
   =============================== */
@media (max-width: 768px) {

  /* Menu awal disembunyikan */
  nav {
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  }

  /* Saat tombol ☰ diklik */
  nav.show-menu {
    max-height: 500px; /* cukup untuk semua item */
    padding: 10px 20px;
  }

  nav a,
  .dropbtn,
  .login-btn,
  .register-btn,
  .dashboard-btn,
  .logout-btn {
    width: 100%;
    text-align: left;
    padding: 10px 0;
    border-radius: 6px;
  }

  /* Dropdown kategori */
  .dropdown-content {
    position: static;
    display: none;
    width: 100%;
    box-shadow: none;
    background: transparent;
    padding-left: 20px;
  }

  .dropdown-content.show {
    display: block;
  }

  .dropdown-content a {
    padding: 6px 0;
  }
}

/* ======== HEADER UTAMA ======== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 40px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  flex-wrap: wrap;
}

/* ======== LOGO ======== */
.header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  height: 55px;
  width: auto;
}

.logo-link {
  font-size: 1.5rem;
  font-weight: bold;
  color: #008000;
  text-decoration: none;
  line-height: 1;
}

/* ======== NAVIGATION ======== */
.header nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* Tombol menu (hamburger) */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #0056b3;
  font-size: 26px;
  cursor: pointer;
  z-index: 1100;
}

/* ============================================
   RESPONSIVE UNTUK MOBILE / TABLET (max 768px)
   ============================================ */
@media (max-width: 768px) {

  .header {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 20px;
    position: relative;
  }

  /* Header atas: logo + tombol menu sejajar */
  .header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .header .logo {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .logo-img {
    height: 45px;
  }

  .logo-link {
    font-size: 1.2rem;
  }

  /* Tombol menu muncul */
  .menu-toggle {
    display: block;
    position: relative;
  }

  /* Menu navigasi (disembunyikan dulu) */
  .header nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    background: #fff;
    padding: 12px 20px;
    border-top: 1px solid #eee;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }

  /* Saat tombol ☰ diklik */
  .header nav.show-menu {
    display: flex;
  }

  .header nav a,
  .dropbtn,
  .login-btn,
  .register-btn,
  .dashboard-btn,
  .logout-btn {
    width: 100%;
    text-align: left;
    padding: 10px 0;
  }

  /* Dropdown kategori */
  .dropdown-content {
    position: static;
    box-shadow: none;
    background: transparent;
    padding-left: 20px;
  }

  .dropdown-content.show {
    display: block;
  }

  .dropdown-content a {
    padding: 6px 0;
  }
}

/* ======= Tambahan untuk HP kecil (max 480px) ======= */
@media (max-width: 480px) {
  .logo-img {
    height: 40px;
  }

  .logo-link {
    font-size: 1rem;
  }

  .header nav a {
    font-size: 14px;
  }
}
