/* ==========================================================================
   C TOURS MX — LIVE AI SIMULTANEOUS TRANSLATOR (OLED DARK MODE)
   Designed for iOS Safari, Android Chrome, WeChat Browser & Guide Cabin Use
   ========================================================================== */

:root {
  --bg-oled: #050a10;
  --bg-card: #0d1724;
  --bg-card-elevated: #132235;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(36, 189, 199, 0.45);
  --primary: #24BDC7;
  --primary-dark: #0e8a92;
  --amber: #f59e0b;
  --amber-dark: #d97706;
  --success: #10b981;
  --danger: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background-color: var(--bg-oled);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Top Header */
.live-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 10, 16, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-wrap img {
  height: 36px;
  width: auto;
  border-radius: 8px;
}

.brand-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-mode-switch {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-mode-switch:hover, .btn-mode-switch.active {
  background: rgba(36, 189, 199, 0.18);
  border-color: var(--primary);
  color: #fff;
}

/* Main Container */
.live-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 16px 14px 175px;
}

/* Cards */
.live-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.live-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-card-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.45;
}

/* Language Selection Grid (10 Primary Languages) */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 540px) {
  .lang-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.lang-btn {
  background: var(--bg-card-elevated);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px 10px;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: all 0.18s ease;
}

.lang-btn:hover {
  border-color: rgba(36, 189, 199, 0.4);
  transform: translateY(-1px);
}

.lang-btn.selected {
  background: rgba(36, 189, 199, 0.16);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(36, 189, 199, 0.2);
}

.lang-flag {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.lang-native {
  font-size: 0.92rem;
  font-weight: 800;
  display: block;
}

.lang-es-name {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
}

/* Inputs & Selects */
.input-group {
  margin-bottom: 12px;
}

.input-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.live-input, .live-select {
  width: 100%;
  background: #070e17;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}

.live-input:focus, .live-select:focus {
  border-color: var(--primary);
}

/* Primary CTA Connect Headphones Button */
.btn-connect-headphones {
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, #0d9488 100%);
  color: #ffffff;
  border: none;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 25px rgba(36, 189, 199, 0.35);
  transition: transform 0.15s ease;
}

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

/* Sticky Return Time Alert Banner */
.return-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(217, 119, 6, 0.15));
  border: 2px solid var(--amber);
  border-radius: var(--radius-md);
  padding: 12px 15px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: pulseBorder 2.5s infinite;
}

@keyframes pulseBorder {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}

.return-time-big {
  font-size: 1.45rem;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: 0.02em;
}

/* Quick Action Bar for Tourists */
.quick-actions-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

@media (min-width: 480px) {
  .quick-actions-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

.btn-quick-pill {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 8px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  transition: all 0.15s ease;
}

.btn-quick-pill i, .btn-quick-pill .q-emoji {
  font-size: 1.2rem;
}

.btn-quick-pill:active {
  background: rgba(36, 189, 199, 0.25);
  border-color: var(--primary);
}

.btn-quick-pill.emergency {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

/* Live Feed Messages */
.messages-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all 0.2s ease;
}

.msg-bubble.passenger-msg {
  border-left-color: var(--amber);
  background: #131c2b;
}

.msg-bubble.alert-msg {
  border-left-color: var(--success);
  background: rgba(16, 185, 129, 0.08);
}

.msg-bubble.emergency-msg {
  border-left-color: var(--danger);
  background: rgba(239, 68, 68, 0.15);
}

.msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.msg-sender {
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.msg-bubble.passenger-msg .msg-sender {
  color: #fbbf24;
}

.msg-text-primary {
  font-size: 1.05rem;
  line-height: 1.55;
  font-weight: 600;
  color: #ffffff;
  white-space: pre-line;
}

.msg-text-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.btn-replay-msg {
  margin-top: 8px;
  background: rgba(36, 189, 199, 0.14);
  color: var(--primary);
  border: 1px solid rgba(36, 189, 199, 0.35);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-replay-msg.playing {
  background: rgba(245, 158, 11, 0.24);
  color: #fde68a;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.live-toast {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 250;
  background: rgba(19, 34, 53, 0.96);
  border: 1.5px solid var(--amber);
  color: #fde68a;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  text-align: center;
  max-width: 92vw;
}

.live-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* Bottom Fixed Walkie-Talkie Dock for Tourists */
.bottom-talk-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 95;
  background: rgba(5, 10, 16, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-subtle);
  padding: 10px 14px 16px;
}

.dock-inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-ptt-giant {
  width: 100%;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  color: #ffffff;
  border: none;
  padding: 15px 18px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
  transition: all 0.15s ease;
}

.btn-ptt-giant.recording {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.3);
  transform: scale(0.99);
}

.text-question-row {
  display: flex;
  gap: 8px;
}

.text-question-row input {
  flex: 1;
  background: #0d1724;
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
}

.text-question-row button {
  background: var(--bg-card-elevated);
  color: var(--primary);
  border: 1px solid var(--border-accent);
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}

/* Guide Cabin Controls */
.guide-mic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.btn-guide-mic {
  padding: 18px 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-subtle);
  background: var(--bg-card-elevated);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: all 0.2s ease;
}

.btn-guide-mic i {
  font-size: 1.65rem;
  color: var(--primary);
}

.btn-guide-mic.active-handsfree {
  background: rgba(16, 185, 129, 0.18);
  border-color: var(--success);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25);
}

.btn-guide-mic.active-handsfree i {
  color: var(--success);
}

.btn-guide-mic.active-ptt {
  background: rgba(239, 68, 68, 0.24);
  border-color: var(--danger);
}

/* Voice Level Meter Bar */
.vad-meter-wrap {
  background: #060d16;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.vad-meter-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  transition: width 0.08s linear;
}

/* Capsules Grid */
.capsules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.btn-capsule {
  background: #101d2e;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 11px 10px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-capsule:hover {
  border-color: var(--primary);
  background: rgba(36, 189, 199, 0.12);
}

/* Connected Passengers Badges */
.pax-badges-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pax-lang-badge {
  background: rgba(36, 189, 199, 0.14);
  border: 1px solid rgba(36, 189, 199, 0.35);
  color: #fff;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Modal (5-Star Review Shield & QR Code) */
.live-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.live-modal-backdrop.open {
  display: flex;
}

.live-modal-box {
  background: var(--bg-card);
  border: 2px solid var(--primary);
  border-radius: 22px;
  max-width: 440px;
  width: 100%;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

.star-picker {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 16px 0;
}

.star-btn {
  background: none;
  border: none;
  font-size: 2.3rem;
  color: #334155;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
}

.star-btn.lit {
  color: #fbbf24;
  transform: scale(1.1);
}

.hidden {
  display: none !important;
}
