/* Core Variables & Reset */
:root {
  --primary-color: #e67e22; /* United Age Orange */
  --primary-dark: #d35400;
  --bg-dark: #141210; /* Elegant Dark Warm Theme background */
  --bg-light: #fdfefe;
  --text-dark: #2c3e50;
  --text-light: #f5f6fa;
  --border-color: #f0d2c0;
  --mascot-bg: #dadade; /* Silver-grey blending perfectly with the avatar image background */
  --card-bg: rgba(255, 255, 255, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ==========================================================================
   Mock Homepage Styling
   ========================================================================== */

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 6%;
  background: rgba(20, 18, 16, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(230, 126, 34, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
}

.navbar-logo-img {
  height: 38px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-item {
  color: #a0a0a0;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.nav-item:hover {
  color: var(--text-light);
}

/* AI TALK Nav Button */
.ai-talk-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(230, 126, 34, 0.1);
  border: 1px solid rgba(230, 126, 34, 0.3);
  color: var(--primary-color);
  padding: 10px 20px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.ai-talk-nav-btn:hover {
  background: var(--primary-color);
  color: #000;
  box-shadow: 0 0 15px rgba(230, 126, 34, 0.4);
}

.glow-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--primary-color);
  animation: glow-pulse 1.5s infinite alternate;
}

.btn-logo-img {
  height: 18px;
  width: auto;
  display: block;
  object-fit: contain;
}

@keyframes glow-pulse {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 12px var(--primary-color), 0 0 20px var(--primary-color); }
}

/* Hero Section */
.hero-section {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  padding: 80px 8%;
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  gap: 60px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.badge {
  background: rgba(230, 126, 34, 0.1);
  color: var(--primary-color);
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(230, 126, 34, 0.2);
}

.hero-content h1 {
  font-size: 54px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
}

.highlight {
  color: var(--primary-color);
  background: linear-gradient(120deg, #e67e22 0%, #f39c12 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  font-size: 18px;
  line-height: 1.6;
  color: #a0a0a0;
  max-width: 580px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
}

.btn {
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 10px 20px rgba(230, 126, 34, 0.2);
}

.btn-secondary {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Hero Visual card */
.hero-visual {
  display: flex;
  justify-content: center;
}

.card-visual {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 32px;
  border-radius: 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 15px;
}

.orange-text {
  color: var(--primary-color);
}

.progress-bar {
  background: rgba(255, 255, 255, 0.1);
  height: 8px;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  background: var(--primary-color);
  height: 100%;
  border-radius: 9999px;
}

.card-metrics {
  display: flex;
  justify-content: space-between;
}

.card-metrics div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-metrics .label {
  font-size: 12px;
  color: #888;
}

.card-metrics .val {
  font-size: 18px;
  font-weight: 700;
}


/* ==========================================================================
   AI TALK Modal Layout & Container
   ========================================================================== */

.ai-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s var(--transition-smooth);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ai-modal-container {
  display: flex;
  width: 960px;
  height: 640px;
  background: #fff;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScaleUp {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}


/* ==========================================================================
   AI TALK Left Panel (Mascot)
   ========================================================================== */

.ai-left-panel {
  flex: 1;
  background-color: var(--mascot-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  border-right: 1px solid var(--border-color);
  padding: 20px;
  overflow: hidden;
}

.mascot-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end; /* Align to bottom for character stand feel */
}

.rangi-avatar {
  width: 105%;
  height: 105%;
  object-fit: cover; /* Fit completely to avoid boundaries */
  object-position: top;
  border-radius: 0 0 0 28px;
}

.rangi-avatar.animate-bounce {
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-8px) scale(1.01); }
  100% { transform: translateY(0px) scale(1); }
}

/* Mic status and Wave indicators */
.mic-status-container {
  position: absolute;
  bottom: 24px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.65);
  padding: 8px 16px;
  border-radius: 9999px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  z-index: 5;
}

.status-indicator-dot {
  width: 10px;
  height: 10px;
  background-color: #9ca3af;
  border-radius: 50%;
  transition: var(--transition-smooth);
}

.status-indicator-dot.active {
  background-color: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-color);
  animation: pulse-dot-active 1.5s infinite;
}

@keyframes pulse-dot-active {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

#listening-status-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
}

/* Voice wave visualization animation */
.voice-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 16px;
}

.voice-wave span {
  width: 3px;
  height: 100%;
  background: var(--primary-color);
  border-radius: 99px;
  animation: voice-bounce 0.8s ease-in-out infinite alternate;
}

.voice-wave span:nth-child(2) { animation-delay: 0.15s; }
.voice-wave span:nth-child(3) { animation-delay: 0.3s; }
.voice-wave span:nth-child(4) { animation-delay: 0.45s; }

@keyframes voice-bounce {
  0% { height: 4px; }
  100% { height: 16px; }
}


/* ==========================================================================
   AI TALK Right Panel (Chat UI)
   ========================================================================== */

.ai-right-panel {
  flex: 1.1;
  background: #fdfefe;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Header */
.ai-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: #fff;
  border-bottom: 1px solid var(--border-color);
}

.agent-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header-logo-img {
  height: 24px;
  width: auto;
  display: block;
}

.online-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--primary-color);
}

.agent-name {
  font-weight: 700;
  color: var(--text-dark);
  font-size: 16px;
}

.agent-desc {
  font-size: 13px;
  color: #7f8c8d;
}

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

.lang-select {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  background-color: #fff;
  outline: none;
  cursor: pointer;
}

.control-icon-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: #7f8c8d;
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: var(--transition-smooth);
}

.control-icon-btn:hover {
  background: #fcf3eb;
  color: var(--text-dark);
}

.close-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Settings Popup configuration box */
.settings-popup {
  position: absolute;
  top: 70px;
  right: 24px;
  width: 320px;
  background: #fff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  border-radius: 16px;
  padding: 20px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.settings-popup h4 {
  color: var(--text-dark);
  font-size: 15px;
  font-weight: 600;
}

.settings-popup p {
  font-size: 12px;
  color: #7f8c8d;
  line-height: 1.4;
}

.settings-popup .input-group {
  display: flex;
  gap: 8px;
}

.settings-popup input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}

.settings-popup button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.settings-popup .settings-tip {
  color: var(--primary-dark);
  font-weight: 500;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.message-bubble {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.message-bubble.ai {
  align-self: flex-start;
  background-color: #ffffff;
  color: var(--text-dark);
  border: 1px solid rgba(0, 0, 0, 0.03);
  border-top-left-radius: 4px;
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.04);
}

.message-bubble.user {
  align-self: flex-end;
  background-color: var(--primary-color);
  color: #ffffff;
  font-weight: 500;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.15);
}

/* Suggestions chips */
.suggestion-chips {
  display: flex;
  gap: 8px;
  padding: 0 24px 16px 24px;
  overflow-x: auto;
  white-space: nowrap;
}

.chip-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.chip-btn:hover {
  background: rgba(230, 126, 34, 0.05);
  border-color: var(--primary-color);
  color: var(--primary-dark);
}

/* Chat Footer Control */
.ai-chat-footer {
  padding: 20px 24px;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* Main Microphone Button styling */
.mic-action-btn {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(230, 126, 34, 0.2);
  transition: var(--transition-smooth);
}

.mic-action-btn:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 8px 12px -1px rgba(230, 126, 34, 0.3);
}

.mic-action-btn.listening {
  background-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  animation: pulse-listening 1.5s infinite;
}

@keyframes pulse-listening {
  0% { transform: scale(1); }
  50% { transform: scale(0.98); }
  100% { transform: scale(1); }
}

/* Toggle keyboard link styling */
.toggle-keyboard-btn {
  background: transparent;
  border: none;
  font-size: 13px;
  color: #7f8c8d;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.toggle-keyboard-btn:hover {
  color: var(--text-dark);
}

/* Keyboard Input form style */
.keyboard-input-container {
  display: flex;
  width: 100%;
  gap: 10px;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.keyboard-input-container input {
  flex: 1;
  padding: 12px 18px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 14px;
  background-color: #fafbfb;
  color: var(--text-dark);
  outline: none;
  transition: var(--transition-smooth);
}

.keyboard-input-container input:focus {
  border-color: var(--primary-color);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

.keyboard-input-container .send-btn {
  background-color: #2c3e50;
  color: #ffffff;
  border: none;
  padding: 0 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.keyboard-input-container .send-btn:hover {
  background-color: #34495e;
}

/* ==========================================================================
   Mobile Responsive Overrides
   ========================================================================== */
@media (max-width: 768px) {
  /* Landing page overrides */
  .navbar {
    padding: 16px 20px;
  }
  .nav-links {
    display: none;
  }
  .hero-section {
    grid-template-columns: 1fr;
    padding: 40px 24px;
    gap: 30px;
    text-align: center;
  }
  .hero-content {
    align-items: center;
  }
  .hero-content h1 {
    font-size: 34px;
  }
  .hero-visual {
    display: none;
  }

  /* Fullscreen Modal Layout for Mobile App Feel */
  .ai-modal-backdrop {
    padding: 0;
  }

  .ai-modal-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    flex-direction: column;
    animation: slideUpMobile 0.3s cubic-bezier(0.32, 0.94, 0.6, 1);
  }

  @keyframes slideUpMobile {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  /* Split Mascot and Chat vertically */
  .ai-left-panel {
    flex: none;
    height: 38vh;
    padding: 20px 10px 10px 10px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .mascot-wrapper {
    height: 100%;
    width: auto;
    align-items: flex-end;
    overflow: hidden;
  }

  .rangi-avatar {
    height: 100%;
    width: auto;
    max-width: 190px;
    object-fit: contain;
    border-radius: 0;
  }

  .mic-status-container {
    bottom: 12px;
    left: 12px;
    padding: 6px 12px;
  }

  .ai-right-panel {
    flex: 1;
    height: 62vh;
    border-radius: 0;
  }

  .ai-chat-header {
    padding: 12px 16px;
  }

  .chat-messages {
    padding: 16px;
    gap: 12px;
  }

  .message-bubble {
    padding: 10px 14px;
    font-size: 13.5px;
  }

  .suggestion-chips {
    padding: 0 16px 8px 16px;
  }

  .chip-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .ai-chat-footer {
    padding: 12px 16px;
    gap: 10px;
  }

  .mic-action-btn {
    padding: 11px;
    font-size: 14px;
    border-radius: 12px;
  }

  .keyboard-input-container {
    gap: 8px;
  }

  .keyboard-input-container input {
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 10px;
  }

  .keyboard-input-container .send-btn {
    padding: 0 14px;
    border-radius: 10px;
    font-size: 13px;
  }

  .settings-popup {
    width: calc(100% - 32px);
    left: 16px;
    right: 16px;
    top: 60px;
    padding: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  }
}
