/* Scoped Styles for Helpers Hability - SUS Digital & Gov.br Demo */
.helpers-phone-wrapper {
  --bg-dark: #020617;
  --bg-card: rgba(15, 23, 42, 0.75);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-primary: #0ea5e9;
  --accent-secondary: #10b981;
  --accent-gov: #1351b4;
  --gradient-btn: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%);
  --gradient-sus: linear-gradient(135deg, #0284c7 0%, #0d9488 50%, #059669 100%);
  --glass-border: rgba(255, 255, 255, 0.08);
}

#helpers-app-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
}

#helpers-app-container * {
  box-sizing: border-box;
}

#helpers-app-container .view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateX(40px) scale(0.98);
  transition: all 0.5s cubic-bezier(0.25, 1, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
}

#helpers-app-container .view.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

#helpers-app-container .view.exit-left {
  transform: translateX(-40px) scale(0.98);
  opacity: 0;
}

#helpers-app-container #progress-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  z-index: 9000;
}

#helpers-app-container #global-progress {
  height: 100%;
  width: 0%;
  background: var(--gradient-btn);
  transition: width 0.6s cubic-bezier(0.25, 1, 0.2, 1), opacity 0.3s;
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 10px var(--accent-primary);
}

#helpers-app-container .glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
}

#helpers-app-container .content-area {
  flex: 1;
  padding: 32px 20px 24px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
}

#helpers-app-container .bg-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  background: var(--accent-primary);
  filter: blur(100px);
  border-radius: 50%;
  opacity: 0.15;
  z-index: 0;
}

#helpers-app-container .bg-glow-2 {
  position: absolute;
  width: 220px;
  height: 220px;
  background: var(--accent-secondary);
  filter: blur(100px);
  border-radius: 50%;
  opacity: 0.15;
  z-index: 0;
}

#helpers-app-container h1 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 10px;
}

#helpers-app-container p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

#helpers-app-container .text-gradient {
  background: var(--gradient-btn);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#helpers-app-container .btn {
  background: var(--gradient-btn);
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.2);
}

#helpers-app-container .btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 5px rgba(14, 165, 233, 0.1);
}

#helpers-app-container .btn-gov {
  background: #1351b4;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 14px 20px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(19, 81, 180, 0.3);
}

#helpers-app-container .btn-gov:hover {
  background: #0c326f;
}

#helpers-app-container .btn-gov:active {
  transform: scale(0.96);
}

#helpers-app-container .btn-outline {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-main);
  box-shadow: none;
}

#helpers-app-container .btn-outline:active {
  background: rgba(255, 255, 255, 0.05);
  transform: scale(0.95);
}

#helpers-app-container .input-group {
  margin-bottom: 16px;
  position: relative;
}

#helpers-app-container .input-group label {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-weight: 600;
}

#helpers-app-container .input-group input {
  width: 100%;
  background: var(--bg-card);
  border: 2px solid transparent;
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.2, 1);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

#helpers-app-container .input-group input:focus {
  border-color: var(--accent-primary);
  background: rgba(15, 23, 42, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.1), inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

#helpers-app-container .input-group input:disabled {
  opacity: 0.8;
}

#helpers-app-container .input-group i {
  position: absolute;
  right: 16px;
  top: 36px;
  color: var(--text-muted);
  transition: 0.3s;
}

#helpers-app-container .app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 8px 20px;
  z-index: 10;
  margin-top: 14px;
}

#helpers-app-container .back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: 0.2s;
}

#helpers-app-container .back-btn:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.1);
}

#helpers-app-container .sus-card {
  width: 100%;
  height: 195px;
  border-radius: 20px;
  background: var(--gradient-sus);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(14, 165, 233, 0.2);
  margin-bottom: 20px;
  transition: 0.5s;
}

#helpers-app-container .sus-card-bg-pattern {
  position: absolute;
  top: 0;
  right: 0;
  width: 160px;
  height: 160px;
  opacity: 0.12;
  pointer-events: none;
}

#helpers-app-container .sus-logo {
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.5px;
}

#helpers-app-container .sus-number {
  font-size: 18px;
  letter-spacing: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

#helpers-app-container .action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

#helpers-app-container .action-btn {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-main);
  transition: 0.2s;
  cursor: pointer;
  border: 1px solid var(--glass-border);
}

#helpers-app-container .action-btn:hover {
  border-color: rgba(14, 165, 233, 0.3);
}

#helpers-app-container .action-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.1);
}

#helpers-app-container .fab-ai {
  position: absolute;
  bottom: 20px;
  right: 18px;
  width: 54px;
  height: 54px;
  border-radius: 27px;
  background: var(--gradient-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4);
  z-index: 100;
  transition: 0.2s;
  animation: pulse-ai 2s infinite;
  cursor: pointer;
  color: white;
}

#helpers-app-container .fab-ai:active {
  transform: scale(0.9);
}

@keyframes pulse-ai {
  0% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.5); }
  70% { box-shadow: 0 0 0 16px rgba(14, 165, 233, 0); }
  100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
}

#helpers-app-container .chat-bubble {
  max-width: 88%;
  padding: 12px 15px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.45;
  animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

#helpers-app-container .chat-ai {
  background: var(--bg-card);
  color: var(--text-main);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#helpers-app-container .chat-user {
  background: var(--gradient-btn);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.2);
}

#helpers-app-container .chat-option-btn {
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
  padding: 8px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.2s;
  animation: fadeIn 0.3s forwards;
}

#helpers-app-container .chat-option-btn:active {
  background: var(--accent-primary);
  color: white;
  transform: scale(0.95);
}

#helpers-app-container .typing-indicator {
  display: flex;
  gap: 5px;
  padding: 3px 0;
}

#helpers-app-container .typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing 1.4s infinite ease-in-out;
}

#helpers-app-container .typing-dot:nth-child(1) { animation-delay: 0s; }
#helpers-app-container .typing-dot:nth-child(2) { animation-delay: 0.2s; }
#helpers-app-container .typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-4px); opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#helpers-app-container .map-widget {
  width: 100%;
  height: 120px;
  border-radius: 12px;
  background: url('https://images.unsplash.com/photo-1519494026892-80bbd2d6fd0d?auto=format&fit=crop&w=600&q=80') center/cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
}

#helpers-app-container .map-widget::after {
  content: '📍 UBS / Rede SUS Manaus detectada';
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-secondary);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
