/**
 * ShredFit Shared Styles
 * Common CSS used across all app pages.
 * Include via <link rel="stylesheet" href="/shared.css">
 */

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

html, body {
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
}

/* ========== CSS CUSTOM PROPERTIES (Dark Theme) ========== */
:root {
  /* Backgrounds */
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-elevated: #1a1a1a;
  --bg-hover: #1f1f1f;

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);

  /* Text */
  --text: #f5f5f5;
  --text-secondary: #8b8b8b;
  --text-tertiary: #555;

  /* Accent */
  --accent: #6366f1;
  --accent-dark: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.15);

  /* Status Colors */
  --green: #22c55e;
  --green-glow: rgba(34, 197, 94, 0.12);
  --blue: #3b82f6;
  --blue-glow: rgba(59, 130, 246, 0.12);
  --purple: #a78bfa;
  --purple-glow: rgba(167, 139, 250, 0.12);
  --orange: #f97316;
  --red: #ef4444;
  --yellow: #eab308;

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', system-ui, sans-serif;

  /* Border Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Safe Areas */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ========== BASE BODY ========== */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(80px + var(--safe-bottom));
}

/* ========== BOTTOM NAV ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 8px 0 calc(8px + var(--safe-bottom));
  display: flex;
  justify-content: space-around;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  padding: 4px 8px;
  transition: color 0.15s;
}

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

.nav-item svg {
  width: 20px;
  height: 20px;
}

/* ========== TOAST (used by common.js showToast) ========== */
.toast-container {
  position: fixed;
  bottom: calc(80px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.3s ease-out;
  white-space: nowrap;
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.3);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), var(--bg-elevated));
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.3);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), var(--bg-elevated));
}

/* ========== COMMON ANIMATIONS ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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