body {
    font-family: 'Open Sans', sans-serif;
    background-color: #F4F9F4;
    color: #333;
    margin: 0;
    padding: 0;
}

/* Navigation Menu */
nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    background-color: #3498DB;
    padding: 10px 20px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid #2980B9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav a {
    color: white;
    text-decoration: none;
    padding: 14px 20px;
    font-size: 18px;
    font-weight: bold;
}

nav a:hover {
    background-color: #1ABC9C;
}

/* Header */
.header {
    background: linear-gradient(135deg, #3498DB, #1ABC9C);
    color: white;
    text-align: center;
    padding: 80px 20px 40px;
    margin-top: 60px;
}

/* Header images - responsive */
.header-images {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.header-images img {
    height: 200px;
    width: auto;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.header-images img.big {
    height: 300px;
    z-index: 2;
}

.header-images img.tilt-left { transform: rotate(-5deg); }
.header-images img.tilt-right { transform: rotate(5deg); }
.header-images img:hover { transform: scale(1.05); }

/* Container */
.container {
    width: 85%;
    margin: 40px auto;
    padding: 25px;
    background-color: #FFFFFF;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

/* Responsive Images Global */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Specific fix for EDC section image */
#edcSection img {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

/* Headings */
h2 {
    text-align: center;
    color: #1ABC9C;
    margin-bottom: 20px;
    font-size: 2em;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    color: #555;
}

textarea, input[type="number"], select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1em;
    background-color: #E8F8F5;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.btn {
    padding: 12px 30px;
    background-color: #1ABC9C;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 4px 8px rgba(26, 188, 156, 0.3);
}

.btn.secondary { background-color: #3498DB; }

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 15px;
    text-align: left;
}

th {
    background-color: #1ABC9C;
    color: white;
    font-weight: 600;
}

td {
    background-color: #F4F9F4;
}

/* Footer */
footer {
    background-color: #3498DB;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
    border-top: 5px solid #2980B9;
}

/* ===== Responsive Fixes ===== */
@media (max-width: 768px) {
    /* Header images stack on mobile */
    .header-images {
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-images img,
    .header-images img.big {
        height: auto;
        width: 100%;
        max-width: 300px;
        transform: none;
    }

    nav a {
        padding: 10px;
        font-size: 16px;
    }
}

/* Default (desktop & laptop) */
.header-images {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: nowrap; /* kekal sebelah-sebelah */
}

.header-images img {
    height: 200px;
    width: auto;
    object-fit: contain;
}

.header-images img.big {
    height: 300px;
}

/* EDC section image default */
#edcSection img {
    max-width: 600px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 20px;
}

/* Mobile view */
@media (max-width: 768px) {
    .header-images {
        flex-wrap: wrap; /* bila mobile, stack */
    }
    .header-images img,
    .header-images img.big {
        height: auto;
        width: 100%; /* penuh lebar container */
        max-width: 100%;
    }
    #edcSection img {
        max-width: 100%; /* auto kecil ikut skrin */
    }
    .container {
        width: 95%; /* kurangkan lebar supaya tak overflow */
        padding: 15px;
    }
}

/* Label "Check Ingredients:" */
label[for="ingredients"] {
    font-weight: bold;
    color: #1ABC9C; /* warna teal */
    font-size: 1.1em;
}

/* Kotak textarea untuk Check Ingredients */
#ingredients {
    border: 2px solid #1ABC9C; /* border tebal warna teal */
    padding: 10px;
    border-radius: 8px;
    background-color: #E8F8F5; /* light teal */
    font-size: 1em;
    font-family: 'Open Sans', sans-serif;
}

/* Navigation container */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Logo */
.logo {
    color: white;
    font-weight: bold;
    font-size: 1.2em;
}

/* Hamburger icon (hidden by default on laptop) */
.hamburger {
    display: none;
    font-size: 28px;
    cursor: pointer;
    color: white;
}

/* Navigation links (default for laptop) */
.nav-links {
    display: flex;
    gap: 15px;
}

/* For mobile view */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        background-color: #3498DB;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        padding: 10px 0;
    }
    .nav-links a {
        padding: 10px 20px;
        display: block;
    }
    .nav-links.active {
        display: flex;
    }
}

/* Navigation container */
.nav-links {
    display: flex;
    gap: 20px; /* Jarak antara link */
    margin-right: 50px; /* Jarak dari tepi kanan */
}

/* Mobile style */
@media (max-width: 768px) {
    .nav-links {
        flex-direction: column;
        position: absolute;
        top: 60px;
        right: 0;
        background: white;
        padding: 20px;
        margin-right: 0; /* Reset untuk mobile */
        display: none;
    }

    .nav-links.active {
        display: block;
    }
}

@media (max-width: 768px) {
    .hamburger {
        position: absolute;
        top: 15px;      /* jarak dari atas */
        right: 15px;    /* jarak dari kanan supaya tak mepet */
        transform: none;
    }
}

/* Navigation container */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px; /* jarak kiri kanan */
    background-color: white;
    position: relative;
}

/* Hamburger button */
.hamburger {
    display: none;
    font-size: 28px;
    cursor: pointer;
}

/* Nav links desktop */
.nav-links {
    display: flex;
    gap: 20px;
}

/* Mobile view */
@media (max-width: 768px) {
    .hamburger {
        display: block; /* Tunjuk hamburger */
    }

    .nav-links {
        display: none; /* Sembunyi menu asal */
        flex-direction: column;
        position: absolute;
        top: 60px; /* Turun bawah navbar */
        right: 20px;
        background: white;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        z-index: 1000;
    }

    .nav-links a {
        padding: 8px 0;
        text-decoration: none;
        color: black;
    }

    .nav-links.active {
        display: flex; /* Muncul bila klik hamburger */
    }
}

/* Hide hamburger in desktop */
.hamburger {
    display: none;
}

/* Show hamburger & hide menu in mobile */
@media (max-width: 768px) {
    .hamburger {
        display: block;
        position: absolute;
        top: 15px;
        right: 20px;
        font-size: 28px;
        cursor: pointer;
        z-index: 1000;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        background-color: #333;
        position: absolute;
        top: 60px;
        right: 0;
        width: 200px;
        padding: 10px;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        color: white;
        padding: 10px;
        text-decoration: none;
    }

    .nav-links a:hover {
        background-color: #444;
    }
}

/* Default (Laptop & Desktop) - menu visible, hamburger hidden */
.hamburger {
    display: none;
}
.nav-links {
    display: flex;
    gap: 20px;
}

/* Mobile view - hide nav-links, show hamburger */
@media (max-width: 768px) {
    .hamburger {
        display: block;
        position: fixed;
        top: 15px;
        right: 15px;
        font-size: 28px;
        cursor: pointer;
        z-index: 1000;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        background-color: #333;
        position: fixed;
        top: 60px;
        right: 0;
        width: 200px;
        padding: 10px;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        color: white;
        padding: 10px;
        text-decoration: none;
    }

    .nav-links a:hover {
        background-color: #444;
    }
}

/* Navigation container */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #1a73e8;
    color: white;
}

.logo {
    font-size: 22px;
    font-weight: bold;
}

/* Default (Laptop & Desktop) */
.hamburger {
    display: none;
    font-size: 28px;
    cursor: pointer;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.nav-links a:hover {
    text-decoration: underline;
}

/* Mobile view */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        background-color: #1a73e8;
        position: fixed;
        top: 60px;
        right: 0;
        width: 200px;
        padding: 15px;
        box-shadow: -2px 2px 8px rgba(0,0,0,0.2);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        padding: 10px 0;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }

    .nav-links a:last-child {
        border-bottom: none;
    }
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  background-color: transparent;
  z-index: 1000;
}

nav.scrolled {
  background-color: rgba(255, 255, 255, 0.95); /* putih lembut */
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

nav .nav-links a {
  color: white; /* masa transparent, putih */
  text-decoration: none;
  margin-left: 20px;
  transition: color 0.3s;
}

nav.scrolled .nav-links a {
  color: black; /* bila scroll tukar hitam */
}

.about-us-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

.member {
    text-align: center;
    width: 150px; /* saiz setiap kad */
}

.member img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.member p {
    margin-top: 8px;
    font-weight: bold;
    font-size: 0.9rem;
}
.about-us-grid {
    display: grid;
    grid-template-columns: repeat(2, 150px);
    gap: 20px;
    justify-content: center;
}

.about-us-grid .member:nth-child(n+3) {
    grid-column: span 1;
}

.about-us-grid .member:nth-child(3) {
    grid-column: 1; /* start new row */
}

.about-us-grid .member:nth-child(4) {
    grid-column: 2;
}

.about-us-grid .member:nth-child(5) {
    grid-column: 1 / span 2; /* center last one if needed */
    justify-self: center;
}

.member {
    text-align: center;
}

.member img {
    width: 120px;
    height: 160px; /* passport style ratio */
    object-fit: cover; /* crop image neatly */
    border-radius: 6px;
    border: 2px solid #ccc;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.member p {
    margin-top: 8px;
    font-weight: bold;
    font-size: 0.9rem;
}

.member {
    display: flex;
    flex-direction: column;
    align-items: center; /* pastikan semua content (gambar + nama) center */
}

.member img {
    width: 120px;
    height: 160px; /* passport style ratio */
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #ccc;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.member p {
    margin-top: 6px; /* jarak rapat dengan gambar */
    font-weight: bold;
    font-size: 0.9rem;
    text-align: center;
    width: 100%; /* pastikan text tak lari kiri/kanan */
}

#aboutSection > p {
    text-align: justify;
}

#edcSection p {
    text-align: justify;
}

/* Override untuk bagi menu keluar dari kanan */
#nav-links {
    left: auto !important;
    right: -250px !important;
    transition: right 0.3s ease !important;
}

#nav-links.show {
    left: auto !important;
    right: 0 !important;
}

#header,
#ingredientsSection,
#aboutSection,
#resultSection,
#edcSection,
#info {
  scroll-margin-top: 100px; /* adjust ikut tinggi navbar */
}

/* ===== Desktop (default) ===== */
.nav-links {
    display: flex;
    position: static;
    flex-direction: row;
    gap: 20px;
    background: none;
    width: auto;
    padding: 0;
  }
  
  /* ===== Mobile / Tablet ===== */
  @media (max-width: 768px) {
    .nav-links {
      position: fixed;
      top: 60px;           /* below navbar */
      right: -250px;       /* HIDDEN by default */
      width: 200px;
      background: #1a73e8;
      flex-direction: column;
      padding: 15px;
      transition: right 0.3s ease;
      z-index: 1000;
    }
  
    /* When menu is toggled (JS adds .active) */
    .nav-links.active {
      right: 0;            /* slide in */
    }
  
    .nav-links li {
      margin: 15px 0;
    }
  }  

.info-section {
    background: #f9f9f9;
    padding: 60px 20px;
    text-align: center;
  }
  
  .info-section h2 {
    font-size: 2rem;
    margin-bottom: 40px;
    color: #222;
  }
  
  .news-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
  }
  
  .news-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: left;
    transition: transform 0.3s;
  }
  
  .news-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #0077b6;
  }
  
  .news-card p {
    font-size: 1rem;
    color: #555;
    margin-bottom: 15px;
  }
  
  .news-card a {
    font-size: 0.9rem;
    color: #0077b6;
    text-decoration: none;
    font-weight: bold;
  }
  
  .news-card:hover {
    transform: translateY(-5px);
  }

  @media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 60px;          /* bawah header */
    right: -100%;       /* mula sembunyi kat kanan */
    width: 200px;
    height: 100vh;
    background-color: #3498DB;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 40px;
    gap: 20px;
    transition: right 0.3s ease-in-out;
  }

  .nav-links.active {
    right: 0; /* bila aktif → slide masuk dari kanan */
  }

  .hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
  }
}

/* ===== FINAL OVERRIDE - Mobile menu fix ===== */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 60px;
    right: -250px;
    width: 200px;
    height: 100vh;
    background-color: #3498DB;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 40px;
    gap: 20px;
    transition: right 0.3s ease-in-out;
    z-index: 1000;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    color: white;
    text-decoration: none;
    padding: 10px 0;
    font-weight: bold;
  }

  .nav-links a:hover {
    background-color: #2980B9;
    width: 100%;
    text-align: center;
    border-radius: 4px;
  }

  .hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1100;
  }
}
/* ===== FINAL OVERRIDE - Mobile menu fix ===== */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 60px;
    right: -250px;
    width: 200px;
    height: 100vh;
    background-color: #3498DB;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 40px;
    gap: 20px;
    transition: right 0.3s ease-in-out;
    z-index: 1000;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    color: white;
    text-decoration: none;
    padding: 10px 0;
    font-weight: bold;
  }

  .nav-links a:hover {
    background-color: #2980B9;
    width: 100%;
    text-align: center;
    border-radius: 4px;
  }

  .hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1100;
  }
}

/* Default: sembunyi menu bila mobile */
.nav-links {
  display: none;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  position: absolute;
  top: 60px; /* adjust ikut tinggi navbar */
  right: 20px;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Bila toggleMenu() aktifkan class "active" */
.nav-links.active {
  display: flex;
}

/* Desktop view */
@media (min-width: 769px) {
  .nav-links {
    display: flex !important;
    position: static;
    flex-direction: row;
    gap: 20px;
    box-shadow: none;
    background: transparent;
    padding: 0;
  }

  .hamburger {
    display: none; /* hamburger hilang bila desktop */
  }
}

/* Hamburger button style */
.hamburger {
  font-size: 24px;
  cursor: pointer;
  display: block;
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 250px;
    background: #fff; /* putih */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 20px;
    box-shadow: -2px 0 5px rgba(0,0,0,0.2);
    transition: right 0.3s ease;
    z-index: 999;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    display: block;
    width: 100%;
    text-decoration: none;
    color: #000 !important;   /* <<< warna hitam biar nampak */
    margin: 15px 0;
    font-size: 18px;
  }

  .hamburger {
    display: block;
    cursor: pointer;
    font-size: 26px;
    color: #000; /* biar hamburger nampak */
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%; /* mula-mula sembunyi */
    height: 100vh;
    width: 250px;
    background: #1e2a38; /* biru gelap ikut theme */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 20px;
    box-shadow: -2px 0 5px rgba(0,0,0,0.3);
    transition: right 0.3s ease;
    z-index: 999;
  }

  .nav-links.active {
    right: 0; /* bila klik hamburger baru keluar */
  }

  .nav-links a {
    display: block;
    width: 100%;
    text-decoration: none;
    color: #fff !important; /* putih, biar kontras dgn background */
    margin: 15px 0;
    font-size: 18px;
  }

  .hamburger {
    display: block;
    cursor: pointer;
    font-size: 28px;
    color: #ffffff; /* ikut theme, boleh adjust kalau nak putih */
    z-index: 1000;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none; /* asalnya hide */
    flex-direction: column;
    background: #1e2a38; /* warna ikut theme */
    position: absolute;
    top: 60px; /* bawah navbar */
    right: 10px;
    width: 200px;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 999;
  }

  .nav-links.active {
    display: flex; /* bila klik hamburger baru keluar */
  }

  .nav-links a {
    color: #fff !important;
    text-decoration: none;
    padding: 10px;
    display: block;
  }

  .hamburger {
    display: block;
    cursor: pointer;
    font-size: 28px;
    color: #ffffff; /* boleh tukar putih kalau nak kontras */
  }
}

/* Default (desktop) - hide hamburger */
.hamburger {
  display: none;
}

/* Mobile only - show hamburger */
@media (max-width: 768px) {
  .hamburger {
    display: block;
    cursor: pointer;
    font-size: 28px;
    color: #fefefe; /* ikut theme, boleh tukar putih kalau nak kontras */
  }

  /* hide nav-links on mobile by default */
  .nav-links {
    display: none;
  }

  .nav-links.active {
    display: flex;
    flex-direction: column;
    background: #3498DB;
    position: absolute;
    top: 60px;
    right: 10px;
    width: 200px;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 999;
  }

  .nav-links a {
    color: #fff !important;
    text-decoration: none;
    padding: 10px;
    display: block;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    background: #1e2a38;
    position: absolute;
    top: 60px;
    right: 10px;
    width: 240px;
    border-radius: 8px;
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 999;

    height: auto;   /* ikut content je */
    max-height: none; /* pastikan tak stretch penuh */
  }

  .nav-links.active {
    display: block;
  }

  .nav-links a {
    color: #fff !important;
    text-decoration: none;
    padding: 12px 20px;
    display: block;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }
}

/* ====== Desktop default ====== */
.nav-links {
  display: flex;
  gap: 20px;
  position: static;
  width: auto;
  background: none;
  box-shadow: none;
}

.nav-links a {
  color: #333;
  white-space: nowrap; /* kat desktop biar satu line je */
}

/* ====== Mobile only ====== */
@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 60px;
    left: 0;
    width: 80%;          /* boleh adjust jadi 100% kalau nak full */
    max-width: 320px;    /* optional */
    background-color: #2a2a72; /* ikut theme */
    display: none;
    flex-direction: column;
    padding: 15px;
    border-radius: 0 0 12px 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    text-align: left;
    white-space: normal;   /* boleh turun line kalau panjang */
    word-wrap: break-word; /* wrap perkataan panjang */
    display: block;
  }
}

.nav-links {
  display: flex;
  gap: 20px;
  position: static;
  width: auto;
  background: none;
  box-shadow: none;
  max-height: none; /* penting: reset supaya desktop tak kena */
  overflow: visible;
  transition: none;
}

/* Mobile menu behaviour */
@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 60px;
    left: 0;
    width: 85%;
    max-width: 350px;
    background-color: #2a2a72;
    flex-direction: column;
    padding: 15px;
    border-radius: 0 0 12px 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);

    max-height: 0;            /* mula tutup */
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    display: flex;            /* kekal flex untuk transition */
  }

  .nav-links.active {
    max-height: 1000px; /* auto muat semua item */
  }

  .nav-links a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    text-align: left;
    white-space: normal;
    word-wrap: break-word;
    display: block;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 60px;
    left: 0;
    width: 85%;
    max-width: 350px;
    background-color: #2a2a72 !important;  /* paksa ikut theme */
    flex-direction: column;
    padding: 15px;
    border-radius: 0 0 12px 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 999;

    /* Toggle method → pakai max-height sahaja */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;

    display: flex; /* kekal flex supaya transition smooth */
  }

  .nav-links.active {
    max-height: 400px; /* adjust ikut jumlah link */
  }

  .nav-links a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    text-align: left;
    white-space: normal;
    word-wrap: break-word;
    box-sizing: border-box;
    display: block;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 60px;
    left: 0;
    width: 85%;               /* kekal sama */
    max-width: 350px;         /* lock max width */
    background-color: #2a2a72 !important;
    flex-direction: column;
    padding: 15px;
    border-radius: 0 0 12px 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 999;

    /* Animasi hanya tinggi */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;

    display: flex;  /* sentiasa flex, width tak hilang */
  }

  .nav-links.active {
    max-height: 400px; /* adjust ikut jumlah link */
  }

  .nav-links a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    text-align: left;
    white-space: normal;
    word-wrap: break-word;
    box-sizing: border-box;
    display: block;
  }
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #0077b6; /* theme */
  color: white;
  position: relative;
}

/* Logo */
.logo {
  font-size: 20px;
  font-weight: bold;
}

/* Hamburger (desktop hidden) */
.hamburger {
  font-size: 24px;
  cursor: pointer;
  display: none;
}

/* Links desktop */
.nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.nav-links a {
  color: white;
  text-decoration: none;
  padding: 8px 12px;
}

/* Mobile Reset */
@media (max-width: 768px) {
  .hamburger {
    display: block !important;
  }

  .nav-links {
    display: none !important;
    flex-direction: column !important;
    position: absolute !important;
    top: 60px !important;
    left: 0 !important;
    width: 100% !important;
    background: #0077b6 !important;
    padding: 10px !important;
    box-sizing: border-box !important;
  }

  .nav-links.active {
    display: flex !important;
  }

  .nav-links a {
    padding: 12px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }
}

@media (max-width: 768px) {
  .nav-links {
    max-height: none !important; /* pastikan semua item keluar */
    overflow: visible !important; 
  }
}

