/* ═══════════════════════════════════════════════════════════
   FAKE TATTOO — Design System
   Dark mode, glassmorphism, micro-animations
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ─── CSS Variables ──────────────────────────────────── */
:root {
  /* Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.06);

  /* Accent */
  --accent: #c8ff00;
  --accent-dim: rgba(200, 255, 0, 0.15);
  --accent-glow: rgba(200, 255, 0, 0.3);
  --accent-secondary: #00d4ff;
  --accent-pink: #ff3d8e;

  /* Text */
  --text-primary: #f0f0f5;
  --text-secondary: rgba(240, 240, 245, 0.6);
  --text-muted: rgba(240, 240, 245, 0.35);

  /* Status */
  --success: #00e676;
  --warning: #ffab00;
  --error: #ff5252;
  --info: #40c4ff;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--accent-glow);

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

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s var(--ease-out);
}
a:hover { opacity: 0.8; }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ─── Typography ─────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.375rem, 4vw, 1.875rem); }
h3 { font-size: clamp(1.125rem, 3vw, 1.5rem); }
h4 { font-size: 1.125rem; }

.text-accent { color: var(--accent); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* ─── App Shell ──────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.page {
  flex: 1;
  padding: var(--space-lg);
  padding-bottom: calc(80px + var(--safe-bottom));
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  animation: fadeIn 0.3s var(--ease-out);
}

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

/* ─── Header ─────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: var(--space-md) var(--space-lg);
  padding-top: calc(var(--safe-top) + var(--space-md));
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-header__logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-header__credits {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 14px;
  background: var(--accent-dim);
  border: 1px solid rgba(200, 255, 0, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
}

.app-header__credits-icon {
  font-size: 1rem;
}

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

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-xs) var(--space-md);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 500;
  transition: all 0.2s var(--ease-out);
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav__item-icon {
  font-size: 1.375rem;
  transition: transform 0.2s var(--ease-spring);
}

.bottom-nav__item.active {
  color: var(--accent);
}

.bottom-nav__item.active .bottom-nav__item-icon {
  transform: scale(1.15);
}

.bottom-nav__item:active .bottom-nav__item-icon {
  transform: scale(0.9);
}

/* ─── Glass Card ─────────────────────────────────────── */
.card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s var(--ease-out);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card--accent {
  border-color: rgba(200, 255, 0, 0.2);
  background: linear-gradient(135deg, rgba(200, 255, 0, 0.05), rgba(0, 212, 255, 0.03));
}

.card--flat {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.card--flat:hover {
  transform: none;
}

/* ─── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  outline: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--accent);
  color: #0a0a0f;
  box-shadow: var(--shadow-glow);
}
.btn--primary:hover {
  background: #d4ff33;
  box-shadow: 0 0 30px var(--accent-glow);
}

.btn--secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}
.btn--secondary:hover {
  background: var(--bg-card-hover);
}

.btn--outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn--block { width: 100%; }

.btn--lg {
  padding: 16px 32px;
  font-size: 1.0625rem;
  border-radius: var(--radius-lg);
}

.btn--sm {
  padding: 8px 16px;
  font-size: 0.8125rem;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── Input ──────────────────────────────────────────── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.input-group label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: all 0.2s var(--ease-out);
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.input::placeholder {
  color: var(--text-muted);
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ─── Badge / Tag ────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge--pending {
  background: rgba(255, 171, 0, 0.15);
  color: var(--warning);
}
.badge--completed {
  background: rgba(0, 230, 118, 0.15);
  color: var(--success);
}
.badge--processing {
  background: rgba(64, 196, 255, 0.15);
  color: var(--info);
}
.badge--error {
  background: rgba(255, 82, 82, 0.15);
  color: var(--error);
}

/* ─── Stats Grid ─────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.stat-card {
  padding: var(--space-lg);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  text-align: center;
}

.stat-card__value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-card__label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── Design Card ────────────────────────────────────── */
.design-card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  transition: all 0.3s var(--ease-out);
  cursor: pointer;
}

.design-card:hover {
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.design-card__image {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.design-card__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-xs);
}

.design-card__title {
  font-weight: 600;
  font-size: 0.9375rem;
}

.design-card__meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ─── Product Grid ───────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.product-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  transition: all 0.3s var(--ease-out);
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.product-card__image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-secondary);
}

.product-card__info {
  padding: var(--space-md);
}

.product-card__name {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__price {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: var(--space-xs);
}

/* ─── Empty State ────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  gap: var(--space-md);
}

.empty-state__icon {
  font-size: 3rem;
  opacity: 0.3;
}

.empty-state__title {
  font-size: 1.125rem;
  font-weight: 600;
}

.empty-state__text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 280px;
}

/* ─── Loading Skeleton ───────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-glass) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    var(--bg-glass) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ─── Auth Page ──────────────────────────────────────── */
.auth-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space-xl);
  max-width: 420px;
  margin: 0 auto;
}

.auth-page__brand {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.auth-page__brand h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-page__brand p {
  color: var(--text-secondary);
  margin-top: var(--space-sm);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.auth-form__divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin: var(--space-sm) 0;
}

.auth-form__link {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ─── Section Header ─────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.section-header h2 {
  font-size: 1.25rem;
}

.section-header__action {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
}

/* ─── Spacing helpers ────────────────────────────────── */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ─── Toast Notification ─────────────────────────────── */
.toast {
  position: fixed;
  top: calc(var(--safe-top) + var(--space-md));
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  z-index: 1000;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.4s var(--ease-spring);
  max-width: 90vw;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast--success {
  background: rgba(0, 230, 118, 0.15);
  border: 1px solid rgba(0, 230, 118, 0.3);
  color: var(--success);
}

.toast--error {
  background: rgba(255, 82, 82, 0.15);
  border: 1px solid rgba(255, 82, 82, 0.3);
  color: var(--error);
}

/* ─── CTA Hero Card ──────────────────────────────────── */
.hero-cta {
  position: relative;
  overflow: hidden;
  padding: var(--space-xl);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(200, 255, 0, 0.1), rgba(0, 212, 255, 0.05));
  border: 1px solid rgba(200, 255, 0, 0.15);
}

.hero-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  pointer-events: none;
}

.hero-cta h3 {
  position: relative;
  z-index: 1;
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.hero-cta p {
  position: relative;
  z-index: 1;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: var(--space-lg);
}

/* ─── Responsive ─────────────────────────────────────── */
@media (min-width: 768px) {
  .page {
    max-width: 600px;
    padding: var(--space-xl);
  }

  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ─── Page Transitions ───────────────────────────────── */
.page-enter {
  animation: pageSlideIn 0.35s var(--ease-out) forwards;
}

@keyframes pageSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ─── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 4px;
}

/* ─── Selection ──────────────────────────────────────── */
::selection {
  background: var(--accent);
  color: var(--bg-primary);
}
