/* Futuristic UI Kit for Chiblets Wiki and HunterBot
   Author: Agent Mode
   Notes: This stylesheet layers on top of existing styles to deliver a neon, glass, and aurora aesthetic.
   It assumes the HTML already contains semantic structure and variables. Loaded after inline styles. */

/* Import modern, futuristic fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --ring-focus: 0 0 0 3px rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 8px 24px rgba(2, 6, 23, 0.35);
  --neon-violet: #7c3aed;
  --neon-cyan: #22d3ee;
  --neon-lime: #a3e635;
}

/* Dark theme overrides for a clean, black professional look */
html[data-theme="dark"] {
  --bg-primary: #0b0f14;
  --bg-secondary: #0e1218;
  --bg-tertiary: #141923;
  --bg-card: #0e1218;
  --bg-hover: #121723;
  --text-primary: #e5e7eb;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #1f2733;
  --border-hover: #273244;
}

/********************
  Global background
********************/
html[data-theme="dark"] body {
  background: var(--bg-primary) !important;
  position: relative;
}

/* Animated aurora layer */
html[data-theme="dark"] body::before {
  content: none;
  display: none;
}

/* Subtle hex grid overlay */
html[data-theme="dark"] body::after {
  content: none;
  display: none;
}

@keyframes auroraShift {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0.55; }
  50% { transform: translate3d(-2%, 1%, 0) rotate(8deg); opacity: 0.7; }
  100% { transform: translate3d(2%, -1%, 0) rotate(-8deg); opacity: 0.55; }
}

/********************
  Typography polish
********************/
body { font-family: 'Inter', 'Space Grotesk', system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }

h1, h2, h3 { letter-spacing: -0.02em; }

/* Solid headings (no gradient) */
.hero .logo-text, .hero .logo-subtext, h1, h2 {
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  color: var(--text-primary) !important;
}

/********************
  Glass surfaces
********************/
/* Sidebar and cards */
.sidebar, .card, .table-container, .simulator-controls, .chiblet-display, .upgrade-path, .quick-action-card, .message-content {
  background: var(--glass-bg) !important;
  border: 1px solid var(--glass-border) !important;
  backdrop-filter: saturate(130%) blur(10px);
  -webkit-backdrop-filter: saturate(130%) blur(10px);
  box-shadow: var(--glass-shadow);
}

/* Hover lift */
.card:hover, .quick-action-card:hover, .table-container:hover, .simulator-controls:hover, .upgrade-path:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.45);
}

/********************
  Buttons & controls
********************/
button, .back-to-wiki, .mobile-menu-button, .clear-chat, .send-button, .theme-toggle {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--glass-border) !important;
}

/* Neutral solid buttons */
button, .back-to-wiki {
  background: #151a22;
  color: var(--text-primary);
  border: 1px solid var(--border-color) !important;
}

button:hover, .back-to-wiki:hover {
  background: #1b2230;
  filter: none;
  box-shadow: none;
  border-color: var(--border-hover) !important;
}

/* Ghost buttons */
.clear-chat, .theme-toggle {
  background: transparent;
}

/* Focus rings */
:where(select, button, .input-field, .send-button):focus { outline: none; box-shadow: var(--ring-focus); border-color: var(--border-hover) !important; }

/********************
  Hero section
********************/
.hero {
  position: relative;
  isolation: isolate;
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color);
}
.hero::after {
  content: none;
}

/********************
  Tables
********************/
.table-container table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}
.table-container th {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--glass-border) !important;
}
.table-container td { border-bottom: 1px solid rgba(148, 163, 184, 0.15) !important; }

/********************
  Badges & tokens
********************/
.badge-primary { background: #141923 !important; color: var(--text-secondary) !important; border: 1px solid var(--border-color) !important; }
.badge-warning { background: #141923 !important; color: #f59e0b !important; border: 1px solid var(--border-color) !important; }
.badge-danger  { background: #141923 !important; color: #ef4444 !important; border: 1px solid var(--border-color) !important; }
.badge-success { background: #141923 !important; color: #10b981 !important; border: 1px solid var(--border-color) !important; }

.token { color: var(--text-primary) !important; background: #111827 !important; border: 1px solid var(--border-color) !important; }

/********************
  Sidebar
********************/
.sidebar { backdrop-filter: blur(14px) saturate(140%); }
.sidebar .nav-item { border-left: 3px solid transparent; }
.sidebar .nav-item:hover, .sidebar .nav-item.active { border-left-color: var(--border-hover); background: rgba(255,255,255,0.04); }

/********************
  Inputs - Minimal Black Theme
********************/
.input-container {
  background: transparent !important;
  border-top: none !important;
  box-shadow: none !important;
  padding: 1.5rem !important;
}

.input-field {
  background: #1f2937 !important;
  border: 2px solid #374151 !important;
  color: #f8fafc !important;
  border-radius: 0.75rem !important;
  font-size: 1rem;
  font-weight: 500;
  padding: 1rem 1.25rem !important;
  min-height: 56px !important;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.input-field:focus { 
  border-color: #4f46e5 !important; 
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2), 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  outline: none !important;
  background: #252d3a !important;
}

.input-field:hover {
  border-color: #4b5563 !important;
  background: #252d3a !important;
}

.input-field::placeholder {
  color: #9ca3af !important;
  font-weight: 400;
}

.send-button {
  background: #4f46e5 !important;
  border: 2px solid #4f46e5 !important;
  color: white !important;
  transition: all 0.15s ease;
  min-width: 56px !important;
  min-height: 56px !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.send-button:hover:not(:disabled) {
  background: #3730a3 !important;
  border-color: #3730a3 !important;
  color: white !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3) !important;
}

.send-button:disabled {
  background: #374151 !important;
  border-color: #374151 !important;
  color: #6b7280 !important;
  box-shadow: none !important;
}

/********************
  HunterBot chat - Minimal Black Theme
********************/
/* Chat area background */
.chat-messages {
  background: var(--bg-primary) !important;
}

/* Bot and user message bubbles */
.message-content { 
  background: #151a22 !important;
  border: 1px solid #1f2733 !important;
  box-shadow: none !important;
  color: #e2e8f0 !important;
}

.bot-avatar { 
  background: #151a22 !important; 
  border: 1px solid #1f2733;
}

.bot .message-avatar { 
  background: #151a22 !important; 
  border: 1px solid #1f2733;
}

.user .message-avatar { 
  background: #1f2937 !important;
  border: 1px solid #374151;
}

.user .message-content {
  background: #1f2937 !important;
  border: 1px solid #374151 !important;
  box-shadow: none !important;
  color: #e2e8f0 !important;
}

/* Typing indicator */
.typing-indicator { 
  background: #151a22 !important;
  border: 1px solid #1f2733 !important;
  box-shadow: none !important;
  color: #94a3b8 !important;
}

.typing-dots span {
  background: #64748b !important;
}

/* Welcome message */
.welcome-message {
  background: transparent;
}

.welcome-message h2 {
  background: none !important;
  color: #e2e8f0 !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
}

/* Quick action cards */
.quick-action-card {
  background: #151a22 !important;
  border: 1px solid #1f2733 !important;
  color: #e2e8f0 !important;
}

.quick-action-card:hover {
  background: #1f2937 !important;
  border-color: #374151 !important;
  transform: translateY(-1px);
}

.quick-action-card h4 {
  color: #e2e8f0 !important;
}

.quick-action-card p {
  color: #94a3b8 !important;
}

/********************
  Simulator polish
********************/
.stat-bar-container { border: 1px solid var(--glass-border); background: rgba(255,255,255,0.03); }
.stat-bar-fill.speed    { background: #ef4444 !important; }
.stat-bar-fill.strength { background: #dc2626 !important; }
.stat-bar-fill.stamina  { background: #16a34a !important; }

/********************
  Enhanced Header - Minimal Black Theme
********************/
.header {
  background: #0a0e13 !important;
  border-bottom: 1px solid #1a1f26 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex: 1;
}

.bot-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.bot-details h1 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0;
}

.bot-status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.25rem;
}

.bot-status span {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 400;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.bot-capabilities {
  display: none; /* Simplified - removed for minimal look */
}

.header-stats {
  display: flex;
  gap: var(--space-lg);
  align-items: center;
}

.stat-item {
  text-align: right;
  min-width: 60px;
}

.stat-item i {
  display: none; /* Minimal - text only */
}

.stat-item span {
  display: block;
  font-weight: 600;
  color: #e2e8f0;
  font-size: 0.875rem;
  line-height: 1.2;
}

.stat-item small {
  display: block;
  color: #64748b;
  font-size: 0.7rem;
  margin-top: 0.125rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.header-actions {
  display: flex;
  gap: 0.375rem;
  align-items: center;
}

.help-button, .theme-toggle, .clear-chat {
  background: #151a22;
  border: 1px solid #1f2733;
  color: #94a3b8;
  padding: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-button:hover, .theme-toggle:hover, .clear-chat:hover {
  background: #1f2937;
  color: #e2e8f0;
  border-color: #374151;
}

.back-to-wiki {
  background: #151a22;
  color: #e2e8f0;
  border: 1px solid #1f2733;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.15s ease;
  font-size: 0.85rem;
  font-weight: 500;
}

.back-to-wiki:hover {
  background: #1f2937;
  border-color: #374151;
  transform: none;
  box-shadow: none;
}

.back-text {
  font-size: 0.85rem;
}

/********************
  Footer - Minimal Black Theme
********************/
.footer {
  background: #0a0e13;
  border-top: 1px solid #1a1f26;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.12);
}

.footer.show {
  transform: translateY(0);
}

.footer-toggle {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  background: #151a22;
  border: 1px solid #1f2733;
  color: #64748b;
  padding: 0.5rem;
  border-radius: 0.375rem;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 11;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  font-size: 0.875rem;
}

.footer-toggle:hover {
  background: #1f2937;
  color: #e2e8f0;
  border-color: #374151;
  transform: none;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: var(--space-xl);
  padding: var(--space-xl);
  max-width: 1000px;
  margin: 0 auto;
}

.footer-section h3 {
  color: #e2e8f0;
  margin-bottom: var(--space-sm);
  font-size: 1rem;
  font-weight: 600;
}

.footer-section h4 {
  color: #e2e8f0;
  margin-bottom: var(--space-md);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.footer-section p {
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 0;
  font-size: 0.85rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.15s ease;
  font-weight: 400;
}

.footer-links a:hover {
  color: #e2e8f0;
}

.footer-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.footer-stat {
  text-align: left;
}

.footer-stat strong {
  display: block;
  color: #e2e8f0;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
}

.footer-stat span {
  color: #64748b;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.footer-version {


.footer-bottom {
  border-top: 1px solid #1f2733;
  padding: var(--space-md) var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #080b0f;
}

.footer-bottom p {
  color: #64748b;
  margin: 0;
  font-size: 0.75rem;
}

.footer-actions {
  display: flex;
  gap: 0.375rem;
}

.footer-action {
  background: #151a22;
  border: 1px solid #1f2733;
  color: #94a3b8;
  padding: 0.375rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
}

.footer-action:hover {
  background: #1f2937;
  color: #e2e8f0;
  border-color: #374151;
}

/* Input area stays at bottom */
.input-container {
  position: sticky;
  bottom: 0;
  z-index: 5;
}

/********************
  Mobile Responsive
********************/
@media (max-width: 768px) {
  body {
    height: 100vh;
    height: 100dvh; /* For mobile browsers */
  }
  
  .header {
    padding: 0.75rem;
    min-height: auto;
    background: #0a0e13 !important;
  }
  
  .header-brand {
    flex-direction: row;
    gap: var(--space-md);
    align-items: center;
  }
  
  .bot-details h1 {
    font-size: 1rem;
  }
  
  .bot-status span {
    font-size: 0.75rem;
  }
  
  .header-stats {
    display: none; /* Hide on mobile to save space */
  }
  
  .header-actions {
    gap: 0.25rem;
  }
  
  .help-button, .theme-toggle, .clear-chat {
    width: 32px;
    height: 32px;
    padding: 0.375rem;
    font-size: 0.8rem;
  }
  
  .back-to-wiki {
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
  }
  
  .back-text {
    display: none;
  }
  
  .main-container {
    height: calc(100vh - 64px); /* Adjust for smaller header */
    height: calc(100dvh - 64px);
  }
  
  .chat-messages {
    padding: var(--space-md);
    padding-bottom: var(--space-sm);
    flex: 1;
    overflow-y: auto;
  }
  
  .input-container {
    padding: var(--space-lg) !important;
    padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom)) !important;
    flex-shrink: 0;
    background: transparent !important;
    border-top: none !important;
    box-shadow: none !important;
  }
  
  .input-wrapper {
    gap: var(--space-md);
    max-width: 800px;
    margin: 0 auto;
    position: relative;
  }
  
  .input-field {
    font-size: 16px !important; /* Prevent zoom on iOS */
    min-height: 50px !important;
    background: #1f2937 !important;
    border: 2px solid #374151 !important;
    color: #f8fafc !important;
    padding: 0.875rem 1rem !important;
    border-radius: 1.25rem !important;
    font-weight: 500;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 4px 10px rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: blur(10px);
  }
  
  .input-field:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3), 0 12px 35px rgba(0, 0, 0, 0.4), 0 6px 15px rgba(0, 0, 0, 0.25) !important;
    background: #252d3a !important;
    transform: translateY(-1px) !important;
  }
  
  .input-field:hover {
    border-color: #4b5563 !important;
    background: #252d3a !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 5px 12px rgba(0, 0, 0, 0.22) !important;
    transform: translateY(-1px) !important;
  }
  
  .input-field::placeholder {
    color: #9ca3af !important;
    font-weight: 400;
  }
  
  .send-button {
    width: 50px !important;
    height: 50px !important;
    min-width: 50px !important;
    background: #4f46e5 !important;
    border: 2px solid #4f46e5 !important;
    color: white !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4), 0 4px 10px rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: blur(10px);
  }
  
  .send-button:hover:not(:disabled) {
    background: #3730a3 !important;
    border-color: #3730a3 !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 35px rgba(79, 70, 229, 0.5), 0 6px 15px rgba(0, 0, 0, 0.25) !important;
  }
  
  .welcome-message {
    padding: var(--space-lg) var(--space-sm);
  }
  
  .welcome-message h2 {
    font-size: 1.4rem;
  }
  
  .quick-actions {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  
  .quick-action-card {
    padding: var(--space-md);
  }
  
  .message {
    max-width: 90%;
  }
  
  .message-content {
    padding: var(--space-md);
    font-size: 0.9rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    padding: var(--space-md);
    max-height: 60vh;
    overflow-y: auto;
  }
  
  .footer-section h3 {
    font-size: 0.9rem;
  }
  
  .footer-section h4 {
    font-size: 0.8rem;
  }
  
  .footer-links a {
    font-size: 0.75rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
    padding: var(--space-sm);
  }
  
  .footer-bottom p {
    font-size: 0.7rem;
  }
  
  .footer-actions {
    gap: 0.25rem;
  }
  
  .footer-action {
    padding: 0.25rem 0.375rem;
    font-size: 0.7rem;
  }
  
  .footer-stats {
    flex-direction: row;
    gap: var(--space-sm);
  }
  
  .footer-stat {
    text-align: center;
    flex: 1;
  }
  
  .footer-toggle {
    bottom: 80px; /* Above input area */
    right: var(--space-md);
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }
}

/* Additional mobile fixes */
@media (max-width: 480px) {
  .header {
    padding: 0.5rem;
  }
  
  .bot-details h1 {
    font-size: 0.9rem;
  }
  
  .header-actions {
    gap: 0.125rem;
  }
  
  .help-button, .theme-toggle, .clear-chat {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
  
  .back-to-wiki {
    padding: 0.25rem 0.375rem;
    font-size: 0.75rem;
  }
  
  .chat-messages {
    padding: var(--space-sm);
  }
  
  .input-container {
    padding: var(--space-md) !important;
    padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom)) !important;
    background: transparent !important;
    border-top: none !important;
  }
  
  .input-field {
    min-height: 48px !important;
    padding: 0.875rem 1rem !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 3px 8px rgba(0, 0, 0, 0.18) !important;
    backdrop-filter: blur(10px);
  }
  
  .send-button {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35), 0 3px 8px rgba(0, 0, 0, 0.18) !important;
    backdrop-filter: blur(10px);
  }
  
  .footer-toggle {
    bottom: 70px;
    right: var(--space-sm);
    width: 32px;
    height: 32px;
  }
  
  .main-container {
    height: calc(100vh - 56px);
    height: calc(100dvh - 56px);
  }
}

/********************
  Mobile polish
********************/
@media (max-width: 768px) {
  .hero { box-shadow: none; }
  .sidebar { backdrop-filter: blur(10px) saturate(120%); box-shadow: 0 10px 30px rgba(0,0,0,0.25); }
  .message { max-width: 95% !important; }
}

