body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  background: #f9f9f9;
}

/* ========== NAVBAR ========== */
nav {
  background-color: #222;
}

nav ul {
  list-style: none;
  padding: 10px 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 1em;
}

nav ul li a {
  text-decoration: none;
  padding: 10px 16px;
  color: white;
  font-weight: 600;
  border-radius: 10px;
  transition: background-color 0.2s ease;
}

nav ul li a.active {
  background-color: #ff9900;
  color: black;
}

/* ============================ */

main {
  padding: 1em;
  text-align: center;
}

.mode-buttons {
  margin-bottom: 1em;
}

.mode-buttons button {
  padding: 0.5em 1em;
  margin: 0.2em;
  font-weight: bold;
  background: #ffd400;
  border: none;
  border-radius: 10px;
}

.resistor-container {
  display: flex;
  justify-content: center;
  margin: 1em 0;
}

.form-group {
  margin: 1em auto;
  max-width: 300px;
  text-align: left;
}

input {
  width: 100%;
  padding: 0.5em;
  margin-top: 0.2em;
  border-radius: 8px;
  border: 1px solid #ccc;
}

button {
  padding: 0.5em 1em;
  background: #ffd400;
  border: none;
  border-radius: 8px;
  font-weight: bold;
}

.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  padding: 2em;
  border-radius: 10px;
  text-align: center;
}

/* Tombol submenu di materi.html (disamakan dengan tombol latihan) */
.tab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.tab-buttons button {
  background-color: #ffd400;
  color: #000;
  padding: 0.5em 1em;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

.tab-buttons button:hover,
.tab-buttons button.active {
  background-color: #e6be00;
}

/* Kontainer materi dalam kotak oranye */
.content-box {
  border: 4px solid orange;
  border-radius: 20px;
  padding: 30px;
  background-color: #fff;
  height: 400px; /* batasi tinggi area */
  overflow-y: auto; /* aktifkan scroll vertikal */
}

.content-box iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.resistor-container {
  overflow-x: auto;
  width: 100%;
}

/* Ukuran default untuk semua layar */
.resistor-container object {
  width: 100%;
  height: auto;
  max-width: 500px;
  display: block;
  margin: 0 auto;
}

/* Untuk layar besar (misalnya laptop/desktop) */
@media (min-width: 768px) {
  .resistor-container object {
    max-width: 400px;
  }
}

/* Untuk layar sangat besar (desktop 1080p ke atas) */
@media (min-width: 1200px) {
  .resistor-container object {
    max-width: 600px;
  }
}
