/* ═════════════════════════════════════════════════════════════════
   VYROX AI — CUSTOM CSS
   Animations, effets spéciaux, scrollbars et blocs de code
   Orinstudio © 2026-2029
   ═════════════════════════════════════════════════════════════════ */

/* ── Scrollbar personnalisée ───────────────────────────────────── */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #27272f;
  border-radius: 9999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #3f3f4e;
}

/* ── Toggle Switch ─────────────────────────────────────────────── */
.toggle-switch {
  appearance: none;
  width: 40px;
  height: 22px;
  background: #27272f;
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-switch::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}

.toggle-switch:checked {
  background: linear-gradient(135deg, #00d4ff, #a855f7);
}

.toggle-switch:checked::before {
  transform: translateX(18px);
}

/* ── Animations Keyframes ──────────────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.3); }
  50% { box-shadow: 0 0 40px rgba(168, 85, 247, 0.5); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-8px); opacity: 1; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── Message Bubbles ───────────────────────────────────────────── */
.message-bubble {
  animation: slideIn 0.3s ease-out;
}

.message-bubble strong {
  color: #00d4ff;
  font-weight: 600;
}

.message-bubble em {
  color: #a855f7;
  font-style: italic;
}

.message-bubble code {
  background: #1a1a25;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  color: #10b981;
  border: 1px solid #27272f;
}

/* ── BLOCS DE CODE ESTHÉTIQUES (NOUVEAU) ──────────────────────── */
.code-block-wrapper {
  position: relative;
  margin-top: 1rem;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  overflow: hidden;
  background-color: #0d1117;
  border: 1px solid #27272f;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: #161b22;
  border-bottom: 1px solid #27272f;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: #8b949e;
}

.code-block-pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  background-color: transparent !important;
  border: none !important;
}

.code-block-pre code {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.85rem !important;
  line-height: 1.6 !important;
  color: #c9d1d9 !important;
  background: none !important;
  padding: 0 !important;
  border: none !important;
}

.copy-code-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  background-color: transparent;
  border: 1px solid #30363d;
  color: #8b949e;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
}

.copy-code-btn:hover {
  background-color: #21262d;
  color: #e6edf3;
  border-color: #8b949e;
}

.copy-code-btn.copied {
  color: #3fb950;
  border-color: #3fb950;
}

/* Scrollbar spécifique aux blocs de code */
.code-block-pre::-webkit-scrollbar {
  height: 8px;
}
.code-block-pre::-webkit-scrollbar-track {
  background: #0d1117;
}
.code-block-pre::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 4px;
}
.code-block-pre::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}

/* ── Typing Indicator ──────────────────────────────────────────── */
.typing-dot {
  width: 8px;
  height: 8px;
  background: #00d4ff;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* ── Search Results ────────────────────────────────────────────── */
.search-result {
  background: #12121a;
  border-left: 3px solid #00d4ff;
  padding: 12px;
  border-radius: 0 12px 12px 0;
  transition: all 0.2s;
}

.search-result:hover {
  background: #1a1a25;
  transform: translateX(2px);
}

.search-result h4 {
  color: #00d4ff;
  margin-bottom: 4px;
  font-size: 0.95rem;
  font-weight: 600;
}

.search-result p {
  color: #9ca3af;
  font-size: 0.85rem;
  margin-bottom: 6px;
  line-height: 1.5;
}

.search-result a {
  color: #a855f7;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: color 0.2s;
}

.search-result a:hover {
  color: #00d4ff;
  text-decoration: underline;
}

/* ── Toast Notifications ───────────────────────────────────────── */
.toast {
  background: #12121a;
  border: 1px solid #27272f;
  border-radius: 12px;
  padding: 12px 16px;
  color: #e0e0e0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
}

.toast.success { border-left: 4px solid #10b981; }
.toast.error { border-left: 4px solid #ef4444; }
.toast.info { border-left: 4px solid #00d4ff; }

/* ── Gradient Text ─────────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, #00d4ff 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Glow Effects ──────────────────────────────────────────────── */
.glow-cyan {
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.glow-purple {
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

/* ── Image Result ──────────────────────────────────────────────── */
.image-result {
  margin-top: 1rem;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #27272f;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.image-result img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

/* ── Selection ─────────────────────────────────────────────────── */
::selection {
  background: rgba(0, 212, 255, 0.3);
  color: white;
}

/* ── Focus Visible ─────────────────────────────────────────────── */
*:focus-visible {
  outline: 2px solid #00d4ff;
  outline-offset: 2px;
}

/* ── Mobile Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 40;
    transform: translateX(-100%);
  }
  
  #sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 30;
  }
}

/* ── Reduced Motion ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Print Styles ──────────────────────────────────────────────── */
@media print {
  #sidebar, header, .input-area, button {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
}