/* PotatoGuard - Design System
 * High Contrast UI for Outdoor Agricultural Use
 */

/* ========================================
   CSS VARIABLES
======================================== */
:root {
  /* Colors - Eco-Tech Palette */
  --primary: #059669; /* Emerald 600 */
  --primary-dark: #064e3b; /* Emerald 900 */
  --primary-light: #34d399; /* Emerald 400 */

  --accent: #84cc16; /* Lime 500 */
  --accent-dark: #4d7c0f; /* Lime 700 */
  --accent-light: #bef264; /* Lime 300 */

  /* Status Colors */
  --success: #10b981; /* Emerald 500 */
  --warning: #f59e0b; /* Amber 500 */
  --danger: #ef4444; /* Red 500 */
  --info: #0ea5e9; /* Sky 500 */

  /* Neutral Colors */
  --bg-primary: #f0fdf4; /* Light Emerald Tint */
  --bg-secondary: #ffffff;
  --bg-overlay: rgba(6, 78, 59, 0.4); /* Dark Emerald Overlay */

  --text-primary: #064e3b; /* Dark Emerald Text */
  --text-secondary: #374151; /* Gray 700 */
  --text-light: #6b7280; /* Gray 500 */
  --text-inverse: #ffffff;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  --glass-blur: blur(12px);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(6, 78, 59, 0.08);
  --shadow-lg: 0 16px 48px rgba(6, 78, 59, 0.12);
  --shadow-glow: 0 0 20px rgba(132, 204, 22, 0.4);

  /* Typography */
  --font-family:
    "Plus Jakarta Sans", "Inter", sans-serif; /* Modern, geometric sans */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.5rem;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index */
  --z-base: 1;
  --z-overlay: 100;
  --z-modal: 200;
  --z-toast: 300;
}

/* ========================================
   RESET & BASE
======================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(at 0% 0%, rgba(132, 204, 22, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(5, 150, 105, 0.15) 0px, transparent 50%),
    radial-gradient(
      at 100% 100%,
      rgba(132, 204, 22, 0.15) 0px,
      transparent 50%
    ),
    radial-gradient(at 0% 100%, rgba(5, 150, 105, 0.15) 0px, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ========================================
   TYPOGRAPHY
======================================== */
/* ========================================
   TYPOGRAPHY
======================================== */
.text-xs {
  font-size: var(--font-size-xs);
}
.text-sm {
  font-size: var(--font-size-sm);
}
.text-base {
  font-size: var(--font-size-base);
}
.text-lg {
  font-size: var(--font-size-lg);
}
.text-xl {
  font-size: var(--font-size-xl);
}
.text-2xl {
  font-size: var(--font-size-2xl);
}
.text-3xl {
  font-size: var(--font-size-3xl);
}
.text-4xl {
  font-size: var(--font-size-4xl);
}

.font-medium {
  font-weight: 500;
}
.font-semibold {
  font-weight: 600;
}
.font-bold {
  font-weight: 700;
}
.font-extrabold {
  font-weight: 800;
}

.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

.text-primary {
  color: var(--primary);
}
.text-primary-dark {
  color: var(--primary-dark);
}
.text-accent {
  color: var(--accent);
}
.text-secondary {
  color: var(--text-secondary);
}
.text-light {
  color: var(--text-light);
}
.text-inverse {
  color: var(--text-inverse);
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   GLASSMORPHISM UTILITIES
======================================== */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.glass-panel {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-lg);
}

.glass-dark {
  background: rgba(6, 78, 59, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-inverse);
}

/* ========================================
   LAYOUT UTILITIES
======================================== */
.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-sm {
  gap: var(--space-sm);
}
.gap-md {
  gap: var(--space-md);
}
.gap-lg {
  gap: var(--space-lg);
}

/* ========================================
   APP LAYOUT
======================================== */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-overlay);
  background: linear-gradient(to bottom, var(--bg-secondary), transparent);
  padding: var(--space-md);
  pointer-events: none;
}

.app-header > * {
  pointer-events: auto;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-overlay);
  padding: var(--space-lg);
  padding-bottom: max(var(--space-lg), env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg-secondary), transparent);
}

/* ========================================
   SCREENS
======================================== */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

/* Landing Screen */
/* Landing Screen */
.screen-landing {
  justify-content: center;
  align-items: center;
  padding: var(--space-xl);
  text-align: center;
  /* Background removed to show body gradient */
  color: var(--text-primary);
}

.landing-content {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.landing-logo {
  width: 120px;
  height: 120px;
  margin-bottom: var(--space-lg);
  filter: drop-shadow(0 0 20px rgba(5, 150, 105, 0.3));
  animation: float 6s ease-in-out infinite;
}

.landing-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: var(--space-sm);
  background: linear-gradient(
    135deg,
    var(--primary-dark) 0%,
    var(--primary) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.landing-subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
  line-height: 1.5;
}

/* Camera Screen */
.screen-camera {
  background: #000;
}

/* Result Screen */
.screen-result {
  padding: var(--space-xl) var(--space-md);
  padding-bottom: 120px;
  overflow-y: auto;
}

@media (min-width: 768px) {
  .container {
    max-width: 600px;
  }

  .landing-logo {
    width: 160px;
    height: 160px;
  }

  .landing-title {
    font-size: 3.5rem;
  }
}
