/* =============================================
   SainEco - Petualangan Lingkungan
   Global Design System
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&family=Poppins:wght@400;500;600;700;800&display=swap');

/* ---- CSS Variables ---- */
:root {
  /* Primary Palette */
  --eco-green:       #2ECC71;
  --eco-green-dark:  #1A9E52;
  --eco-teal:        #1ABC9C;
  --eco-teal-dark:   #0E9A7D;
  --eco-emerald:     #27AE60;
  --eco-lime:        #A8E063;

  /* Accent */
  --eco-gold:        #F1C40F;
  --eco-amber:       #E67E22;
  --eco-sky:         #3498DB;
  --eco-indigo:      #5C6BC0;

  /* Backgrounds */
  --bg-dark:         #0D1B2A;
  --bg-card:         rgba(255,255,255,0.07);
  --bg-card-hover:   rgba(255,255,255,0.12);
  --bg-overlay:      rgba(13,27,42,0.85);

  /* Text */
  --text-primary:    #FFFFFF;
  --text-secondary:  rgba(255,255,255,0.75);
  --text-muted:      rgba(255,255,255,0.45);

  /* Gradients */
  --grad-hero:       linear-gradient(135deg, #0D1B2A 0%, #1a3a2a 50%, #0D1B2A 100%);
  --grad-green:      linear-gradient(135deg, #2ECC71 0%, #1ABC9C 100%);
  --grad-gold:       linear-gradient(135deg, #F6D365 0%, #FDA085 100%);
  --grad-sky:        linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --grad-coral:      linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --grad-ocean:      linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --grad-forest:     linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);

  /* Effects */
  --shadow-card:     0 8px 32px rgba(0,0,0,0.3);
  --shadow-glow:     0 0 24px rgba(46,204,113,0.4);
  --shadow-gold:     0 0 24px rgba(241,196,15,0.5);
  --radius-lg:       20px;
  --radius-md:       14px;
  --radius-sm:       10px;
  --transition:      all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', 'Poppins', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }
button { cursor: pointer; border: none; font-family: inherit; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0D1B2A; }
::-webkit-scrollbar-thumb { background: var(--eco-green-dark); border-radius: 3px; }

/* =============================================
   LAYOUT
   ============================================= */
.container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* ---- Mobile Phone Frame ---- */
.phone-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: radial-gradient(ellipse at center, #1a2e1a 0%, #050a05 100%);
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,27,42,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(46,204,113,0.15);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-logo {
  width: 36px;
  height: 36px;
  background: var(--grad-green);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.navbar-title {
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--grad-green);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.xp-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(241,196,15,0.15);
  border: 1px solid rgba(241,196,15,0.3);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--eco-gold);
}

.avatar-mini {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--eco-green);
  object-fit: cover;
  overflow: hidden;
  background: var(--grad-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.btn-logout-nav {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.35);
  color: #e74c3c;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-logout-nav:hover {
  background: rgba(231, 76, 60, 0.35);
  color: #fff;
  transform: translateY(-1px);
}

/* =============================================
   BOTTOM NAVIGATION
   ============================================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(13,27,42,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(46,204,113,0.15);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-muted);
}

.nav-item.active {
  color: var(--eco-green);
}

.nav-item:hover { color: var(--text-secondary); }

.nav-icon {
  font-size: 22px;
  line-height: 1;
  transition: var(--transition);
}

.nav-item.active .nav-icon {
  filter: drop-shadow(0 0 6px var(--eco-green));
  transform: scale(1.1);
}

.nav-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-center-btn {
  width: 52px;
  height: 52px;
  background: var(--grad-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 20px rgba(46,204,113,0.5);
  margin-top: -12px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.nav-center-btn:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(46,204,113,0.7); }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 800;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-family: inherit;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: var(--grad-green);
  color: #fff;
  box-shadow: 0 4px 20px rgba(46,204,113,0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(46,204,113,0.6);
}

.btn-secondary {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.3);
  color: var(--text-primary);
}

.btn-secondary:hover {
  border-color: var(--eco-green);
  color: var(--eco-green);
  background: rgba(46,204,113,0.05);
}

.btn-gold {
  background: var(--grad-gold);
  color: #333;
  box-shadow: 0 4px 20px rgba(241,196,15,0.4);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(241,196,15,0.6);
}

.btn-full { width: 100%; }

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(46,204,113,0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

/* =============================================
   PROGRESS BAR
   ============================================= */
.progress-wrap {
  background: rgba(255,255,255,0.1);
  border-radius: 50px;
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 50px;
  background: var(--grad-green);
  transition: width 1s ease;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 40px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6));
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-40px); }
  100% { transform: translateX(40px); }
}

/* =============================================
   UTILITIES
   ============================================= */
.text-gradient {
  background: var(--grad-green);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gold {
  background: var(--grad-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glow-green { box-shadow: var(--shadow-glow); }
.glow-gold  { box-shadow: var(--shadow-gold); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-green {
  background: rgba(46,204,113,0.15);
  border: 1px solid rgba(46,204,113,0.3);
  color: var(--eco-green);
}

.badge-gold {
  background: rgba(241,196,15,0.15);
  border: 1px solid rgba(241,196,15,0.3);
  color: var(--eco-gold);
}

.badge-sky {
  background: rgba(52,152,219,0.15);
  border: 1px solid rgba(52,152,219,0.3);
  color: #5dade2;
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(46,204,113,0.3); }
  50%       { box-shadow: 0 0 40px rgba(46,204,113,0.7); }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes bounce-in {
  0%   { transform: scale(0.3); opacity: 0; }
  50%  { transform: scale(1.05); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes particle {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

.fade-in-up  { animation: fadeInUp 0.6s ease forwards; }
.float-anim  { animation: float 3s ease-in-out infinite; }
.pulse-glow  { animation: pulse-glow 2s ease-in-out infinite; }

/* =============================================
   PARTICLES BACKGROUND
   ============================================= */
.particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  animation: particle 4s linear infinite;
  opacity: 0;
}

/* =============================================
   SECTION HEADERS
   ============================================= */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.section-link {
  font-size: 0.8rem;
  color: var(--eco-green);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.section-link:hover { color: var(--eco-teal); }

/* =============================================
   FORM ELEMENTS
   ============================================= */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 500;
  transition: var(--transition);
  outline: none;
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:focus {
  border-color: var(--eco-green);
  background: rgba(46,204,113,0.05);
  box-shadow: 0 0 0 3px rgba(46,204,113,0.15);
}

.form-icon-wrap {
  position: relative;
}

.form-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.form-icon-wrap .form-control {
  padding-left: 44px;
}

/* =============================================
   AVATAR SELECTOR
   ============================================= */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.avatar-option {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  cursor: pointer;
  transition: var(--transition);
}

.avatar-option:hover,
.avatar-option.selected {
  border-color: var(--eco-green);
  background: rgba(46,204,113,0.1);
  transform: scale(1.05);
}

.avatar-option.selected {
  box-shadow: 0 0 12px rgba(46,204,113,0.4);
}

/* =============================================
   RESPONSIVE HELPERS
   ============================================= */
.mt-1  { margin-top:  4px; }
.mt-2  { margin-top:  8px; }
.mt-3  { margin-top: 12px; }
.mt-4  { margin-top: 16px; }
.mt-5  { margin-top: 24px; }
.mt-6  { margin-top: 32px; }
.mb-1  { margin-bottom:  4px; }
.mb-2  { margin-bottom:  8px; }
.mb-3  { margin-bottom: 12px; }
.mb-4  { margin-bottom: 16px; }
.mb-5  { margin-bottom: 24px; }
.mb-6  { margin-bottom: 32px; }
.p-4   { padding: 16px; }
.p-5   { padding: 20px; }
.text-center { text-align: center; }
.text-sm  { font-size: 0.85rem; }
.text-xs  { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.flex  { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.relative { position: relative; }

/* =============================================
   TOAST NOTIFICATION
   ============================================= */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(13,27,42,0.95);
  border: 1px solid var(--eco-green);
  border-radius: 50px;
  padding: 12px 24px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--eco-green);
  backdrop-filter: blur(10px);
  z-index: 1000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =============================================
   CLICK TO PLACE INTERACTION STYLES
   ============================================= */
.draggable-card {
  cursor: pointer !important;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.draggable-card.card-selected,
.draggable-card.selected,
.condition-card.selected,
.mcq-btn.selected,
.classroom-card.selected {
  border: 3px solid #f39c12 !important;
  background: rgba(243, 156, 18, 0.25) !important;
  box-shadow: 0 0 18px rgba(243, 156, 18, 0.9), inset 0 0 8px rgba(243, 156, 18, 0.4) !important;
  transform: scale(1.04) !important;
  animation: pulse-selection 1.2s infinite alternate;
  z-index: 10;
}

@keyframes pulse-selection {
  0% { box-shadow: 0 0 10px rgba(243, 156, 18, 0.6); }
  100% { box-shadow: 0 0 22px rgba(243, 156, 18, 1); }
}

.drop-zone, .card-pool {
  cursor: pointer;
}

.drop-zone.active-target {
  border: 2px dashed #f1c40f !important;
  background: rgba(241, 196, 15, 0.08) !important;
}

