/* Custom fonts and icons imported */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --primary-rgb: 246, 130, 31;     /* Orange accent #f6821f */
  --secondary-rgb: 173, 198, 255;  /* Pale blue #adc6ff */
  --tertiary-rgb: 194, 199, 203;   /* Slate blue */
  --error-rgb: 255, 180, 171;      /* Red accent */
  --surface-rgb: 18, 19, 21;       /* Background #121315 */
  
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at top right, #1a1532, #0d0d11 65%, #050508);
  color: #e3e2e3;
  font-family: 'Outfit', sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* Base Layout shell to resemble native App viewports */
#app-shell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Safe areas layout padding adjustments */
.pt-safe {
  padding-top: calc(var(--safe-top) + 12px);
}

.pb-safe {
  padding-bottom: calc(var(--safe-bottom) + 80px); /* Account for active nav bar height */
}

/* Hide Scrollbar for Native App feel */
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Glassmorphism Styles */
.liquid-glass {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.03),
              0 8px 32px 0 rgba(0, 0, 0, 0.24);
}

.glass-elevated {
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  background: rgba(20, 20, 25, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.05),
              0 16px 48px rgba(0, 0, 0, 0.5);
}

.glass-input {
  background: rgba(0, 0, 0, 0.35) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 16px;
  color: #ffffff !important;
  font-family: inherit;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Override Tailwind Forms Plugin focus ring and input colors */
.glass-input:focus,
textarea.glass-input:focus,
input[type="text"].glass-input:focus,
input[type="email"].glass-input:focus {
  --tw-ring-color: transparent !important;
  --tw-ring-offset-width: 0px !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
  border-color: rgba(var(--primary-rgb), 0.8) !important;
  box-shadow: 0 0 16px rgba(var(--primary-rgb), 0.25) !important;
  outline: none !important;
  color: #ffffff !important;
}

/* Prevent browser autofill from turning background white or yellow */
.glass-input:-webkit-autofill,
.glass-input:-webkit-autofill:hover,
.glass-input:-webkit-autofill:focus,
.glass-input:-webkit-autofill:active {
  -webkit-text-fill-color: #ffffff !important;
  transition: background-color 5000s ease-in-out 0s;
  box-shadow: inset 0 0 20px 20px rgba(0, 0, 0, 0.45) !important;
}

/* Native tab bar horizontal transition structure */
#views-slider {
  display: flex;
  width: 200%;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.view-page {
  width: 50%;
  height: 100%;
  overflow-y: auto;
  padding: 80px 20px 100px 20px; /* Top appbar space, side padding, bottom nav space */
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Camera HUD style & animation overlays */
.shutter-flash {
  position: absolute;
  inset: 0;
  background-color: white;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
}
.shutter-flash.active {
  animation: flash-animation 0.2s ease-out;
}
@keyframes flash-animation {
  0% { opacity: 0.8; }
  100% { opacity: 0; }
}

/* Scan laser animation */
.scan-beam {
  position: absolute;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(var(--primary-rgb), 0.8) 20%, 
    rgba(var(--primary-rgb), 1) 50%, 
    rgba(var(--primary-rgb), 0.8) 80%, 
    transparent
  );
  box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.6);
  z-index: 10;
  animation: scan-move 3s ease-in-out infinite;
}
@keyframes scan-move {
  0%, 100% { top: 0%; }
  50% { top: 100%; }
}

/* Camera level alignment guidelines */
.level-line {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
  z-index: 5;
  transform-origin: center;
  transition: transform 0.1s ease;
}
.level-line.aligned {
  background: rgba(74, 222, 128, 0.8);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
}

/* Dynamic slider transitions for tabs switcher */
.view-active-0 {
  transform: translateX(0%);
}
.view-active-1 {
  transform: translateX(-50%);
}

/* Bottom Sheet Swipe Drag state styles */
.bottom-sheet-transition {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.bottom-sheet-hidden {
  transform: translateY(100%);
}
.bottom-sheet-visible {
  transform: translateY(0%);
}

/* Skeleton Loading Shimmer */
.shimmer {
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0.03) 25%, 
    rgba(255, 255, 255, 0.08) 50%, 
    rgba(255, 255, 255, 0.03) 75%
  );
  background-size: 200% 100%;
  animation: shimmer-swipe 1.5s infinite;
}
@keyframes shimmer-swipe {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Connection alert banner drops down from header */
#offline-banner {
  position: fixed;
  top: 64px; /* Placed exactly under the header */
  left: 0;
  right: 0;
  background: rgba(239, 68, 68, 0.95);
  color: white;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  padding: 6px 12px;
  backdrop-filter: blur(10px);
  z-index: 39;
  transform: translateY(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
#offline-banner.active {
  transform: translateY(0);
}

/* Active bottom menu animations */
.nav-tab-active {
  color: rgba(var(--primary-rgb), 1);
  background: rgba(var(--primary-rgb), 0.12);
  border: 1px solid rgba(var(--primary-rgb), 0.15);
}

/* Pulse indicator animation */
.pulse-ring {
  animation: pulse-ring-anim 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse-ring-anim {
  0%, 100% { transform: scale(1); opacity: 0.9; box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.3); }
  50% { transform: scale(1.05); opacity: 1; box-shadow: 0 0 24px rgba(var(--primary-rgb), 0.6); }
}

/* Filter Tag Categories styling */
.filter-tag {
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #a0a0a5;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.filter-tag.active {
  background: rgba(var(--primary-rgb), 0.12);
  border-color: rgba(var(--primary-rgb), 0.3);
  color: #ffffff;
}
