/* VoiceGuard AI — iPhone-style glassmorphism UI */

:root {
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  --text-primary: rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.65);
  --safe: #34c759;
  --suspicious: #ff9500;
  --danger: #ff3b30;
  --blur: 20px;
  --radius: 20px;
  --radius-sm: 14px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(165deg, #0d0d0f 0%, #1a1a1e 40%, #0f0f12 100%);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  padding-top: max(20px, env(safe-area-inset-top));
  overflow-x: hidden;
  position: relative;
}

/* Ambient background */
.noise {
  position: fixed;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.gradient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.gradient-orb-1 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
  top: -80px;
  right: -60px;
}

.gradient-orb-2 {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
  bottom: -40px;
  left: -40px;
}

/* Glass effect */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.app {
  width: 100%;
  max-width: 420px;
  border-radius: 28px;
  padding: 28px 24px;
  position: relative;
  z-index: 1;
}

.header {
  text-align: center;
  margin-bottom: 24px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.logo-icon {
  font-size: 28px;
}

.logo h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Status card */
.status-card {
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 16px;
}

.status-text {
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
  transition: color 0.3s ease;
}

.confidence-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 12px;
  min-height: 1.2em;
}

.score-bar-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.score-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease, background 0.3s ease;
  background: linear-gradient(90deg, var(--safe), var(--suspicious), var(--danger));
}

.score-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Waveform */
.waveform-section {
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.waveform-canvas {
  width: 100%;
  height: 72px;
  display: block;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
}

.waveform-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 8px;
  text-align: center;
}

/* Transcript */
.transcript-card {
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 24px;
}

.transcript-card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.transcript {
  font-size: 0.95rem;
  line-height: 1.5;
  min-height: 72px;
  color: var(--text-primary);
}

/* Button */
.actions {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 260px;
  padding: 16px 28px;
  border-radius: 16px;
  border: none;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  background: rgba(59, 130, 246, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary.listening {
  background: rgba(255, 59, 48, 0.35);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.3); }
  50% { box-shadow: 0 0 0 12px rgba(255, 59, 48, 0); }
}

.btn-icon {
  font-size: 1.3rem;
}

.footer {
  text-align: center;
}

.footer small {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Status colors */
.status-safe { color: var(--safe) !important; }
.status-suspicious { color: var(--suspicious) !important; }
.status-danger { color: var(--danger) !important; }

@media (max-width: 480px) {
  .app { padding: 22px 18px; }
  .logo h1 { font-size: 1.4rem; }
}
