/* app.css - Pure CSS / Android Friendly (Mobile First) */
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=Baloo+2:wght@500;700;800&display=swap');

:root {
  --bg: #FFF8EE;
  --dark: #362B4F;
  --gray: #6B6280;
  --teal: #2EC4B6;
  --teal-d: #1F9C90;
  --coral: #FF6F59;
  --line: #EFE4D0;
  --white: #FFFFFF;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Atkinson Hyperlegible', sans-serif;
  background: linear-gradient(180deg, #EFEAFE 0%, #FDF3E4 55%, #FDEBD8 100%);
  color: var(--dark);
  display: flex;
  justify-content: center;
}

/* Container Responsif Ramah Android */
.app-container {
  width: 100%;
  max-width: 600px;
  height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

@media(max-width: 600px) {
  .app-container {
    box-shadow: none;
  }
}

/* Header Aplikasi */
.app-topbar {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--line);
  background: var(--white);
}

.app-topbar h1 {
  margin: 0;
  font-family: 'Baloo 2', sans-serif;
  font-size: 20px;
  color: var(--teal-d);
}

.user-badge {
  font-size: 13px;
  font-weight: 700;
  background: #F3EEFB;
  padding: 6px 12px;
  border-radius: 20px;
}

.user-badge a {
  color: var(--teal-d);
  text-decoration: none;
}

/* Manajer Tab Animasi */
.tab-screen {
  flex: 1;
  display: none;
  padding: 20px 20px 100px 20px;
  overflow-y: auto;
  min-height: 0;
  /* KUNCI: Mencegah tab mendorong bottom nav keluar layar */
}

.tab-screen.active {
  display: block;
  animation: fade 0.3s ease;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Navigasi Bawah (Bottom Navigation Khusus Android) */
.bottom-nav {
  display: flex;
  background: var(--white);
  border-top: 2px solid var(--line);
  padding: 10px 0 15px;
  flex-shrink: 0;
  /* KUNCI: Mencegah tergencet */
  z-index: 100;
}

.nav-btn {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--gray);
  cursor: pointer;
  gap: 3px;
  font-family: 'Atkinson Hyperlegible';
}

/* Memperbesar ukuran emoji agar proporsional */
.nav-btn span:first-child {
  font-size: 22px;
  margin-bottom: 4px;
}

.nav-btn span:last-child {
  font-size: 11px;
}

.nav-btn.active {
  color: var(--teal-d);
  font-weight: bold;
}

/* Hero Card (Beranda) */
.hero-card {
  background: linear-gradient(135deg, var(--teal), var(--teal-d));
  color: var(--white);
  border-radius: 20px;
  padding: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hero-text h2 {
  margin: 0 0 10px;
  font-family: 'Baloo 2', sans-serif;
}

.hero-text p {
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.9;
  margin-bottom: 15px;
}

.hero-icon {
  font-size: 60px;
}

/* Tombol Dasar */
.btn-primary {
  background: #FFB627;
  color: var(--dark);
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-family: 'Baloo 2', sans-serif;
  font-size: 15px;
  cursor: pointer;
  width: auto;
  transition: transform 0.2s;
}

.btn-primary:active {
  transform: scale(0.95);
}

.btn-block {
  width: 100%;
  margin-top: 10px;
}

/* Kontainer AR & Canvas */
.ar-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 15px;
}

.mirror {
  transform: scaleX(-1);
}

.hidden-vid {
  display: none;
}

.window-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.loader-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Panel Interaktif AR */
.ar-panel {
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 15px;
}

.target-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.target-box h3 {
  margin: 0;
  font-family: 'Baloo 2', sans-serif;
  font-size: 22px;
  color: var(--teal-d);
}

.target-box p {
  margin: 0;
  font-size: 13px;
  color: var(--gray);
}

.target-emoji {
  font-size: 40px;
}

.status-box {
  padding: 15px;
  background: #F8F9FA;
  border-radius: 15px;
  text-align: center;
  border: 2px solid var(--line);
  transition: background 0.3s;
}

.status-box h2 {
  margin: 5px 0;
  font-size: 28px;
}

.feedback-wait {
  color: var(--coral);
  font-size: 12px;
  margin: 0;
}

.feedback-ok {
  color: var(--teal-d);
  font-size: 12px;
  font-weight: bold;
  margin: 0;
}

.progress-box {
  margin-top: 15px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 8px;
}

.score-row strong {
  color: var(--teal-d);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--teal);
  transition: width 0.3s;
}

/* Grid Belajar Modul */
h2 {
  font-family: 'Baloo 2', sans-serif;
  margin-bottom: 5px;
  margin-top: 0;
  color: var(--dark);
}

.subtitle {
  color: var(--gray);
  font-size: 14px;
  margin-top: 0;
  margin-bottom: 20px;
}

.modern-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.grid-item {
  background: var(--white);
  border: 2px solid var(--line);
  padding: 20px;
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
}

.grid-item span {
  font-size: 40px;
  display: block;
  margin-bottom: 10px;
}

.grid-item b {
  font-family: 'Baloo 2', sans-serif;
  font-size: 18px;
  color: var(--dark);
}

.grid-item sub {
  font-size: 10px;
  color: var(--gray);
  font-weight: bold;
  text-transform: uppercase;
}

/* Progres Dashboard */
.stats-row {
  display: flex;
  gap: 15px;
}

.stat-card {
  flex: 1;
  background: var(--white);
  border: 2px solid var(--line);
  padding: 15px;
  border-radius: 16px;
  text-align: center;
}

.stat-card h3 {
  font-size: 30px;
  margin: 5px 0 0;
  color: var(--teal-d);
  font-family: 'Baloo 2', sans-serif;
}

/* Setelan Zona Berbahaya */
.setting-item {
  background: #FFF0EE;
  padding: 15px;
  border-radius: 15px;
}

.setting-item b {
  color: var(--coral);
}

.setting-item p {
  font-size: 13px;
  color: var(--gray);
  margin: 5px 0 10px;
}

.btn-danger {
  background: rgba(255, 111, 89, 0.2);
  color: var(--coral);
  border: none;
  padding: 10px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
}

.btn-danger-solid {
  background: var(--coral);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  flex: 1;
}

.btn-secondary {
  background: var(--gray);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  flex: 1;
}

.confirm-zone {
  display: flex;
  gap: 10px;
}

.hidden {
  display: none !important;
}



/* Success Modal Overlay */
.success-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s;
}

.success-card {
  background: white;
  border-radius: 20px;
  padding: 25px;
  text-align: center;
  transform: scale(0.8);
  animation: popIn 0.4s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 80%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.success-icon {
  font-size: 60px;
  margin-bottom: 10px;
}

.success-card h3 {
  color: var(--teal-d);
  font-family: 'Baloo 2', sans-serif;
  margin: 0 0 5px;
  font-size: 24px;
}

.success-card p {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 20px;
}

@keyframes popIn {
  to {
    transform: scale(1);
  }
}