:root {
  --bg-dark: #0b0e14;
  --bg-light: #f4f6f8;
  --nav-bg-dark: #12161e;
  --nav-bg-light: #ffffff;
  --text-dark: #e8e8ea;
  --text-light: #1f2937;
  --muted-dark: #9aa3ab;
  --muted-light: #6b7280;
  --card-dark: #141820;
  --card-light: #ffffff;
  --brand: #6da2ff;
  --shadow: 0 8px 24px rgba(0,0,0,0.15);
  --radius: 16px;
  --transition: all .3s ease;
}

/* Default to dark, overridden by .light class */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-dark);
  color: var(--text-dark);
  margin: 0;
  overflow-x: hidden;
  transition: var(--transition);
}

body.light {
  background: var(--bg-light);
  color: var(--text-light);
}

body.light .simple-card { background: var(--card-light); }
body.light .about-section { color: var(--muted-light); }
body.light footer p { color: var(--muted-light); }
body.light nav { background: var(--nav-bg-light); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
body.light .nav-menu a { color: var(--text-light); }

/* --- NAVBAR --- */
.nav-container {
  display: flex;
  justify-content: center;
  padding: 15px;
  position: sticky;
  top: 0;
  z-index: 1000;
}
nav {
  background: var(--nav-bg-dark);
  border-radius: 99px;
  box-shadow: var(--shadow);
  padding: 12px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1000px;
  transition: var(--transition);
}
.nav-brand {
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  font-size: 1.1rem;
}
.nav-menu {
  display: flex;
  gap: 20px;
  align-items: center;
}
.nav-menu a {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}
.nav-menu a:hover { color: var(--brand); }
.nav-toggle {
  all: unset;
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
}
.nav-toggle .bar {
  width: 24px;
  height: 3px;
  background-color: var(--brand);
  border-radius: 3px;
  transition: all 0.3s ease-in-out;
}
/* Hamburger animation */
.nav-toggle.open .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.nav-toggle.open .bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Theme Toggle inside Nav */
.theme-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}
body.light .theme-toggle-btn { color: var(--text-light); }

.desktop-theme { display: flex; }
.mobile-controls { display: none; align-items: center; gap: 15px; }

/* --- ANIMATE ON SCROLL --- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media(max-width: 768px) {
  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 75px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    background: var(--nav-bg-dark);
    border-radius: 15px;
    box-shadow: var(--shadow);
    padding: 10px 0;
    z-index: 1000;
  }
  body.light .nav-menu { background: var(--nav-bg-light); }
  .nav-menu.show { display: flex; animation: dropDown 0.3s ease; }
  .nav-menu a {
    padding: 12px 20px;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(128,128,128,0.1);
  }
  .nav-toggle { display: flex; }
  .desktop-theme { display: none; }
  .mobile-controls { display: flex; }
  nav { padding: 12px 20px; }
}

@keyframes dropDown {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes fadeInSlide {
  from { opacity: 0; transform: translateY(15px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.fade-in {
  animation: fadeInSlide 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* --- HEADER --- */
header {
  text-align: center;
  padding: 40px 20px 20px;
}
header h1 {
  font-size: 1.8rem;
  color: var(--brand);
  margin-bottom: 5px;
}
header p {
  color: var(--muted-dark);
  font-size: 0.95rem;
}
body.light header p { color: var(--muted-light); }

/* --- TOGGLE BUTTONS --- */
.toggle-btn {
  display: inline-flex;
  background: #181c24;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 20px;
}
body.light .toggle-btn { background: #e5e7eb; }
.toggle-btn button {
  background: transparent;
  color: var(--muted-dark);
  border: none;
  padding: 10px 25px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 99px;
}
body.light .toggle-btn button { color: var(--muted-light); }
.toggle-btn button.active {
  background: var(--brand);
  color: white;
}

/* --- MAIN CARDS --- */
main.container {
  max-width: 900px;
  margin: auto;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.card {
  position: relative;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  display: block;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  transition: var(--transition);
}
.card:hover::before { background: rgba(0,0,0,0.2); }
.card-content {
  position: relative;
  z-index: 1;
  padding: 25px 20px;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(109,162,255,0.2);
}
.pagi { background: url('/assets/images/6.png') center/cover; }
.petang { background: url('/assets/images/5.png') center/cover; }

.card h2 {
  font-size: 16px;
  color: #fff;
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card p {
  font-size: 13px;
  color: #e0e0e0;
  margin-bottom: 0;
  line-height: 1.5;
}

/* --- SURAH SECTION --- */
.extra-section {
  max-width: 900px;
  margin: 50px auto 30px;
  padding: 0 20px;
}
.extra-section > h2 {
  color: var(--brand);
  text-align: center;
  margin-bottom: 30px;
}
.simple-card {
  background: var(--card-dark);
  padding: 25px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 15px;
  text-decoration: none;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}
.simple-card-body {
  flex: 1;
}
.simple-card-arrow {
  color: var(--brand);
  font-size: 1.5rem;
  opacity: 0.3;
  transition: var(--transition);
  margin-left: 15px;
}
.simple-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(109,162,255,0.15);
}
.simple-card:hover .simple-card-arrow {
  opacity: 1;
  transform: translateX(5px);
}
.simple-card h3 {
  margin-top: 0;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  margin-bottom: 8px;
}
body.light .simple-card h3 { color: var(--text-light); }
.simple-card p {
  margin-bottom: 0;
  color: var(--muted-dark);
  font-size: 0.9rem;
  line-height: 1.6;
}
body.light .simple-card p { color: var(--muted-light); }

/* --- ABOUT SECTION --- */
.about-section {
  max-width: 800px;
  margin: 60px auto 20px;
  padding: 0 20px;
  line-height: 1.8;
  color: var(--muted-dark);
  text-align: center;
}
.about-section h2 { color: var(--brand); }
.about-section strong { color: var(--text-dark); }
body.light .about-section strong { color: var(--text-light); }

/* --- APP BADGES --- */
.app-badges-title { color: var(--text-dark); }
body.light .app-badges-title { color: var(--text-light); }
.app-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 25px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.app-badges img {
  height: 45px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 8px;
}
.app-badges img:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* ==== Emotions Grid (Homepage) ==== */
.emotions-grid {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-top: 15px; padding: 5px;
}
.emotion-card-old {
  padding: 10px 20px; border-radius: 999px;
  font-size: 0.95rem; font-weight: 600;
  text-decoration: none; color: #1f2937;
  background: var(--emo-color, #e5e7eb);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.05);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  
}
.emotion-card-old:hover { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(0,0,0,0.15); filter: brightness(0.95); }
body.dark .emotion-card-old {
  color: #111827; border-color: rgba(255,255,255,0.1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.emotions-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
  padding: 10px;
}
@media(max-width: 768px) {
  .emotions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 5px;
  }
}

.emotion-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px 10px;
  border-radius: 16px;
  background: white;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05), inset 0 2px 5px rgba(255,255,255,0.6);
  text-decoration: none;
  color: var(--text, #1f2937);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-align: center;
}
.emotion-card .emo-icon {
  margin-bottom: 8px;
}
.emotion-card .emo-icon svg { 
  width: 40px; height: 40px; 
}
.emotion-card .emo-name {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
}
.emotion-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  background: var(--emo-color);
  color: #000;
}
body.dark .emotion-card {
  background: #1f2937;
  color: #f3f4f6;
  border-color: rgba(255,255,255,0.05);
  box-shadow: 0 4px 10px rgba(0,0,0,0.4), inset 0 2px 5px rgba(255,255,255,0.1);
}
body.dark .emotion-card:hover {
  background: var(--emo-color);
  color: #000;
}


/* Emotion Specific Subtle Animations */
@keyframes emoFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes emoPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes emoTilt { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(8deg); } 75% { transform: rotate(-8deg); } }
@keyframes emoDroop { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(2px) scaleY(0.95); } }
@keyframes emoShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2px) rotate(-3deg); } 75% { transform: translateX(2px) rotate(3deg); } }

.emo-anim-content, .emo-anim-confident, .emo-anim-grateful {
  animation: emoFloat 4s ease-in-out infinite;
}
.emo-anim-anxious, .emo-anim-greedy {
  animation: emoPulse 3s ease-in-out infinite;
}
.emo-anim-confused, .emo-anim-doubtful {
  animation: emoTilt 5s ease-in-out infinite;
}
.emo-anim-sad, .emo-anim-depressed, .emo-anim-bored {
  animation: emoDroop 4s ease-in-out infinite;
}
.emo-anim-angry {
  animation: emoShake 3s ease-in-out infinite;
}

/* Pause animations if user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .emo-icon { animation: none !important; }
}


