/* Root and Typography */
:root {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  line-height: 1.5;
  font-weight: 400;

  /* Brand Colors - Professional & Elegant */
  --primary: #2563eb; /* Royal Blue */
  --primary-dark: #1e3a8a; /* Deep Blue */
  --primary-light: #eff6ff; /* Light Blue Tint */

  --secondary: #475569; /* Slate */

  /* Semantic Colors */
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  /* Suraces & Text */
  --bg-app: #f8fafc; /* Very light slate - for app background */
  --bg-card: #ffffff;
  --bg-overlay: rgba(255, 255, 255, 0.85);

  --text-main: #1e293b; /* Slate 800 */
  --text-secondary: #64748b; /* Slate 500 */
  --text-tertiary: #94a3b8; /* Slate 400 */

  --border-light: #e2e8f0;

  /* Effects */
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  color-scheme: light;
  background-color: var(--bg-app);
  color: var(--text-main);

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--bg-app);
  color: var(--text-main);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#root {
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* Remove number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

/* Focus Styles */
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Utility Animation */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
/* Scanner View Styles */
.scanner-view {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh; /* Mobile viewport height support */
  width: 100%;
  background-color: #000000; /* Force black background */
  overflow: hidden;
  position: relative;
}

/* Barcode Scanner Container - Full Screen */
.barcode-scanner-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.scanner-viewport {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#barcode-scanner {
  width: 100%;
  height: 100%;
}

#barcode-scanner video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  opacity: 1 !important;
}

/* Hide html5-qrcode's built-in file select button and other elements */
#barcode-scanner__scan_region {
  width: 100% !important;
  height: 100% !important;
}

#barcode-scanner__dashboard_section,
#barcode-scanner__dashboard_section_csr,
#barcode-scanner button {
  display: none !important;
}

/* Scanner Overlay */
.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  background: rgba(0, 0, 0, 0.2);
}

.scanner-frame {
  position: relative;
  width: 280px;
  height: 180px;
  border-radius: 20px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

/* Scanner Corner Decorations */
.corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border-color: #00ff88;
  filter: drop-shadow(0 0 4px #00ff88);
}

.corner.top-left {
  top: -2px;
  left: -2px;
  border-top: 4px solid #00ff88;
  border-left: 4px solid #00ff88;
  border-radius: 16px 0 0 0;
}

.corner.top-right {
  top: -2px;
  right: -2px;
  border-top: 4px solid #00ff88;
  border-right: 4px solid #00ff88;
  border-radius: 0 16px 0 0;
}

.corner.bottom-left {
  bottom: -2px;
  left: -2px;
  border-bottom: 4px solid #00ff88;
  border-left: 4px solid #00ff88;
  border-radius: 0 0 0 16px;
}

.corner.bottom-right {
  bottom: -2px;
  right: -2px;
  border-bottom: 4px solid #00ff88;
  border-right: 4px solid #00ff88;
  border-radius: 0 0 16px 0;
}

/* Animated Scan Line */
.scan-line {
  position: absolute;
  width: 100%;
  height: 2px;
  background: #00ff88;
  box-shadow: 0 0 15px 2px #00ff88;
  animation: scan 2s ease-in-out infinite;
  opacity: 0.6;
}

@keyframes scan {
  0% { top: 10%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 90%; opacity: 0; }
}

/* Scanner Hint */
.scanner-hint {
  position: absolute;
  top: 20%;
  left: 0;
  right: 0;
  text-align: center;
  color: white;
  font-size: 16px;
  font-weight: 500;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 2;
}

/* Permission Denied State */
.scanner-permission-denied {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: white;
  text-align: center;
  padding: 2rem;
  z-index: 100;
}

.permission-icon {
  font-size: 64px;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.scanner-permission-denied h3 {
  margin: 0 0 0.5rem 0;
  font-size: 24px;
  font-weight: 600;
}

.scanner-permission-denied p {
  margin: 0 0 1.5rem 0;
  opacity: 0.9;
  max-width: 300px;
}

/* Bottom Controls Ribbon - Restyled as Floating Actions */
.scanner-controls-ribbon {
  position: absolute;
  bottom: calc(130px + env(safe-area-inset-bottom)); /* Increased to 130px to fully clear nav bar and labels */
  left: 0;
  right: 0;
  padding: 0 1rem;
  background: transparent; /* No background to avoid "double bar" look */
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  pointer-events: none; /* Let clicks pass through empty areas */
}

.control-btn {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  border-radius: 50%; /* Circle shape */
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.control-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.3);
}

.btn-icon {
  font-size: 24px;
  margin: 0;
  line-height: 1;
}

.btn-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: absolute;
  bottom: -18px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  width: max-content;
}

/* Product Result Overlay - Modal Style */
.product-result-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  animation: fadeIn 0.3s ease-out;
}

.result-content {
  background: var(--bg-app);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 1.5rem;
  padding-bottom: calc(90px + env(safe-area-inset-bottom));
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Manual Entry Modal */
.manual-entry-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.95);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}

.manual-entry-card {
  background: white;
  width: 100%;
  max-width: 340px;
  padding: 2rem;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.manual-entry-card h3 {
  margin: 0 0 1.5rem;
  color: var(--text-main);
  font-size: 20px;
}

.manual-input-large {
  width: 100%;
  padding: 1rem;
  font-size: 20px;
  text-align: center;
  border: 2px solid var(--border-light);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  letter-spacing: 2px;
}

.manual-input-large:focus {
  outline: none;
  border-color: var(--primary);
  background: #f8fafc;
}

.manual-actions {
  display: flex;
  gap: 1rem;
}

/* Message Pill */
.message-pill {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 30px;
  background: white;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 100;
  animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 90%;
  font-weight: 600;
}

.message-pill.success { color: #16a34a; }
.message-pill.error { color: #dc2626; }

@keyframes slideDown {
  from { transform: translate(-50%, -100%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Reuse existing components within the new layout */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-light);
}

.product-card-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.stock-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stock-badge.in-stock { background: #d4edda; color: #155724; }
.stock-badge.low-stock { background: #fff3cd; color: #856404; }
.stock-badge.out-of-stock { background: #f8d7da; color: #721c24; }

.product-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.product-brand {
  font-size: 14px;
  color: var(--primary);
  font-weight: 500;
  margin: 0 0 1rem 0;
}

.product-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg-app);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.detail-label { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.detail-value { font-size: 14px; font-weight: 600; color: var(--text-main); }

.product-gtin {
  font-size: 12px;
  color: #a0aec0;
  margin: 1rem 0 0 0;
  font-family: "Courier New", monospace;
}

/* Action Panel Styles */
.action-panel {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
}

.quantity-section { margin-bottom: 1.5rem; }
.quantity-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.75rem; text-transform: uppercase; }
.quantity-controls { display: flex; align-items: center; gap: 1rem; background: #f7fafc; padding: 0.5rem; border-radius: 12px; }

.qty-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: none;
  background: white;
  color: #667eea;
  font-size: 24px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.quantity-input {
  flex: 1;
  height: 48px;
  border: none;
  background: white;
  border-radius: 12px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #2d3748;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.action-buttons { display: flex; gap: 0.75rem; flex-direction: column; }

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: white;
  cursor: pointer;
  min-height: 56px;
}

.action-btn.receive { background: var(--primary); }
.action-btn.remove { background: var(--bg-app); color: var(--error); border: 1px solid var(--error); }
.action-btn.consult { background: var(--bg-app); color: var(--primary); border: 1px solid var(--border-light); }
/* Dashboard View */
.dashboard-view {
  min-height: 100vh;
  background-color: var(--bg-app);
  background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
  background-size: 20px 20px;
  padding: 0.5rem;
  padding-bottom: calc(85px + env(safe-area-inset-bottom));
  overflow-y: auto;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0 0.5rem;
  position: relative;
  z-index: 10;
}

.dashboard-header h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-dark);
  margin: 0;
  letter-spacing: -0.5px;
  z-index: 10;
  position: relative;
}

.hero-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  z-index: 0;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
  pointer-events: none;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
  filter: grayscale(100%);
}

.refresh-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--primary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.refresh-btn:hover {
  background: var(--bg-app);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Loading State */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  color: var(--text-secondary);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-container p {
  margin-top: 1rem;
  font-size: 16px;
  font-weight: 500;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.kpi-card.alert {
  background: #fff7ed;
  border-color: var(--warning);
}

.kpi-icon {
  font-size: 32px;
  line-height: 1;
}

.kpi-content {
  flex: 1;
  min-width: 0;
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.kpi-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Dashboard Sections */
.dashboard-section {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Top Products */
.top-products-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.top-product-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-app);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  transition: all 0.2s;
}

.top-product-card:hover {
  background: var(--bg-card);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

.product-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--primary);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.product-info {
  flex: 1;
  min-width: 0;
}

.product-info h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-info .product-brand {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-quantity {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.quantity-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.quantity-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Transactions List */
.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-app);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  transition: all 0.2s;
}

.transaction-item:hover {
  background: var(--bg-card);
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}

.transaction-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.transaction-content {
  flex: 1;
  min-width: 0;
}

.transaction-product {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.transaction-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.transaction-badge.badge-receive {
  background: #d4edda;
  color: #155724;
}

.transaction-badge.badge-remove {
  background: #f8d7da;
  color: #721c24;
}

.transaction-badge.badge-consult {
  background: #cfe2ff;
  color: #084298;
}

.transaction-qty {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.transaction-time {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state p {
  margin: 0 0 0.5rem 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-state small {
  font-size: 14px;
  color: var(--text-tertiary);
}

/* Responsive Design */
@media (min-width: 640px) {
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 768px) {
  .dashboard-view {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
  }

  .dashboard-header h1 {
    font-size: 36px;
  }

  .kpi-card {
    padding: 1.5rem;
  }

  .kpi-icon {
    font-size: 40px;
  }

  .kpi-value {
    font-size: 28px;
  }
}
/* Generator View Styles */
.generator-view {
  min-height: 100vh;
  background-color: var(--bg-app);
  background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
  background-size: 20px 20px;
  padding-bottom: calc(90px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.generator-header {
  position: relative;
  z-index: 10;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
}

.generator-header h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary-dark);
  margin: 0;
  text-shadow: 0 2px 4px rgba(255,255,255,0.5);
}

/* Reusing Hero styles from Dashboard, but specific tweaks if needed */
.hero-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 220px;
  z-index: 0;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
  pointer-events: none;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
  filter: grayscale(100%) contrast(1.2);
}

.generator-content {
  position: relative;
  z-index: 1;
  padding: 0 1.5rem;
  margin-top: 1rem;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding-bottom: 2rem;
}

.feature-card {
  position: relative;
  border-radius: 24px;
  padding: 1.5rem;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
  overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.5);
}

.feature-card:active {
  transform: scale(0.97);
}

/* Card Styles */
.feature-card.primary-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.feature-card.image-bg {
  background-size: cover;
  background-position: center;
  color: white;
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.2));
  z-index: 1;
}

.card-content {
  position: relative;
  z-index: 2;
}

.card-icon-large {
  font-size: 48px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.feature-card h3 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  line-height: 1.1;
}

.feature-card p {
  font-size: 14px;
  opacity: 0.9;
  margin: 0;
  font-weight: 500;
  max-width: 80%;
}

.card-arrow {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 24px;
  font-weight: bold;
  opacity: 0.5;
}

/* Manual Entry Card */
.manual-section-card {
  background: white;
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 10px 20px -5px rgba(0,0,0,0.1);
  border: 1px solid var(--border-light);
}

.manual-section-card h3 {
  margin: 0 0 1rem 0;
  color: var(--text-main);
  font-size: 18px;
}

.manual-form {
  display: flex;
  gap: 0.75rem;
}

.manual-input {
  flex: 1;
  padding: 1rem;
  border: 2px solid var(--border-light);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  background: #f8fafc;
}

.manual-input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}

.manual-submit-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.manual-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Result Section */
.result-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ticket-card {
  background: white;
  width: 100%;
  max-width: 320px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.2);
  position: relative;
}

.ticket-header {
  height: 12px;
  background: var(--primary);
  position: relative;
}

.ticket-punch {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background: var(--bg-app);
  border-radius: 50%;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.ticket-body {
  padding: 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ticket-body h3 {
  margin: 0 0 0.5rem 0;
  font-size: 20px;
  color: var(--text-main);
}

.ticket-brand {
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  margin: 0 0 1.5rem 0;
}

.barcode-display {
  margin-bottom: 1rem;
}

.barcode-display canvas {
  max-width: 100%;
  height: auto;
}

.ticket-gtin {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: var(--text-tertiary);
  margin: 0;
  letter-spacing: 2px;
}

.result-actions {
  display: flex;
  gap: 1rem;
  width: 100%;
  max-width: 320px;
}

.action-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 50px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.action-pill:active {
  transform: scale(0.95);
}

.action-pill.primary {
  background: white;
  color: var(--primary);
  border: 1px solid var(--border-light);
}

.action-pill.secondary {
  background: var(--primary);
  color: white;
}

.clear-result-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  text-decoration: underline;
  cursor: pointer;
  padding: 1rem;
  font-size: 14px;
}

/* Fullscreen Mode */
.fullscreen-barcode {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.fullscreen-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.fullscreen-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
}

.fullscreen-canvas-wrapper canvas {
  max-width: 100%;
  height: auto;
  transform: scale(1.5);
  margin-bottom: 2rem;
}

.fullscreen-info {
  text-align: center;
  margin-top: 2rem;
}

.fullscreen-info h2 {
  font-size: 32px;
  margin: 0 0 1rem 0;
  color: var(--text-main);
}

.fullscreen-info p {
  font-size: 24px;
  font-family: 'Courier New', monospace;
  color: var(--text-secondary);
  font-weight: 700;
  letter-spacing: 4px;
}

@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Responsive adjustment */
@media (min-width: 768px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* Bottom Navigation */
.bottom-navigation {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0.75rem 0.5rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom)); /* Safe area support */
  box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.1);
  z-index: 9999; /* Ensure it is on top of everything */
  border-top: 1px solid rgba(25, 25, 25, 0.1);
  touch-action: none; /* Prevent double-tap zoom issues */
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-lg);
  min-width: 80px;
  position: relative;
  color: var(--text-secondary);
  user-select: none; /* Prevent text selection on long press */
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; /* Remove default tap highlight */
}

.nav-item::before {
  display: none; /* Remove old underline style */
}

/* Active State Design - Pill Style */
.nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-icon {
  font-size: 24px;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: grayscale(100%) opacity(0.7);
}

.nav-item.active .nav-icon {
  transform: translateY(-2px);
  filter: none;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  color: currentColor;
  text-transform: capitalize; /* Cleaner look */
  letter-spacing: 0.3px;
}

.nav-item:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--primary-dark);
}

.nav-item.active:hover {
  background: var(--primary-light);
}

.nav-item:active {
  transform: scale(0.96);
}

/* Responsive Design */
@media (min-width: 768px) {
  .bottom-navigation {
    padding: 1rem 0;
    max-width: 800px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 24px; /* Floating look on desktop */
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
  }

  .nav-item {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
  }

  .nav-icon {
    font-size: 26px;
  }

  .nav-label {
    font-size: 13px;
  }
}
/* App Container */
.app-container {
  position: relative;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* Ensure smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Remove default margins */
* {
  box-sizing: border-box;
}
