/* ==========================================================================
   Smart Waste Classifier - Mobile-First Premium Eco-Tech Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --color-brand-primary: #065f46;     /* Emerald 800 */
  --color-brand-accent: #10b981;      /* Emerald 500 */
  --color-brand-dark: #064e3b;        /* Emerald 900 */
  --color-recyclable: #059669;        /* Emerald 600 */
  --color-organic: #65a30d;           /* Lime 600 */
  --color-ewaste: #d97706;            /* Amber 600 */
  --color-uncertain: #64748b;         /* Slate 500 */
  --color-bg-base: #f8fafc;           /* Slate 50 */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--color-bg-base);
  color: #0f172a;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
  font-size: 15px;
}

/* Touch Action Optimization for Mobile */
button, a, input, select {
  touch-action: manipulation;
}

/* Accessibility: Focus Indicators */
:focus-visible {
  outline: 3px solid #10b981;
  outline-offset: 2px;
}

/* Accessibility: Respect Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Skip Navigation Link */
.skip-link {
  position: absolute;
  top: -50px;
  left: 1rem;
  background: #064e3b;
  color: #ffffff;
  padding: 0.6rem 1.2rem;
  z-index: 100;
  border-radius: 0.5rem;
  transition: top 0.2s ease-in-out;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.875rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.skip-link:focus {
  top: 1rem;
}

/* Screen Management */
.app-screen {
  display: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.app-screen.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Safe Area Inset Management for Modern Edge-to-Edge Mobile Displays */
.safe-bottom-padding {
  padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
  .safe-bottom-padding {
    padding-bottom: 3rem;
  }
}

/* Camera Viewfinder Reticle & Viewport */
.viewfinder-frame {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  background-color: #020617;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.reticle-corner {
  position: absolute;
  width: 32px;
  height: 32px;
  border-color: #10b981;
  border-style: solid;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.5));
}

.reticle-top-left {
  top: 20px;
  left: 20px;
  border-width: 3.5px 0 0 3.5px;
  border-top-left-radius: 8px;
}

.reticle-top-right {
  top: 20px;
  right: 20px;
  border-width: 3.5px 3.5px 0 0;
  border-top-right-radius: 8px;
}

.reticle-bottom-left {
  bottom: 20px;
  left: 20px;
  border-width: 0 0 3.5px 3.5px;
  border-bottom-left-radius: 8px;
}

.reticle-bottom-right {
  bottom: 20px;
  right: 20px;
  border-width: 0 3.5px 3.5px 0;
  border-bottom-right-radius: 8px;
}

/* Viewfinder Video Stream */
.viewfinder-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.viewfinder-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  background-color: rgba(2, 6, 23, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Scanning Pulse Laser Line (CSS Animation) */
.scan-laser {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #34d399 50%, transparent 100%);
  box-shadow: 0 0 12px #10b981, 0 0 4px #34d399;
  animation: scanSweep 2.4s ease-in-out infinite alternate;
}

@keyframes scanSweep {
  0% { top: 12%; opacity: 0.2; }
  50% { opacity: 1; }
  100% { top: 88%; opacity: 0.2; }
}

/* Radar Pulse Wave Animation for AI Analysis */
.pulse-ring {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px solid #10b981;
  animation: pulseRadar 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulseRadar {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* Mobile Shutter Button Styling */
.shutter-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: transparent;
  border: 4px solid #ffffff;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  touch-action: manipulation;
}

.shutter-btn-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #ffffff;
  transition: transform 0.15s ease, background-color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #064e3b;
}

.shutter-btn:active .shutter-btn-inner {
  transform: scale(0.9);
  background-color: #10b981;
  color: #ffffff;
}

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

/* Floating Center Scan Button on Mobile Bottom Nav */
.floating-scan-btn {
  position: relative;
  top: -16px;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, #059669 0%, #047857 50%, #064e3b 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px -2px rgba(5, 150, 105, 0.45), 0 2px 6px rgba(0, 0, 0, 0.1);
  border: 3px solid #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  z-index: 40;
}

.floating-scan-btn:active {
  transform: scale(0.92);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

/* Category Semantic Badges */
.badge-recyclable {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-organic {
  background-color: #f7fee7;
  color: #3f6212;
  border: 1px solid #d9f99d;
}

.badge-ewaste {
  background-color: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-uncertain {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* History Filter Chips */
.filter-chip {
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  color: #475569;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-chip.active {
  background-color: #064e3b;
  border-color: #064e3b;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(6, 78, 59, 0.25);
}

.filter-chip:hover:not(.active) {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

/* Custom Scrollbar for Horizontal Chips */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
