/* ================================================================
   F.R.A.G.O — Stylesheet | Cyberpunk Oracle Edition
   ================================================================ */

:root {
  --void: #020408;
  --cyan: #00f5ff;
  --purple: #b347ff;
  --pink: #ff2d9a;
  --cyan-dim: rgba(0, 245, 255, 0.12);
  --purple-dim: rgba(179, 71, 255, 0.12);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(0, 245, 255, 0.12);
  --glass-border-purple: rgba(179, 71, 255, 0.15);
}

/* ── Base ── */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--void);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0, 245, 255, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(179, 71, 255, 0.06) 0%, transparent 60%);
  min-height: 100vh;
}

/* ── Particle Canvas ── */
#particle-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ── Scanline Effect ── */
.scanline-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.05) 2px,
    rgba(0, 0, 0, 0.05) 4px
  );
  animation: scanlineMove 8s linear infinite;
}

@keyframes scanlineMove {
  0% { background-position: 0 0; }
  100% { background-position: 0 100px; }
}

/* ── Glow Text ── */
.glow-text-cyan {
  color: var(--cyan);
  text-shadow:
    0 0 10px rgba(0, 245, 255, 0.8),
    0 0 30px rgba(0, 245, 255, 0.4),
    0 0 60px rgba(0, 245, 255, 0.2);
}

.glow-text-purple {
  color: var(--purple);
  text-shadow:
    0 0 10px rgba(179, 71, 255, 0.8),
    0 0 30px rgba(179, 71, 255, 0.4),
    0 0 60px rgba(179, 71, 255, 0.2);
}

/* ── Oracle Orbs ── */
.oracle-orb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow:
    0 0 8px var(--cyan),
    0 0 20px var(--cyan),
    0 0 40px rgba(0, 245, 255, 0.5);
  animation: orbPulse 2s ease-in-out infinite;
}

.oracle-orb.orb-purple {
  background: var(--purple);
  box-shadow:
    0 0 8px var(--purple),
    0 0 20px var(--purple),
    0 0 40px rgba(179, 71, 255, 0.5);
  animation-delay: 1s;
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

/* ── Header Line ── */
.header-line {
  width: 280px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 8px var(--cyan);
}

/* ── Glass Panel ── */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 0 0 1px rgba(0, 245, 255, 0.04),
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
  border-color: rgba(0, 245, 255, 0.25);
  box-shadow:
    0 0 0 1px rgba(0, 245, 255, 0.08),
    0 8px 40px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(0, 245, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ── Tab Navigation ── */
.tab-btn {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.12em;
  overflow: hidden;
}

.tab-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.tab-btn:hover::before { opacity: 1; }

.tab-btn:hover {
  border-color: rgba(0, 245, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
}

.tab-btn.active {
  background: rgba(0, 245, 255, 0.06);
  border-color: rgba(0, 245, 255, 0.4);
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.6);
  box-shadow:
    0 0 15px rgba(0, 245, 255, 0.1),
    inset 0 0 15px rgba(0, 245, 255, 0.04);
}

#tab-image.active {
  background: rgba(179, 71, 255, 0.06);
  border-color: rgba(179, 71, 255, 0.4);
  color: var(--purple);
  text-shadow: 0 0 8px rgba(179, 71, 255, 0.6);
  box-shadow:
    0 0 15px rgba(179, 71, 255, 0.1),
    inset 0 0 15px rgba(179, 71, 255, 0.04);
}

.tab-icon {
  display: inline-block;
  margin-right: 6px;
  animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* ── Cyber Buttons ── */
.cyber-btn-primary {
  position: relative;
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.15), rgba(0, 245, 255, 0.05));
  border: 1px solid rgba(0, 245, 255, 0.5);
  color: var(--cyan);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.15em;
  overflow: hidden;
  min-width: 100px;
}

.cyber-btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 245, 255, 0.2), transparent);
  transition: left 0.4s ease;
}

.cyber-btn-primary:hover::before { left: 100%; }

.cyber-btn-primary:hover {
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.25), rgba(0, 245, 255, 0.1));
  border-color: var(--cyan);
  box-shadow:
    0 0 15px rgba(0, 245, 255, 0.3),
    0 0 30px rgba(0, 245, 255, 0.1),
    inset 0 0 10px rgba(0, 245, 255, 0.05);
  transform: translateY(-1px);
  text-shadow: 0 0 8px var(--cyan);
}

.cyber-btn-primary:active { transform: translateY(0); }

.cyber-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.cyber-btn-purple {
  position: relative;
  background: linear-gradient(135deg, rgba(179, 71, 255, 0.15), rgba(179, 71, 255, 0.05));
  border: 1px solid rgba(179, 71, 255, 0.5);
  color: var(--purple);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.15em;
  overflow: hidden;
  min-width: 110px;
}

.cyber-btn-purple::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(179, 71, 255, 0.2), transparent);
  transition: left 0.4s ease;
}

.cyber-btn-purple:hover::before { left: 100%; }

.cyber-btn-purple:hover {
  background: linear-gradient(135deg, rgba(179, 71, 255, 0.25), rgba(179, 71, 255, 0.1));
  border-color: var(--purple);
  box-shadow:
    0 0 15px rgba(179, 71, 255, 0.3),
    0 0 30px rgba(179, 71, 255, 0.1);
  transform: translateY(-1px);
  text-shadow: 0 0 8px var(--purple);
}

.cyber-btn-purple:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-loader {
  animation: loaderBlink 0.6s linear infinite;
  letter-spacing: 3px;
}

@keyframes loaderBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Chat Messages ── */
.chat-message {
  margin-bottom: 20px;
  animation: messageFadeIn 0.4s ease forwards;
}

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

.chat-message.user {
  display: flex;
  justify-content: flex-end;
}

.chat-message.user .bubble {
  background: rgba(0, 245, 255, 0.08);
  border: 1px solid rgba(0, 245, 255, 0.2);
  border-radius: 16px 16px 4px 16px;
  padding: 10px 16px;
  max-width: 75%;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

.chat-message.assistant .bubble {
  background: rgba(179, 71, 255, 0.05);
  border: 1px solid rgba(179, 71, 255, 0.15);
  border-radius: 4px 16px 16px 16px;
  padding: 14px 18px;
  max-width: 88%;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.8;
}

.msg-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  margin-bottom: 5px;
  opacity: 0.5;
}

.msg-label.oracle { color: var(--purple); }
.msg-label.user-label { color: var(--cyan); text-align: right; }

/* Typewriter Cursor */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--purple);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursorBlink 0.8s step-end infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  width: 100%;
}

.oracle-symbol {
  font-size: 3rem;
  color: var(--cyan);
  opacity: 0.2;
  animation: symbolPulse 3s ease-in-out infinite;
}

.oracle-symbol.image-symbol {
  color: var(--purple);
}

@keyframes symbolPulse {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(1.1); }
}

/* ── Holographic Scanner ── */
.holo-scanner {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid rgba(179, 71, 255, 0.4);
  box-shadow:
    0 0 20px rgba(179, 71, 255, 0.3),
    inset 0 0 20px rgba(179, 71, 255, 0.1);
  position: relative;
  animation: holoRotate 2s linear infinite;
}

.holo-scanner::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px solid rgba(179, 71, 255, 0.3);
  animation: holoRotate 1.5s linear infinite reverse;
}

.holo-scanner::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(179, 71, 255, 0.2);
  box-shadow: 0 0 15px rgba(179, 71, 255, 0.6);
  animation: orbPulse 1s ease-in-out infinite;
}

.scan-line-h {
  position: absolute;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--purple), transparent);
  box-shadow: 0 0 10px var(--purple);
  animation: scanH 2s linear infinite;
  margin-top: -61px;
}

@keyframes holoRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes scanH {
  0% { transform: translateY(-60px); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(60px); opacity: 0; }
}

/* ── Image Reveal ── */
.image-reveal {
  animation: imageReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes imageReveal {
  from {
    opacity: 0;
    transform: scale(0.95);
    filter: brightness(0) blur(20px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: brightness(1) blur(0);
  }
}

/* ── Panel Sections ── */
.panel-section { width: 100%; }
.panel-section.hidden { display: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0, 245, 255, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 245, 255, 0.4); }

/* ── Textarea Focus ── */
textarea:focus { outline: none; }

/* ── Credit Badge ── */
.credit-badge {
  background: rgba(2, 4, 8, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 245, 255, 0.1);
  border-radius: 20px;
  padding: 6px 18px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 10px;
  letter-spacing: 0.25em;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}

.credit-badge:hover {
  border-color: rgba(0, 245, 255, 0.25);
  color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 15px rgba(0, 245, 255, 0.08);
}

.credit-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  animation: orbPulse 2s ease-in-out infinite;
  display: inline-block;
}

/* ── Animations ── */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

/* ── Error Message ── */
.error-message {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--pink);
  padding: 10px 14px;
  border: 1px solid rgba(255, 45, 154, 0.3);
  border-radius: 8px;
  background: rgba(255, 45, 154, 0.05);
  margin-top: 8px;
}

/* ── Markdown-like styling in oracle response ── */
.oracle-response strong { color: var(--cyan); font-weight: 600; }
.oracle-response em { color: var(--purple); }
.oracle-response code {
  background: rgba(0, 245, 255, 0.08);
  border: 1px solid rgba(0, 245, 255, 0.15);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85em;
  color: var(--cyan);
  }
  
