:root {
  /* Color Palette */
  --primary-orange: #FF6B35;
  --secondary-green: #10B981;
  --accent-red: #EF4444;
  --neutral-cream: #FFF7ED;
  --neutral-white: #FFFFFF;
  --dark-charcoal: #1F2937;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  
  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #FF6B35 0%, #FF8F6B 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.1));
  --gradient-glass-dark: linear-gradient(135deg, rgba(31, 41, 55, 0.8), rgba(31, 41, 55, 0.6));

  /* Typography */
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-accent: 'Caveat', cursive;
  
  /* Sizing & Spacing */
  --header-height: clamp(60px, 8vh, 80px);
  --bottom-nav-height: 80px;
  --safe-area-top: env(safe-area-inset-top, 20px);
  --safe-area-bottom: env(safe-area-inset-bottom, 20px);
  
  /* Shadows - Neumorphic & Modern */
  --shadow-soft: 8px 8px 24px rgba(166, 171, 189, 0.2), -8px -8px 24px rgba(255, 255, 255, 0.8);
  --shadow-float: 0 10px 40px -10px rgba(255, 107, 53, 0.3);
  --shadow-inner: inset 2px 2px 5px rgba(166, 171, 189, 0.2), inset -2px -2px 5px rgba(255, 255, 255, 0.7);
  
  /* Radius */
  --radius-sm: 12px;
  --radius-md: 24px;
  --radius-lg: 32px;
  --radius-pill: 50px;
}

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

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

body {
  margin: 0;
  background-color: var(--neutral-cream);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
}

/* Typography Scale */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  margin: 0;
  line-height: 1.2;
}

h1 { font-size: clamp(24px, 6vw, 40px); }
h2 { font-size: clamp(20px, 5vw, 32px); }
h3 { font-size: clamp(18px, 4vw, 24px); }

p {
  font-size: clamp(14px, 4vw, 16px);
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
}

.font-accent {
  font-family: var(--font-accent);
  font-size: 1.4em;
  color: var(--primary-orange);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.flex-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.grid-bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .grid-bento {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-bento {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Components */

/* Cards */
.card {
  background: var(--neutral-white);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.card:active {
  transform: scale(0.98);
}

/* Glassmorphism */
.glass {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
  background: rgba(31, 41, 55, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Buttons */
.btn {
  border: none;
  border-radius: var(--radius-pill);
  padding: 14px 28px;
  font-weight: 600;
  font-family: var(--font-body);
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-hero);
  color: white;
  box-shadow: var(--shadow-float);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px rgba(255, 107, 53, 0.4);
}

.btn-secondary {
  background: var(--neutral-white);
  color: var(--text-primary);
  box-shadow: var(--shadow-soft);
}

.btn-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--neutral-white);
  box-shadow: var(--shadow-soft);
  color: var(--text-primary);
  border: none;
  cursor: pointer;
}

/* Navigation */
.nav-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: var(--safe-area-bottom);
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
}

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

.nav-fab {
  background: var(--gradient-hero);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -32px;
  box-shadow: var(--shadow-float);
  color: white;
  font-size: 28px;
}

/* Form Elements */
.search-bar {
  background: var(--neutral-white);
  border-radius: var(--radius-pill);
  padding: 16px 24px;
  width: 100%;
  border: none;
  box-shadow: var(--shadow-inner);
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
}

.chip {
  padding: 8px 20px;
  background: var(--neutral-white);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  background: rgba(255, 107, 53, 0.1);
  color: var(--primary-orange);
  border-color: var(--primary-orange);
}

/* Image Placeholders */
.placeholder-image {
  background-color: #E5E7EB;
  background-image: url('data:image/svg+xml,%3Csvg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M20 20.5L20 20.5" stroke="%239CA3AF" stroke-width="2" stroke-linecap="round"/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: center;
  width: 100%;
  object-fit: cover;
  display: block;
}

.aspect-square { aspect-ratio: 1/1; }
.aspect-video { aspect-ratio: 16/9; }
.aspect-portrait { aspect-ratio: 3/4; }

/* Camera Overlay */
.camera-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: -1;
  object-fit: cover;
}

.scan-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 32px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

.corner-guide {
  position: absolute;
  width: 40px;
  height: 40px;
  border-color: var(--primary-orange);
  border-style: solid;
  border-width: 4px;
}
.tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 30px; }
.tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 30px; }
.bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 30px; }
.br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 30px; }

/* Masonry for Community */
.masonry-col {
  column-count: 1;
  column-gap: 20px;
}
@media (min-width: 640px) { .masonry-col { column-count: 2; } }
@media (min-width: 1024px) { .masonry-col { column-count: 3; } }

.masonry-item {
  break-inside: avoid;
  margin-bottom: 20px;
}

/* Animations */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0px); }
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

@keyframes scan {
  0% { top: 0; }
  50% { top: 100%; }
  100% { top: 0; }
}

.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-orange);
  box-shadow: 0 0 10px var(--primary-orange);
  animation: scan 2s infinite ease-in-out;
}

/* Utility */
.full-width { width: 100%; }
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }

/* Range Slider Customization */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 24px;
  width: 24px;
  border-radius: 50%;
  background: var(--primary-orange);
  cursor: pointer;
  margin-top: -10px;
  box-shadow: var(--shadow-float);
}
input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  background: #E5E7EB;
  border-radius: 2px;
}
