/* ========================================================
   ATHERIUM AI - HIGH-END DESIGN SYSTEM & ULTRA-SMOOTH ANIMATIONS
   ======================================================== */

:root {
  --bg-deep: #030712;
  --bg-navy: #060c1d;
  --bg-card: rgba(10, 19, 41, 0.72);
  --bg-card-hover: rgba(16, 30, 62, 0.85);
  --border-subtle: rgba(56, 189, 248, 0.12);
  --border-active: rgba(56, 189, 248, 0.4);
  --blue-light: #38bdf8;
  --blue-core: #2563eb;
  --blue-navy: #1e3a8a;
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-deep);
  color: #f1f5f9;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Smooth Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.18);
  border-radius: 9999px;
  transition: background 0.3s var(--ease-smooth);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.4);
}

/* ========================================================
   ULTRA-SLEEK LOADING SCREEN WITH TRANSPARENT LOGO
   ======================================================== */
#atherium-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at center, #091533 0%, #030712 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s var(--ease-smooth), visibility 0.8s var(--ease-smooth);
}

#atherium-loader.hidden-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-visual-wrapper {
  position: relative;
  width: 170px;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ambient-energy-orb {
  position: absolute;
  inset: -10px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.5) 0%, rgba(37, 99, 235, 0.25) 50%, transparent 75%);
  filter: blur(28px);
  animation: pulseOrb 2.8s ease-in-out infinite alternate;
}

@keyframes pulseOrb {
  0% { transform: scale(0.85); opacity: 0.55; }
  100% { transform: scale(1.28); opacity: 1; }
}

.quantum-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.quantum-ring.outer {
  inset: 0;
  border: 1.5px solid transparent;
  border-top-color: #38bdf8;
  border-right-color: rgba(56, 189, 248, 0.35);
  animation: spinClockwise 3s linear infinite;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.7));
}

.quantum-ring.middle {
  inset: 16px;
  border: 1.5px solid transparent;
  border-bottom-color: #818cf8;
  border-left-color: rgba(129, 140, 248, 0.35);
  animation: spinCounterClockwise 2.2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  filter: drop-shadow(0 0 8px rgba(129, 140, 248, 0.6));
}

.quantum-ring.inner {
  inset: 32px;
  border: 1.5px dashed rgba(56, 189, 248, 0.5);
  animation: spinClockwise 4.5s linear infinite;
}

/* BIG TRANSPARENT LOGO IN LOADER (NO BACKGROUND) */
.loader-transparent-logo {
  position: relative;
  z-index: 5;
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 0 25px rgba(56, 189, 248, 0.85));
  animation: logoBreathing 2.4s ease-in-out infinite;
}

@keyframes logoBreathing {
  0%, 100% { transform: scale(0.96); filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.6)); }
  50% { transform: scale(1.06); filter: drop-shadow(0 0 28px rgba(56, 189, 248, 0.95)); }
}

@keyframes spinClockwise {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes spinCounterClockwise {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

.loader-progress-track {
  width: 220px;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
  margin-top: 26px;
}

.loader-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, transparent, #38bdf8, #818cf8, transparent);
  transform: translateX(-100%);
  animation: progressLight 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes progressLight {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ========================================================
   RGB GLOWING INPUT BUBBLE (LIGHT BLUE -> DARK BLUE)
   ======================================================== */
.input-bubble-shell {
  position: relative;
  border-radius: 1.6rem;
  transition: all 0.35s var(--ease-smooth);
  background: rgba(10, 19, 41, 0.88);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.input-bubble-shell::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 1.7rem;
  padding: 2px;
  background: linear-gradient(135deg, #38bdf8, #0284c7, #1e3a8a, #0369a1, #60a5fa, #38bdf8);
  background-size: 350% 350%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s var(--ease-smooth), filter 0.35s var(--ease-smooth);
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.3));
}

.input-bubble-shell:focus-within {
  transform: translateY(-3px) scale(1.008);
  background: rgba(13, 26, 56, 0.96);
  box-shadow: 0 14px 35px -6px rgba(2, 132, 199, 0.3), 0 0 24px rgba(56, 189, 248, 0.25);
}

.input-bubble-shell:focus-within::before {
  opacity: 1;
  filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.75));
  animation: rgbBlueFlow 4.5s ease infinite;
}

@keyframes rgbBlueFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ========================================================
   GLASS CARDS & MICRO-INTERACTIONS
   ======================================================== */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  transition: all 0.3s var(--ease-smooth);
}

.glass-panel:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px -8px rgba(3, 105, 161, 0.25);
}

/* Model Tag Badges */
.tag-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.55rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.tag-blue { background: rgba(56, 189, 248, 0.14); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.35); }
.tag-emerald { background: rgba(52, 211, 153, 0.14); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.35); }
.tag-amber { background: rgba(251, 191, 36, 0.14); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.35); }
.tag-purple { background: rgba(192, 132, 252, 0.14); color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.35); }
.tag-lime { background: rgba(163, 230, 53, 0.14); color: #a3e635; border: 1px solid rgba(163, 230, 53, 0.35); }
.tag-cyan { background: rgba(34, 211, 238, 0.14); color: #22d3ee; border: 1px solid rgba(34, 211, 238, 0.35); }
.tag-violet { background: rgba(167, 139, 250, 0.14); color: #a78bfa; border: 1px solid rgba(167, 139, 250, 0.35); }
.tag-indigo { background: rgba(129, 140, 248, 0.14); color: #818cf8; border: 1px solid rgba(129, 140, 248, 0.35); }

/* Category Filter Pills */
.filter-pill {
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.25s var(--ease-smooth);
  cursor: pointer;
  border: 1px solid rgba(56, 189, 248, 0.15);
  background: rgba(10, 19, 41, 0.6);
  color: #94a3b8;
}

.filter-pill:hover {
  color: #f1f5f9;
  border-color: rgba(56, 189, 248, 0.4);
}

.filter-pill.active {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

/* Chat Message Styling */
.user-msg-bubble {
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 6px 20px rgba(29, 78, 216, 0.25);
}

.ai-msg-bubble {
  background: rgba(10, 19, 41, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.14);
}

.ai-msg-seamless {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0.25rem 0;
}

/* Animations */
.fade-in-up {
  animation: fadeInUp 0.4s var(--ease-smooth) forwards;
}

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

/* Ambient glow accents */
.ambient-glow-mesh {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.18) 0%, rgba(37, 99, 235, 0.08) 50%, transparent 75%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

/* ========================================================
   TRANSPARENT MINIMAL GENERATING INDICATOR
   Simple, transparent text with animated typing dots (...)
   ======================================================== */
.wonder-card {
  position: relative;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0.25rem 0 !important;
  margin: 0.375rem 0 !important;
}

.wonder-dot-pulse {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.125rem;
}

.wonder-dot-pulse span {
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  background-color: #38bdf8;
  animation: wonderDotPulse 1.4s ease-in-out infinite both;
}

.wonder-dot-pulse span:nth-child(1) { animation-delay: 0s; }
.wonder-dot-pulse span:nth-child(2) { animation-delay: 0.2s; }
.wonder-dot-pulse span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wonderDotPulse {
  0%, 80%, 100% {
    transform: scale(0.7);
    opacity: 0.3;
  }
  40% {
    transform: scale(1.15);
    opacity: 1;
  }
}

/* ========================================================
   PERFECT-FIT RESPONSIVE TOOLBAR SYSTEM
   Guarantees zero button wrapping or clipping across phones, tablets & laptops
   ======================================================== */

.responsive-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
  gap: 0.375rem;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.btn-perfect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
  touch-action: manipulation;
  transition: all 0.2s var(--ease-smooth);
}

.btn-perfect:active {
  transform: scale(0.96);
}

/* ========================================================
   DRAGGABLE SPLIT RESIZERS (SMOOTH PANEL SCALING)
   ======================================================== */

#side-workspace-resizer {
  display: none;
  cursor: col-resize;
  width: 12px;
  margin-left: -6px;
  margin-right: -6px;
  z-index: 40;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
  position: relative;
  transition: background 0.15s ease;
}

@media (min-width: 1024px) {
  #side-workspace-resizer.is-active {
    display: flex;
  }
}

#side-workspace-resizer:hover,
#side-workspace-resizer.resizing {
  background: rgba(56, 189, 248, 0.08);
}

#side-workspace-resizer .resizer-thumb {
  width: 3px;
  height: 38px;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.35);
  transition: all 0.2s var(--ease-smooth);
}

#side-workspace-resizer:hover .resizer-thumb,
#side-workspace-resizer.resizing .resizer-thumb {
  width: 4px;
  height: 56px;
  background: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.85), 0 0 22px rgba(56, 189, 248, 0.4);
}

#studio-split-resizer {
  display: none;
  cursor: col-resize;
  width: 10px;
  margin-left: -5px;
  margin-right: -5px;
  z-index: 40;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
  position: relative;
}

#studio-split-resizer.is-active {
  display: flex;
}

#studio-split-resizer:hover,
#studio-split-resizer.resizing {
  background: rgba(56, 189, 248, 0.08);
}

#studio-split-resizer .resizer-thumb {
  width: 2px;
  height: 32px;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.35);
  transition: all 0.2s var(--ease-smooth);
}

#studio-split-resizer:hover .resizer-thumb,
#studio-split-resizer.resizing .resizer-thumb {
  width: 3px;
  height: 48px;
  background: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
}

/* ========================================================
   MODEL SWITCHER POPUP - GUARANTEED SOLID & TOP-LAYER
   ======================================================== */
#model-dropdown-menu {
  background-color: #070d1e !important;
  opacity: 1 !important;
  isolation: isolate !important;
  z-index: 99999 !important;
  box-shadow: 0 25px 70px -10px rgba(0, 0, 0, 0.98), 0 0 0 1px rgba(56, 189, 248, 0.3) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#model-dropdown-menu * {
  opacity: 1;
}

#model-dropdown-menu button {
  background-color: #0c152e;
}

#model-dropdown-menu button:hover {
  background-color: #121e42 !important;
}

#model-dropdown-menu button.bg-blue-600\/20 {
  background-color: rgba(37, 99, 235, 0.35) !important;
}

/* ========================================================
   CHAT CONSOLE ANCHORING & PERSISTENT DOCKING
   ======================================================== */
#chat-view {
  min-height: 100vh;
  min-height: 100dvh;
}

#chat-main-column {
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
}

#chat-scroll-container {
  min-height: 0 !important;
  flex: 1 1 0% !important;
  scroll-behavior: auto !important;
  -webkit-overflow-scrolling: touch;
}

#chat-input-bar {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 30 !important;
  flex-shrink: 0 !important;
  width: 100% !important;
}

#main-chat-input {
  min-height: 44px !important;
  line-height: 1.5 !important;
  box-sizing: border-box !important;
}

