@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');

:root {
  /* Colors */
  --primary: #C3991C;            /* Nugget Gold */
  --primary-light: rgba(195, 153, 28, 0.12);
  --accent: #55CD6C;             /* Emerald Green */
  --accent-light: rgba(85, 205, 108, 0.12);
  
  --surface: #ffffff;
  --surface-2: #FAF9F6;          /* Warm Alabaster Cream */
  --surface-3: #F3F1EB;
  
  --text-primary: #1B1D1D;       /* Shark Charcoal Black */
  --text-secondary: #4A4D4D;
  --text-muted: #8E9191;
  
  --border: #E5E2D9;

  /* Typography */
  --font: 'Outfit', sans-serif;
  --font-serif: 'Playfair Display', serif;
  
  /* Metrics */
  --header-height: 64px;
  --nav-height: 72px;
  
  /* Styling */
  --radius: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 4px rgba(27,29,29,0.02);
  --shadow: 0 6px 16px rgba(27,29,29,0.05);
  
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --surface: #171C21;            /* Dark Charcoal Navy */
  --surface-2: #101418;
  --surface-3: #222930;
  
  --text-primary: #FAF9F6;
  --text-secondary: #C8CBCB;
  --text-muted: #7E8282;
  
  --border: #2C353F;
  --primary-light: rgba(195, 153, 28, 0.2);
  --accent-light: rgba(85, 205, 108, 0.2);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--surface-2);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition-slow), color var(--transition-slow);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* ── Desktop Background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 10% 20%, rgba(195, 153, 28, 0.08) 0%, rgba(16, 20, 24, 1) 90%);
  z-index: -1;
}

[data-theme="dark"] body::before {
  background: radial-gradient(circle at 10% 20%, rgba(195, 153, 28, 0.05) 0%, rgba(10, 12, 15, 1) 90%);
}

/* ── Mobile App Frame ── */
.app-frame {
  width: 100%;
  max-width: 430px;
  height: 880px;
  margin: 40px auto;
  background: var(--surface);
  position: relative;
  overflow: hidden;
  border-radius: 48px;
  box-shadow: 
    0 0 0 2px var(--border), 
    0 0 0 10px var(--surface-3), 
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255,255,255,.05);
  transition: all var(--transition-slow);
  display: flex;
  flex-direction: column;
}
.app-frame::-webkit-scrollbar {
  display: none;
}

[data-theme="dark"] .app-frame {
  box-shadow: 
    0 0 0 2px var(--border), 
    0 0 0 10px var(--surface-3), 
    0 30px 80px rgba(0,0,0,.6), 
    inset 0 1px 0 rgba(255,255,255,.05);
}

/* ── Mobile Status Bar ── */
.status-bar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  position: relative;
  z-index: 200;
}
.status-bar .time {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.status-bar .icons {
  display: flex;
  gap: 6px;
  align-items: center;
}
.notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 32px;
  background: #000;
  border-radius: 0 0 20px 20px;
  z-index: 201;
}
[data-theme="dark"] .notch {
  background: #000;
}

/* ── App Header ── */
.app-header {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  transition: background var(--transition-slow), border-color var(--transition-slow);
}

.logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo span { color: var(--primary); }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.icon-btn:active { transform: scale(0.95); }

/* ── Page Content (scrollable area) ── */
.page-content {
  padding-top: 0;
  padding-bottom: 20px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--surface-2);
  transition: background var(--transition-slow);
}
.page-content::-webkit-scrollbar {
  display: none;
}

/* ── Bottom Navigation ── */
.bottom-nav {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  height: var(--nav-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 100;
  transition: background var(--transition-slow), border-color var(--transition-slow);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition);
}

.nav-item.active {
  color: var(--primary);
}

.nav-icon {
  width: 34px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background var(--transition), color var(--transition);
}
.nav-item.active .nav-icon {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* ── Screen System (SPA navigation) ── */
.screen { display: none; }
.screen.active { 
  display: flex; 
  flex-direction: column;
  flex: 1; 
  overflow: hidden; 
}

/* ── Basic Components ── */
.section { padding: 20px 16px; }
.section-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.section-subtitle { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}
.btn-primary { background: var(--primary); color: #11161B; }
.btn-primary:hover { opacity: 0.9; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.btn-block { width: 100%; display: flex; }
