/* Global Styles */
:root {
  --primary-green: #2d6a4f;
  --secondary-green: #40916c;
  --carrot-orange: #f9844a;
  --danger-red: #d90429;
  --bg-light: #f8f9fa;
  --text-dark: #1b4332;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg-light);
  color: var(--text-dark);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.screen {
  width: 100%;
  max-width: 500px; /* Standar mobile portrait */
  background: white;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  min-height: 90vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.btn-icon {
  background: var(--secondary-green);
  padding: 5px 10px;
  font-size: 0.8rem;
  width: auto;
  border-radius: 5px;
}

/* SCREEN 1: HOME */
header {
  text-align: center;
  margin-bottom: 30px;
}
.logo {
  width: 60px;
  margin-bottom: 10px;
}

.hero-box {
  background: var(--primary-green);
  color: white;
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  margin-bottom: 25px;
}

#form-anak input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.info-box {
  background: #e9ecef;
  padding: 15px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.info-box ul {
  margin-left: 20px;
  margin-top: 5px;
}

button {
  width: 100%;
  padding: 15px;
  background: var(--primary-green);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

button:hover {
  background: var(--secondary-green);
}

/* SCREEN 2: RECORDING (Landscape Layout) */
#screen-recording {
  max-width: 1000px; /* Melebar untuk mode landscape */
  padding: 10px;
}

.recording-header {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  font-weight: bold;
  background: #eee;
  border-radius: 8px;
}

.camera-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9; /* Sesuai standar 720p */
  background: #000;
  margin: 10px 0;
  border-radius: 12px;
  overflow: hidden;
}

#output_canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-status-panel {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
  border-radius: 10px;
  width: 180px;
  font-size: 0.8rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #ddd;
  border-radius: 4px;
  margin-top: 5px;
}

#stability-progress {
  height: 100%;
  background: var(--secondary-green);
  width: 0%;
  border-radius: 4px;
  transition: 0.3s;
}

.carrot-float {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 40px;
  animation: bounce 2s infinite;
}

.controls {
  display: flex;
  gap: 10px;
}

#btn-rekam {
  background: var(--danger-red);
}

/* SCREEN 3: RESULT */
.result-card {
  background: #fff;
  border: 2px solid var(--primary-green);
  padding: 20px;
  border-radius: 15px;
  margin-top: 20px;
}

.test-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.summary-box {
  margin-top: 20px;
  padding: 20px;
  background: #ffc300;
  border-radius: 10px;
  text-align: center;
}

.disclaimer {
  font-size: 0.75rem;
  color: #666;
  margin-top: 15px;
  font-style: italic;
  text-align: center;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Responsivitas untuk Landscape Mobile */
@media (orientation: landscape) {
  .screen {
    max-width: 95vw;
    min-height: 95vh;
  }
}
