/* ========== GLOBAL RESET & FONT ========== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: #f0fdf4;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ========== HEADER ========== */
.header {
  background: #2f855a;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
}

.home-btn {
  background: white;
  color: #2f855a;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}
.home-btn:hover {
  background: #def7ec;
}

/* ========== LAYOUT WRAPPER ========== */
.layout-wrapper {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 110px);
}

/* ========== SIDEBAR ========== */
.sidebar-fixed {
  width: 260px;
  background: #b7e4c7;
  padding: 22px;
  border-right: 2px solid #81c784;
  position: sticky;
  top: 0;
  height: calc(100vh - 80px);
  overflow-y: auto;
}

.sidebar-fixed h2 {
  text-align: center;
  color: #064420;
  margin-bottom: 16px;
}

.lesson-nav {
  list-style: none;
  padding: 0;
}
.lesson-nav li a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  margin-bottom: 6px;
  background: #d9f8e7;
  color: #064420;
  text-decoration: none;
  transition: 0.3s;
}
.lesson-nav li a:hover {
  background: #a9dfbf;
}
.lesson-nav li a.active {
  background: #4caf50;
  color: #fff;
}
.lesson-nav li a.locked {
  background: #e0e0e0;
  color: #777;
  cursor: not-allowed;
}

/* Progress box */
.progress-box {
  margin-top: 20px;
  background: white;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.progress-bar {
  background: #e6f5ee;
  border-radius: 10px;
  height: 14px;
  margin: 8px 0;
  overflow: hidden;
}
.progress-bar div {
  background: linear-gradient(90deg, #4caf50, #087f23);
  height: 100%;
  width: 0%;
  transition: width 0.4s ease;
}

/* ========== MAIN CONTENT ========== */
.main-content {
  flex: 1;
  padding: 40px 60px;
}

.content-box {
  background: white;
  border-radius: 14px;
  padding: 20px 30px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  line-height: 1.6;
}

.main-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ========== WELCOME PAGE ========== */
.welcome-box {
  text-align: center;
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  max-width: 700px;
}
.welcome-box h2 {
  color: #064420;
  margin-bottom: 12px;
}
.welcome-box p {
  color: #333;
  margin-bottom: 20px;
}
.start-btn {
  background: #4caf50;
  color: white;
  border: none;
  padding: 12px 22px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: 0.3s;
}
.start-btn:hover {
  background: #45a049;
}

/* ========== MATERI GRID ========== */
.materi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.materi-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 0.3s ease;
}
.materi-card:hover {
  transform: translateY(-5px);
}
.materi-card.locked {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ========== BUTTONS ========== */
.nav-btn {
  background: #2f855a;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  margin-top: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
}
.nav-btn:hover {
  background: #276749;
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* ========== POPUP ========== */
.popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}
.popup.show {
  display: flex;
}
.popup-content {
  background: white;
  padding: 20px 30px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  text-align: center;
  max-width: 400px;
}
.popup-content h3 {
  margin-bottom: 10px;
  color: #2f855a;
}
.close-popup {
  margin-top: 10px;
  background: #2f855a;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
}

/* ========== FOOTER ========== */
.footer {
  background: #2f855a;
  color: white;
  text-align: center;
  padding: 12px 0;
  font-size: 14px;
  margin-top: auto;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 880px) {
  .layout-wrapper {
    flex-direction: column;
  }
  .sidebar-fixed {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 2px solid #81c784;
  }
  .main-content {
    padding: 20px;
  }
}

/* ==== GLOBAL ==== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Poppins", sans-serif; background: #f0fdf4; color: #1a1a1a; }

/* ==== HEADER ==== */
.header {
  background: #2f855a;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.header h1 { font-size: 20px; font-weight: 600; }
.home-btn {
  background: white;
  color: #2f855a;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}
.home-btn:hover { background: #def7ec; }

/* ==== WELCOME ==== */
.welcome-body {
  background: linear-gradient(180deg, #e8f9f0, #c6f6d5);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.welcome-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
}
.welcome-content {
  background: white;
  padding: 50px;
  border-radius: 16px;
  text-align: center;
  max-width: 700px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  animation: fadeInUp 1s ease;
}
@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
.animate-title { color: #065f46; margin-bottom: 10px; }
.bounce {
  background: #4caf50;
  color: white;
  border: none;
  padding: 14px 26px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: floaty 3s ease-in-out infinite;
}
@keyframes floaty {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.bounce:hover {
  transform: scale(1.05) rotate(1deg);
  background: #43a047;
}

/* ==== LAYOUT LMS ==== */
.layout-wrapper { display: flex; min-height: calc(100vh - 100px); }
.sidebar-fixed {
  width: 260px;
  background: #b7e4c7;
  padding: 20px;
  border-right: 2px solid #81c784;
  position: sticky;
  top: 0;
  height: calc(100vh - 70px);
  overflow-y: auto;
}
.sidebar-fixed h2 { color: #064420; text-align: center; margin-bottom: 12px; }

.lesson-nav { list-style: none; }
.lesson-nav a {
  display: block;
  padding: 10px 14px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: #d9f8e7;
  text-decoration: none;
  color: #064420;
  font-weight: 600;
  transition: 0.3s;
}
.lesson-nav a:hover { background: #a9dfbf; }
.lesson-nav a.active { background: #4caf50; color: white; }
.lesson-nav a.locked { background: #e0e0e0; color: #888; cursor: not-allowed; }

.progress-box {
  background: white;
  padding: 10px;
  margin-top: 20px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.progress-bar {
  background: #e6f5ee;
  border-radius: 10px;
  height: 14px;
  margin: 6px 0;
}
.progress-bar div {
  background: linear-gradient(90deg, #4caf50, #087f23);
  height: 100%;
  width: 0%;
  transition: width 0.4s ease;
}

/* ==== CONTENT ==== */
.main-content { flex: 1; padding: 40px; }
.content-box {
  background: white;
  border-radius: 14px;
  padding: 24px 30px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.nav-btn {
  background: #2f855a;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
  font-weight: 600;
}
.nav-btn:hover { background: #276749; }

/* ==== FOOTER ==== */
.footer {
  background: #2f855a;
  color: white;
  text-align: center;
  padding: 10px;
  font-size: 14px;
}

/* ==== POPUP ==== */
.popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}
.popup.show { display: flex; }
.popup-content {
  background: white;
  padding: 20px 30px;
  border-radius: 12px;
  text-align: center;
  max-width: 400px;
}
.close-popup {
  margin-top: 10px;
  background: #2f855a;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
}

/* === HALAMAN KOMPETENSI (HOME INTERAKTIF) === */
.kompetensi-body {
  background: url('img/bg_zoo.jpg') center/cover no-repeat fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kompetensi-header {
  background: rgba(46, 125, 50, 0.9);
  color: #fff;
  text-align: center;
  padding: 30px 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.kompetensi-header h1 {
  font-size: 40px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: 2px;
}
.kompetensi-header p {
  font-size: 18px;
}
.kelas-info {
  font-style: italic;
  font-size: 15px;
  color: #e0f7e9;
}

.kompetensi-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

.card-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
}

.menu-card {
  background: #fff;
  width: 260px;
  height: 260px;
  border-radius: 20px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: 0.3s ease;
}
.menu-card img {
  width: 100px;
  height: 100px;
  margin-bottom: 15px;
}
.menu-card h2 {
  color: #2e7d32;
  font-weight: 700;
}

.menu-card.active:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 25px rgba(46,125,50,0.4);
}

.menu-card.inactive {
  opacity: 0.6;
  cursor: not-allowed;
}

.kompetensi-footer {
  background: rgba(46, 125, 50, 0.9);
  color: #fff;
  text-align: center;
  padding: 10px 0;
  font-size: 14px;
}

/* === HALAMAN MATERI (DASHBOARD INTERAKTIF) === */
.materi-body {
  background: linear-gradient(180deg, #e8f9f0, #d2f7dc);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.materi-card {
  background: #fff;
  width: 280px;
  height: 320px;
  border-radius: 22px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 25px 20px;
  cursor: pointer;
  transition: all 0.35s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.materi-card img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.materi-card h2 {
  font-size: 18px;
  color: #2f855a;
  font-weight: 700;
  margin-top: 10px;
}

.materi-card p {
  font-size: 14px;
  color: #444;
  margin-top: 10px;
}

/* Hover Effect: Gerak & Cahaya */
.materi-card.active:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 10px 25px rgba(46,125,50,0.4);
}
.materi-card.active:hover img {
  transform: scale(1.1) rotate(-5deg);
}

/* Locked State */
.materi-card.locked {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(60%);
}
.materi-card.locked::after {
  content: "🔒";
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 20px;
  opacity: 0.8;
}
