/**
 * Quantum Marketing AI - Ultra Modern Interactive Style
 * This style uses advanced CSS with a focus on glassmorphism, neubrutalism, and 
 * dynamic gradients for a cutting-edge tech aesthetic
 */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  /* Ultra-modern gradient colors */
  --gradient-primary: linear-gradient(145deg, #6600ff, #e100ff);
  --gradient-secondary: linear-gradient(145deg, #ff0099, #6600ff);
  --gradient-accent: linear-gradient(145deg, #00ffcc, #00bbff);
  --gradient-dark: linear-gradient(145deg, #1a0033, #330033);
  
  /* Base colors */
  --color-primary: #6e00ff;
  --color-secondary: #ff00aa;
  --color-accent: #00eeff;
  --color-success: #00ffa3;
  --color-warning: #ffcc00;
  --color-error: #ff3366;
  --color-dark: #13001a;
  --color-light: #f9f8ff;
  
  /* Glass effect variables */
  --glass-background: rgba(255, 255, 255, 0.1);
  --glass-background-darker: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  /* Brutalist variables */
  --brutal-shadow: 4px 4px 0 rgba(0, 0, 0, 0.9);
  --brutal-border: 2px solid #000;
  
  /* Space variables */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-xxl: 4rem;
}

/* Base styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: #0c0012;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(106, 0, 255, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 85% 30%, rgba(255, 0, 170, 0.15) 0%, transparent 55%);
  color: var(--color-light);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Grid background effect */
body::before {
  content: '';
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -1;
  pointer-events: none;
}

/* Animated background dot effect */
body::after {
  content: '';
  position: fixed;
  width: 300vw;
  height: 300vh;
  top: -100vh;
  left: -100vw;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 30px 30px;
  animation: backgroundMove 120s linear infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes backgroundMove {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-100px) rotate(5deg); }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

h1 {
  font-size: 3.5rem;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  font-size: 2.25rem;
}

h3 {
  font-size: 1.75rem;
}

p {
  margin-bottom: var(--space-md);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

a:hover {
  color: var(--color-secondary);
}

/* Neo-brutalist elements */
.brutal-box {
  border: var(--brutal-border);
  box-shadow: var(--brutal-shadow);
  background: var(--color-primary);
  transform: rotate(-1deg);
  transition: transform 0.3s ease;
}

.brutal-box:hover {
  transform: rotate(0) scale(1.02);
}

/* Glass elements */
.glass {
  background: var(--glass-background);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.glass-dark {
  background: var(--glass-background-darker);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* Neon effects */
.neon-text {
  text-shadow: 
    0 0 5px rgba(0, 238, 255, 0.8),
    0 0 10px rgba(0, 238, 255, 0.5),
    0 0 15px rgba(0, 238, 255, 0.3);
}

.neon-border {
  border: 2px solid var(--color-accent);
  box-shadow: 
    0 0 5px rgba(0, 238, 255, 0.8),
    0 0 10px rgba(0, 238, 255, 0.5);
}

/* Main layout components */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

header {
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  background: rgba(19, 0, 26, 0.75);
  border-bottom: 1px solid var(--glass-border);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-highlight {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

main {
  padding: var(--space-xl) 0;
  min-height: calc(100vh - 200px);
}

.intro-section {
  text-align: center;
  max-width: 800px;
  margin: 0 auto var(--space-xxl);
}

.intro-tagline {
  font-size: 1.25rem;
  margin-bottom: var(--space-xl);
  opacity: 0.9;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: none;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  background-size: 200% auto;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transform: skewX(-30deg);
  transition: all 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background-image: var(--gradient-primary);
  color: white;
}

.btn-primary:hover {
  background-position: right center;
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgba(106, 0, 255, 0.4);
}

.btn-secondary {
  background-image: var(--gradient-secondary);
  color: white;
}

.btn-secondary:hover {
  background-position: right center;
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgba(255, 0, 170, 0.4);
}

.btn-accent {
  background-image: var(--gradient-accent);
  color: var(--color-dark);
}

.btn-accent:hover {
  background-position: right center;
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgba(0, 238, 255, 0.4);
}

.btn-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.btn-icon i {
  font-size: 1.2em;
}

.btn-brutalist {
  background: white;
  color: black;
  border: var(--brutal-border);
  box-shadow: var(--brutal-shadow);
  border-radius: 0;
  transform: rotate(-1deg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-brutalist:hover {
  transform: rotate(0) scale(1.05);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.9);
}

/* Chat container */
.chat-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 1000px;
  margin: 0 auto;
  height: 600px;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  animation: fadeIn 1s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-container {
  background: rgba(19, 0, 26, 0.4);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--glass-border);
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  background: var(--glass-background-darker);
  border-bottom: 1px solid var(--glass-border);
}

.chat-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.chat-actions {
  display: flex;
  gap: var(--space-sm);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.message {
  max-width: 80%;
  padding: var(--space-md) var(--space-lg);
  border-radius: 12px;
  position: relative;
  animation: messageAppear 0.3s ease;
}

@keyframes messageAppear {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-message {
  align-self: flex-end;
  background: var(--gradient-primary);
  color: white;
  border-bottom-right-radius: 0;
  box-shadow: 0 4px 15px rgba(106, 0, 255, 0.3);
}

.assistant-message {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-left-radius: 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.message-content {
  line-height: 1.5;
}

.message-time {
  font-size: 0.75rem;
  margin-top: var(--space-xs);
  opacity: 0.7;
  text-align: right;
}

.message-audio {
  margin-top: var(--space-sm);
  display: flex;
  justify-content: flex-end;
}

.play-audio-btn {
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  opacity: 0.8;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 5px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
}

.play-audio-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

.chat-input-container {
  padding: var(--space-md);
  background: var(--glass-background-darker);
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.chat-input {
  flex: 1;
  padding: var(--space-md) var(--space-lg);
  border-radius: 100px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--color-light);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
}

.chat-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 238, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
}

.send-button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-accent);
  color: var(--color-dark);
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(0, 238, 255, 0.3);
}

.send-button:hover {
  transform: scale(1.05);
  box-shadow: 0 7px 20px rgba(0, 238, 255, 0.4);
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Typing indicator */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  margin-bottom: var(--space-md);
  align-self: flex-start;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: 0s;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Consultation components */
.consultation-status {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: rgba(0, 238, 255, 0.1);
  border-left: 3px solid var(--color-accent);
  border-radius: 6px;
  margin-bottom: var(--space-lg);
  font-size: 0.9rem;
}

.consultation-ended {
  text-align: center;
  padding: var(--space-xl);
  background: rgba(19, 0, 26, 0.6);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 16px;
  margin: var(--space-lg) 0;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.consultation-summary {
  background: rgba(19, 0, 26, 0.6);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 16px;
  padding: var(--space-lg);
  margin-top: var(--space-xl);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.summary-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.summary-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-md);
}

.summary-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.summary-question {
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--color-accent);
}

.summary-answer {
  opacity: 0.9;
}

/* Chat history panel */
.history-panel {
  position: fixed;
  top: 0;
  right: -450px;
  width: 400px;
  height: 100vh;
  background: rgba(19, 0, 26, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-left: 1px solid var(--glass-border);
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.history-header {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
}

.history-title {
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.close-button {
  background: none;
  border: none;
  color: var(--color-light);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-accent);
}

.history-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

.history-content::-webkit-scrollbar {
  width: 6px;
}

.history-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.history-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.history-date {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.85rem;
  color: var(--color-accent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: var(--space-md);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.history-item {
  padding: var(--space-md);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: var(--space-md);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-accent);
  transform: translateX(-3px);
}

.history-item-time {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-bottom: var(--space-xs);
}

.history-item-question {
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.history-item-preview {
  font-size: 0.85rem;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-audio-btn {
  font-size: 0.75rem;
  margin-top: var(--space-xs);
  color: var(--color-accent);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(0, 238, 255, 0.1);
  transition: all 0.2s ease;
}

.history-audio-btn:hover {
  background: rgba(0, 238, 255, 0.2);
}

/* Footer */
footer {
  padding: var(--space-lg) 0;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.7;
  background: rgba(19, 0, 26, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--glass-border);
}

/* Debug panel */
.debug-panel {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  background: rgba(0, 0, 0, 0.8);
  color: #00ff00;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  padding: var(--space-sm);
  border-radius: 8px;
  max-width: 400px;
  max-height: 300px;
  overflow: auto;
  z-index: 9999;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 255, 0, 0.3);
}

.debug-panel::-webkit-scrollbar {
  width: 4px;
}

.debug-panel::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

.debug-panel::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 0, 0.5);
  border-radius: 2px;
}

.debug-title {
  color: #00ff00;
  margin-bottom: var(--space-sm);
  font-weight: bold;
  border-bottom: 1px solid rgba(0, 255, 0, 0.3);
  padding-bottom: var(--space-xs);
}

.debug-content pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.4;
}

/* Utility classes */
.hidden {
  display: none !important;
}

.visible {
  display: block;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.space-between {
  justify-content: space-between;
}

.items-center {
  align-items: center;
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.text-center {
  text-align: center;
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-accent {
  color: var(--color-accent);
}

.text-warning {
  color: var(--color-warning);
}

.text-error {
  color: var(--color-error);
}

.font-bold {
  font-weight: 700;
}

.mb-sm {
  margin-bottom: var(--space-sm);
}

.mb-md {
  margin-bottom: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.ml-auto {
  margin-left: auto;
}

.mr-auto {
  margin-right: auto;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.glow-border {
  box-shadow: 0 0 10px rgba(0, 238, 255, 0.5);
}

/* Animations */
@keyframes floating {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }
  
  .container {
    padding: 0 var(--space-md);
  }
  
  .chat-wrapper {
    height: 70vh;
    max-height: 600px;
  }
  
  .history-panel {
    width: 100%;
    right: -100%;
  }
  
  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
  
  .message {
    max-width: 90%;
  }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  :root {
    --glass-background: rgba(255, 255, 255, 0.08);
    --glass-background-darker: rgba(255, 255, 255, 0.05);
  }
}