/* ============================================
   Navigation & Screen Control
   ============================================ */
body {
  position: relative;
  overflow-x: hidden;
}

/* Ambient orb glows — matches landing page */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(70px);
}

body::before {
  width: 360px;
  height: 360px;
  top: -120px;
  right: -90px;
  background: radial-gradient(circle, rgba(244, 197, 66, 0.18), rgba(244, 197, 66, 0));
  animation: appAuraFloat 14s ease-in-out infinite;
}

body::after {
  width: 260px;
  height: 260px;
  left: -70px;
  bottom: 90px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
  animation: appAuraFloat 17s ease-in-out infinite reverse;
}

/* ============================================
   Bottom Navigation — Glassmorphism
   ============================================ */
.bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(14, 14, 14, 0.82);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 60px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  z-index: 1000;
  box-sizing: border-box;
  box-shadow: 0 -1px 30px rgba(0, 0, 0, 0.55),
              0 -1px 0 rgba(255, 255, 255, 0.04) inset;
}

.nav-item {
  color: var(--color-text-muted, #888);
  text-decoration: none;
  padding: 8px 5px;
  flex: 1;
  text-align: center;
  transition: color 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Gold bottom indicator line */
.nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 28px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px 2px 0 0;
  box-shadow: 0 0 8px rgba(244, 197, 66, 0.5);
  transition: transform 0.35s var(--ease-spring, cubic-bezier(0.16, 1, 0.3, 1));
}

.nav-item i {
  font-size: 20px;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-spring, ease), color 0.3s ease,
              filter 0.3s ease;
}

.nav-item:hover {
  color: var(--text, #f0f0f0);
}

.nav-item:hover i {
  transform: translateY(-2px);
}

/* Active state — gold icon + underline */
.nav-item.active {
  color: var(--color-accent);
  background: transparent;
  box-shadow: none;
}

.nav-item.active::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-item.active i {
  color: var(--color-accent);
  filter: drop-shadow(0 0 7px rgba(244, 197, 66, 0.55));
}

.nav-item span {
  font-size: 10px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  transition: color 0.3s ease;
}

/* ============================================
   App Container & Screens
   ============================================ */
.app {
  position: relative;
  z-index: 1;
  padding: 0 16px 78px;
  animation: appRevealUp 600ms var(--ease-spring, cubic-bezier(0.16, 1, 0.3, 1)) both;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: screenFadeIn 360ms var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)) both;
}

.screen.active > * {
  animation: screenRevealUp 500ms var(--ease-spring, cubic-bezier(0.16, 1, 0.3, 1)) both;
}

/* ============================================
   Section Headings — Gold underline accent
   ============================================ */
section h1 {
  text-align: center;
  padding: 20px 0 4px;
  font-size: clamp(1.4rem, 5vw, 1.85rem);
  letter-spacing: -0.02em;
  position: relative;
}

section h1::after {
  content: '';
  display: block;
  width: 28px;
  height: 2.5px;
  background: var(--color-accent);
  border-radius: 2px;
  margin: 8px auto 0;
  box-shadow: 0 0 12px var(--color-accent-glow, rgba(244, 197, 66, 0.4));
}

/* ============================================
   Background Watermark
   ============================================ */
.background-text {
  animation: backgroundPulse 10s ease-in-out infinite;
}

/* ============================================
   Keyframes
   ============================================ */
@keyframes appRevealUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes screenFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes screenRevealUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes appAuraFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%       { transform: translate3d(0, -12px, 0) scale(1.06); }
}

@keyframes backgroundPulse {
  0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  50%       { opacity: 0.8; transform: translate(-50%, -50%) scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  body::before, body::after, .background-text, .app,
  .screen.active, .screen.active > * {
    animation: none !important;
  }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 568px) {
  body::before { width: 240px; height: 240px; }
  body::after  { width: 190px; height: 190px; }
  .bottom-nav  { height: 58px; }
  .nav-item    { padding: 6px 4px; gap: 2px; }
  .nav-item i  { font-size: 18px; }
  .nav-item span { font-size: 9px; }
  .app         { padding: 0 12px 76px; }
}

@media (min-width: 568px) and (max-width: 768px) {
  .bottom-nav  { height: 62px; }
  .nav-item    { padding: 8px 6px; }
  .nav-item i  { font-size: 22px; }
  .nav-item span { font-size: 11px; }
  .app         { padding: 0 16px 78px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .bottom-nav { height: 66px; }
  .nav-item   { padding: 10px 8px; }
  .nav-item i { font-size: 24px; }
  .nav-item span { font-size: 12px; }
  .app { padding: 0 20px 82px; }
}

@media (min-width: 1025px) {
  body { padding-bottom: 0; }
  .app {
    max-width: 900px;
    margin: 20px auto 0;
    padding: 0 16px 40px;
  }
  .bottom-nav {
    border-top: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    position: relative;
    height: 72px;
    width: 100%;
    justify-content: center;
    gap: 40px;
    backdrop-filter: none;
    background: rgba(14, 14, 14, 0.96);
  }
  .nav-item {
    flex: unset;
    padding: 20px 28px;
    gap: 8px;
  }
  .nav-item i  { font-size: 24px; }
  .nav-item span { font-size: 14px; }
}

/* Light mode adjustments */
:root.light-mode .bottom-nav {
  background: rgba(245, 245, 245, 0.88);
  border-top-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 -1px 20px rgba(0, 0, 0, 0.12);
}

:root.light-mode body::before {
  background: radial-gradient(circle, rgba(224, 168, 0, 0.12), rgba(224, 168, 0, 0));
}
