/**
 * PackSense enterprise UI layer — professional SaaS styling.
 * Tones down playful animations, neon glows, and emoji-driven metrics.
 */

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

.ps-app,
.ps-app body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  letter-spacing: -0.01em;
}

/* Calm background — no floating particles or bounce */
.ps-app .particles {
  display: none !important;
}

.ps-app body::before {
  animation: none !important;
}

/* Navigation — solid enterprise header (not page title heroes) */
.ps-app .nav-header,
.ps-app body > .header {
  background: rgba(15, 15, 18, 0.92) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  padding-bottom: 14px;
}

/* Page hero title — transparent, blends with page background */
.ps-app .main-container > .header {
  background: transparent !important;
  backdrop-filter: none !important;
  border: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-top: 88px !important;
  margin-bottom: 32px !important;
  animation: none !important;
}

.ps-app .nav-link {
  border-radius: 8px !important;
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  padding: 8px 16px !important;
  transform: none !important;
  box-shadow: none !important;
}

.ps-app .nav-link::before {
  display: none !important;
}

.ps-app .nav-link:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  transform: none !important;
}

.ps-app .nav-logo-icon {
  animation: none !important;
}

/* Page headings */
.ps-app .header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem) !important;
  font-weight: 700 !important;
  text-shadow: none !important;
  letter-spacing: -0.03em;
  animation: none !important;
}

.ps-app .header h1::after {
  display: none !important;
}

.ps-app .header p {
  font-size: 1rem !important;
  color: var(--ps-text-muted) !important;
  font-weight: 400 !important;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* Form container */
.ps-app .form-container {
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25) !important;
  background: rgba(20, 20, 24, 0.85) !important;
}

.ps-app .form-title {
  font-size: 1.125rem !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: -0.02em !important;
}

/* Feature badge (replaces emoji pills) */
.ps-feature-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #14b8a6;
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(20, 184, 166, 0.28);
}

.ps-feature-badge i {
  font-size: 0.75rem;
  opacity: 0.9;
}

/* Metric cards — icon boxes instead of emoji */
.ps-app .metrics-section .metrics-title,
.ps-app .metrics-header-title {
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--ps-text-muted) !important;
}

/* Metrics strip — flush with page, no boxed container */
.ps-app .metrics-section {
  background: transparent !important;
  border: none !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.ps-app .metrics-marquee .card,
.ps-app .metrics .card {
  border-radius: 10px !important;
  padding: 16px 18px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: none !important;
  animation: none !important;
  text-align: left !important;
  backdrop-filter: blur(6px);
}

.ps-app .metrics-marquee .card::before,
.ps-app .metrics .card::before {
  display: none !important;
}

.ps-app .metrics-marquee .card:hover,
.ps-app .metrics .card:hover {
  transform: none !important;
  box-shadow: none !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

.ps-app .card-icon {
  animation: none !important;
  font-size: inherit !important;
  margin-bottom: 14px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--ps-text-secondary);
}

.ps-app .card:hover .card-icon {
  transform: none !important;
  animation: none !important;
}

.ps-app .card-icon i {
  font-size: 1rem;
}

.ps-app .metrics-marquee .card-icon {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
}

.ps-app .card-icon.ps-icon-positive { color: #4ade80; background: rgba(74, 222, 128, 0.08) !important; border-color: rgba(74, 222, 128, 0.18) !important; }
.ps-app .card-icon.ps-icon-negative { color: #f87171; background: rgba(248, 113, 113, 0.08) !important; border-color: rgba(248, 113, 113, 0.18) !important; }
.ps-app .card-icon.ps-icon-warning { color: #fbbf24; background: rgba(251, 191, 36, 0.08) !important; border-color: rgba(251, 191, 36, 0.18) !important; }
.ps-app .card-icon.ps-icon-accent { color: #14b8a6; background: rgba(20, 184, 166, 0.08) !important; border-color: rgba(20, 184, 166, 0.18) !important; }

.ps-app .card-title {
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  color: var(--ps-text-muted) !important;
  margin-bottom: 6px !important;
}

.ps-app .card-value {
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  text-shadow: none !important;
  letter-spacing: -0.03em;
}

.ps-app .card:hover .card-value {
  transform: none !important;
  text-shadow: none !important;
}

/* Analysis dashboard metrics */
.ps-app .metric-icon {
  font-size: inherit !important;
  margin-bottom: 12px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.ps-app .metric-icon i {
  font-size: 1.1rem;
}

.ps-app .metric-icon.ps-metric-positive { color: #22c55e; background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.3); }
.ps-app .metric-icon.ps-metric-neutral { color: #94a3b8; background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.25); }
.ps-app .metric-icon.ps-metric-negative { color: #ef4444; background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.3); }
.ps-app .metric-icon.ps-metric-defect { color: #f59e0b; background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.3); }
.ps-app .metric-icon.ps-metric-packaging { color: #818cf8; background: rgba(129, 140, 248, 0.12); border-color: rgba(129, 140, 248, 0.3); }

.ps-app .metric-card {
  border-radius: 10px !important;
  transition: border-color 0.2s ease, transform 0.2s ease !important;
}

.ps-app .metric-card:hover {
  transform: translateY(-2px) !important;
}

/* Emotion chips — dot indicator instead of emoji */
.ps-app .ceb-chip-emoji {
  display: none !important;
}

.ps-app .ceb-chip-name::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  background: currentColor;
  opacity: 0.85;
}

.ps-app .ceb-sub-chip.ceb-pos .ceb-chip-name::before { background: #22c55e; }
.ps-app .ceb-sub-chip.ceb-neu .ceb-chip-name::before { background: #94a3b8; }
.ps-app .ceb-sub-chip.ceb-neg .ceb-chip-name::before { background: #ef4444; }
.ps-app .ceb-sub-chip.ceb-unc .ceb-chip-name::before { background: #64748b; }

/* Reduce neon glow on analysis sections */
.ps-app .analysis-section h3 i {
  text-shadow: none !important;
  color: var(--ps-accent) !important;
}

.ps-app .word-cloud-word:hover {
  transform: scale(1.08) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
  animation: none !important;
}

.ps-app [class*="word-freq-"] {
  text-shadow: none !important;
}

/* GenAI executive summary */
.ps-app .executive-summary-title::before {
  content: none !important;
}

.ps-app .executive-summary-title {
  gap: 10px;
}

.ps-app .executive-summary-title .ps-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.3);
  color: var(--ps-accent);
  font-size: 0.875rem;
}

/* Intro landing — softer CTA glow */
.ps-app .btn-glow {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(20, 184, 166, 0.15) !important;
}

.ps-app .btn-glow:hover {
  box-shadow: 0 4px 16px rgba(20, 184, 166, 0.22) !important;
}

.ps-app .glow-hero {
  box-shadow: none !important;
  opacity: 0.4;
}

/* Logo → home (all pages) */
.ps-app .ps-logo-home {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}

.ps-app .ps-logo-home:hover {
  opacity: 0.92;
}

.ps-app .ps-logo-home:focus-visible {
  outline: 2px solid var(--ps-accent, #2dd4bf);
  outline-offset: 3px;
  border-radius: 4px;
}

.ps-app .ps-logo-home img {
  display: block;
  height: var(--ps-logo-height);
  width: auto;
  max-width: min(300px, 50vw);
  object-fit: contain;
  object-position: left center;
}

.ps-app .nav-logo-image,
.ps-app .packsense-logo,
.ps-app .header .logo-image,
.ps-app body > .header .logo img {
  height: var(--ps-logo-height);
  width: auto;
  max-width: min(300px, 50vw);
  object-fit: contain;
  object-position: left center;
}

/* Metrics marquee — shared intro + analyze home */
.ps-app .metrics-section {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 28px 0 12px;
  overflow: hidden;
}

.ps-app .metrics-header-wrap {
  max-width: 800px;
  width: 100%;
  margin: 0 auto 16px;
  padding: 0 20px;
  box-sizing: border-box;
}

.ps-app .metrics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ps-app .metrics-view-all {
  font-size: 0.8125rem;
  color: #14b8a6;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.ps-app .metrics-view-all:hover {
  color: #2dd4bf;
}

.ps-app .metrics-marquee {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

.ps-app .metrics-marquee-track {
  display: flex;
  width: max-content;
  gap: 14px;
  padding: 6px 0 12px;
  animation: psMetricsMarquee 50s linear infinite;
  will-change: transform;
}

.ps-app .metrics-marquee-track .card {
  flex: 0 0 196px;
  width: 196px;
  flex-shrink: 0;
}

.ps-app .metrics-marquee:hover .metrics-marquee-track {
  animation-play-state: paused;
}

.ps-app .metrics-marquee--static .metrics-marquee-track {
  animation: none;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  justify-content: center;
  flex-wrap: wrap;
}

@keyframes psMetricsMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-25%); }
}

@media (prefers-reduced-motion: reduce) {
  .ps-app .metrics-marquee-track {
    animation: none !important;
    overflow-x: auto;
    width: 100%;
    justify-content: flex-start;
  }
}
