/* ========================================================
   Ground Up Tasks — Base Styles
   Design tokens, reset, layout, tab bar, loaders
   ======================================================== */

:root {
  --bg-dark: #f3f4f6;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-color-hover: rgba(0, 0, 0, 0.16);

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.15);

  --accent-orange: #d97706;
  --accent-blue: #2563eb;
  --accent-green: #059669;
  --accent-red: #dc2626;

  --text-main: #111827;
  --text-muted: #4b5563;
  --text-dark: #6b7280;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100vh;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}

body {
  display: block;
  position: relative;
}

/* ---- App Frame ---- */
.app-frame {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
}

/* ---- Screen Viewport ---- */
.screen-viewport {
  flex: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 16px 100px 16px;
}

.screen {
  display: none;
  flex-direction: column;
  min-height: auto;
}

.screen.active {
  display: flex;
  animation: screenFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes screenFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Tab Bar ---- */
.tab-bar {
  display: flex;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  padding: 12px 12px 24px;
  justify-content: space-around;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 100;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text-dark);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.tab-item .material-icons {
  font-size: 24px;
  font-variation-settings: 'FILL' 0, 'wght' 400;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), font-variation-settings 0.2s;
}

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

.tab-item.active .material-icons {
  font-variation-settings: 'FILL' 1, 'wght' 600;
  transform: translateY(-2px);
}

.tab-item span:last-child {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.tab-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 22px);
  background-color: var(--accent-red);
  color: white;
  font-size: 8px;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* ---- Loaders & Empty States ---- */
.loader-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px 20px;
}

.neon-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.04);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-state .material-icons {
  font-size: 40px;
  color: var(--text-dark);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}
