/* ==========================================================================
   Pixo Bot AI - Modern Text Messaging Chat Styling
   ========================================================================== */

:root {
  --pixo-ai-primary: #00f2fe;
  --pixo-ai-secondary: #4facfe;
  --pixo-ai-accent: #7f00ff;
  --pixo-ai-orange: #ff6600;

  /* Dark Mode Default Tokens */
  --pixo-ai-overlay-bg: rgba(8, 6, 20, 0.88);
  --pixo-ai-card-bg: rgba(18, 14, 42, 0.94);
  --pixo-ai-card-border: rgba(0, 242, 254, 0.25);
  --pixo-ai-card-shadow: 0 25px 70px rgba(0, 0, 0, 0.65), 0 0 40px rgba(0, 242, 254, 0.15);
  --pixo-ai-text-main: #ffffff;
  --pixo-ai-text-muted: rgba(255, 255, 255, 0.65);
  --pixo-ai-sub-bg: rgba(12, 10, 28, 0.9);
  --pixo-ai-user-bubble: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --pixo-ai-bot-bubble: rgba(255, 255, 255, 0.08);
  --pixo-ai-btn-bg: rgba(255, 255, 255, 0.08);
  --pixo-ai-btn-border: rgba(255, 255, 255, 0.15);
  --pixo-ai-btn-text: #ffffff;
}

body.light-mode {
  --pixo-ai-overlay-bg: rgba(245, 247, 250, 0.88);
  --pixo-ai-card-bg: rgba(255, 255, 255, 0.96);
  --pixo-ai-card-border: rgba(0, 102, 255, 0.2);
  --pixo-ai-card-shadow: 0 25px 60px rgba(15, 23, 42, 0.12);
  --pixo-ai-text-main: #0f172a;
  --pixo-ai-text-muted: #64748b;
  --pixo-ai-sub-bg: rgba(241, 245, 249, 0.95);
  --pixo-ai-user-bubble: linear-gradient(135deg, #0066ff 0%, #00f2fe 100%);
  --pixo-ai-bot-bubble: rgba(15, 23, 42, 0.06);
  --pixo-ai-btn-bg: rgba(15, 23, 42, 0.05);
  --pixo-ai-btn-border: rgba(15, 23, 42, 0.12);
  --pixo-ai-btn-text: #0f172a;
}

/* Floating Trigger Button - Hidden to keep only the main bottom trigger button */
.pixo-voice-trigger {
  display: none !important;
}

.pixo-voice-trigger:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 14px 40px rgba(0, 242, 254, 0.6);
}

.pixo-voice-trigger-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  background: linear-gradient(90deg, #ff6600, #ff0055);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 10px rgba(255, 0, 85, 0.4);
}

/* Modal Overlay & Full Screen Chat Card */
.pixo-voice-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--pixo-ai-overlay-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 0;
  box-sizing: border-box;
}

.pixo-voice-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.pixo-voice-card {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  background: var(--pixo-ai-card-bg);
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Header */
.pixo-voice-header {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.pixo-voice-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00f2fe, #7f00ff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
}

.pixo-voice-title h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pixo-ai-text-main);
}

.pixo-voice-title p {
  margin: 2px 0 0 0;
  font-size: 0.78rem;
  color: var(--pixo-ai-text-muted);
}

.pixo-online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e676;
  box-shadow: 0 0 8px #00e676;
}

.pixo-voice-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--pixo-ai-text-main);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.pixo-voice-close-btn:hover {
  background: rgba(255, 0, 85, 0.2);
  color: #ff0055;
}

/* Chips Grid */
.pixobot-chips-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pixobot-chips-grid::-webkit-scrollbar {
  display: none;
}

.pixobot-chip-btn {
  background: var(--pixo-ai-btn-bg);
  border: 1px solid var(--pixo-ai-btn-border);
  color: var(--pixo-ai-btn-text);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pixobot-chip-btn:hover {
  background: var(--pixo-ai-primary);
  color: #000000;
  border-color: var(--pixo-ai-primary);
}

/* Message Stream Container */
.pixo-transcript-box {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--pixo-ai-sub-bg);
}

.pixo-chat-msg {
  display: flex;
  gap: 10px;
  max-width: 86%;
  animation: pixoFadeIn 0.25s ease-out forwards;
}

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

.pixo-chat-bot {
  align-self: flex-start;
}

.pixo-chat-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.pixo-chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00f2fe, #4facfe);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.pixo-chat-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.pixo-chat-bubble {
  background: var(--pixo-ai-bot-bubble);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 14px;
  border-radius: 16px;
  border-top-left-radius: 4px;
  color: var(--pixo-ai-text-main);
  font-size: 0.9rem;
  line-height: 1.45;
}

.pixo-chat-user .pixo-chat-bubble {
  background: var(--pixo-ai-user-bubble);
  color: #ffffff;
  border-radius: 16px;
  border-top-right-radius: 4px;
  border: none;
}

.pixo-chat-sender {
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 3px;
  opacity: 0.85;
}

.pixo-chat-time {
  font-weight: 400;
  font-size: 0.65rem;
  margin-left: 6px;
  opacity: 0.6;
}

/* Typing indicator */
.pixo-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
}

.pixo-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pixo-ai-primary);
  animation: pixoBlink 1.4s infinite ease-in-out;
}

.pixo-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.pixo-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pixoBlink {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* Text Input Row */
.pixo-voice-input-row {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 8px;
  align-items: center;
}

.pixo-voice-input-row input {
  flex: 1;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 10px 16px;
  color: var(--pixo-ai-text-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

body.light-mode .pixo-voice-input-row input {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.15);
}

.pixo-voice-input-row input:focus {
  border-color: var(--pixo-ai-primary);
}

.pixo-voice-input-row button {
  background: linear-gradient(135deg, #00f2fe, #4facfe);
  border: none;
  border-radius: 20px;
  padding: 10px 18px;
  color: #000000;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  transition: transform 0.2s ease;
}

.pixo-voice-input-row button:hover {
  transform: scale(1.04);
}

/* Page Studio Styling for /pixobot */
body.pixobot-page-body {
  background: #080614;
  color: #ffffff;
  min-height: 100vh;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pixobot-nav-header {
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pixobot-brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
}

.pixobot-brand-logo img {
  height: 36px;
}

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

.pixobot-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.pixobot-user-badge img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.pixobot-balance-num {
  color: #00f2fe;
  font-weight: 700;
}

.pixobot-btn-back {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 7px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.pixobot-stage-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  min-height: calc(100vh - 64px);
  width: 100%;
  box-sizing: border-box;
}

.pixobot-studio-card {
  width: 100%;
  max-width: 100%;
  height: calc(100vh - 64px);
  background: rgba(18, 14, 42, 0.94);
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
  box-sizing: border-box;
}

.pixobot-greeting-box {
  text-align: center;
  margin-bottom: 12px;
}

.pixobot-greeting-box h2 {
  margin: 0;
  font-size: 1.4rem;
  color: #00f2fe;
}

.pixobot-greeting-box p {
  margin: 4px 0 0 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
}

/* Mobile responsive fixes for bottom navbar integration */
@media (max-width: 768px) {
  .pixo-voice-trigger {
    display: none !important;
  }

  .pixo-voice-card {
    height: 84vh;
    max-height: 84vh;
    margin-bottom: 70px;
    border-radius: 20px;
  }
}
