/* Talk2Us - Ultra Clean Native APK / Mobile App UI/UX */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-body: #edf2f7;
  --app-bg: #ffffff;
  --app-surface: #f8fafc;
  --app-card: #ffffff;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  
  --online-green: #10b981;
  --online-green-bg: #ecfdf5;
  --online-green-border: #a7f3d0;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-subtle: 0 4px 14px rgba(15, 23, 42, 0.04);
  --shadow-app: 0 20px 45px -10px rgba(15, 23, 42, 0.12), 0 0 1px rgba(15, 23, 42, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-body);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* Native APK App Screen Container */
.app-screen {
  width: 100%;
  max-width: 520px;
  height: 92vh;
  height: 92dvh;
  background: var(--app-bg);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  box-shadow: var(--shadow-app);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

/* App Top Bar */
.app-topbar {
  padding: 16px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(79, 70, 229, 0.25));
  flex-shrink: 0;
}

.app-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-primary);
}

.app-live-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--online-green);
}

.status-dot-pulse {
  width: 7px;
  height: 7px;
  background-color: var(--online-green);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  position: relative;
}

.status-dot-pulse::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  border: 2px solid var(--online-green);
  animation: pulse-ring 1.8s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(2.4); opacity: 0; }
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid white;
  object-fit: cover;
}

.avatar-stack img:nth-child(2) {
  margin-left: -10px;
}

/* App Sub-Header / Agent Banner */
.app-sub-header {
  padding: 10px 20px;
  background: var(--app-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.info-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.info-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* App Chat Body Stream */
.app-chat-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
}

.app-chat-body::-webkit-scrollbar {
  width: 5px;
}

.app-chat-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Date Divider */
.chat-date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0;
}

.chat-date-divider span {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Message Bubbles */
.message-bubble {
  display: flex;
  gap: 10px;
  max-width: 90%;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-bubble.incoming {
  align-self: flex-start;
}

.message-bubble.outgoing {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.msg-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg-author-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.msg-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 14px 16px;
  border-radius: 18px;
  border-top-left-radius: 4px;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
  box-shadow: var(--shadow-subtle);
  word-break: break-word;
}

.message-bubble.outgoing .msg-box {
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 18px;
  border-top-right-radius: 4px;
}

.msg-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* APK Native Action Option Cards */
.quick-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.option-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
  width: 100%;
  text-align: left;
}

.option-btn span {
  flex: 1;
}

.option-btn i.icon-indigo { color: var(--primary); font-size: 1rem; }
.option-btn i.icon-amber { color: #f59e0b; font-size: 1rem; }
.option-btn i.icon-blue { color: #3b82f6; font-size: 1rem; }
.option-btn i.icon-purple { color: #8b5cf6; font-size: 1rem; }

.option-btn i.arrow-icon {
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.option-btn:hover {
  border-color: var(--primary);
  background: #f8fafc;
  transform: translateY(-1px);
}

.option-btn:hover i.arrow-icon {
  transform: translateX(3px);
  color: var(--primary);
}

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

/* App Bottom Footer Input Dock */
.app-footer {
  padding: 14px 18px 10px 18px;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 5px 6px 5px 14px;
  transition: all 0.2s ease;
}

.input-row:focus-within {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.attach-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: color 0.2s ease;
}

.attach-btn:hover {
  color: var(--primary);
}

.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.95rem; /* Prevents mobile Safari auto-zoom */
  color: var(--text-primary);
  min-width: 0;
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
  position: relative;
  z-index: 99;
  pointer-events: auto !important;
}

.send-btn:hover {
  transform: scale(1.06);
}

.send-btn:active {
  transform: scale(0.95);
}

.app-security-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.app-security-notice i {
  color: var(--online-green);
}

/* Hide Tawk.to floating bubble & branding footer badges */
html a[href*="tawk.to"],
body a[href*="tawk.to"],
a[href*="tawk.to"],
a[title*="tawk.to"],
[class*="tawk-branding"],
[id*="tawk-branding"],
[class*="tawk-badge"],
[id*="tawk-badge"],
div[class*="tawk"] a,
iframe[title*="tawk"] + div {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  pointer-events: none !important;
}

/* Hide Tawk floating bubble widget initially (until 10-second timer reveals it) */
body.hide-tawk-launcher iframe[title="chat widget"],
body.hide-tawk-launcher iframe[name*="tawk-widget"],
body.hide-tawk-launcher div[class*="tawk-min-container"],
body.hide-tawk-launcher div[id*="tawk-bubble-container"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}

iframe[src*="tawk.to"],
iframe[title*="chat container"],
iframe[name*="tawk-chat"],
div[style*="z-index: 2147483647"] {
  left: 15px !important;
  right: auto !important;
  clip-path: inset(0px 0px 38px 0px) !important;
  -webkit-clip-path: inset(0px 0px 38px 0px) !important;
}

/* ==========================================
   MOBILE FULL SCREEN APK RESPONSIVE RULES
   ========================================== */

@media (max-width: 640px) {
  body {
    padding: 0;
    background-color: #ffffff;
  }

  .app-screen {
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .app-topbar {
    padding: 12px 16px;
  }

  .app-sub-header {
    padding: 8px 16px;
  }

  .app-chat-body {
    padding: 14px;
  }

  .app-footer {
    padding: 10px 14px 8px 14px;
  }
}
