/* ============================================================
   INNER SIGHT 2.0 — Modern Dark Design System
   Author: Fabian Kindermann (Optimized Build)
   ============================================================ */

/* Theme Root Variables */
:root {
  /* dummy declaration to satisfy cPanel lint */
  color-scheme: dark;

  /* Core Colors */
  --bg: #0e0e0e;
  --fg: #e6e6e6;
  --muted: #a0a0a0;
  --accent: #2ecc71;
  --danger: #e74c3c;

  /* Panels & effects */
  --panel: #181818;
  --glass: rgba(255, 255, 255, 0.03);

  /* Visual design constants */
  --blur: 14px;
  --radius: 14px;
  --transition: 0.25s ease;
}


*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font: 16px/1.6 'Inter', system-ui, sans-serif;
  color: var(--fg);
  background: var(--bg);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  width: 100%;
  max-width: 880px;
  padding: 20px;
}

h1 {
  font-size: 2.6rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.sub {
  color: var(--muted);
  margin-bottom: 1.6rem;
}

/* ============================================================
   Canvas Stage
   ============================================================ */

.stage {
  position: relative;
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.4);
  animation: fadeIn 1.5s ease forwards;
}

#fragmentCanvas {
  width: 100%;
  display: block;
  border-radius: var(--radius);
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 2s ease, transform 10s ease-out;
}

#fragmentCanvas.loaded {
  opacity: 1;
  transform: scale(1);
}

/* ============================================================
   Input + Textareas
   ============================================================ */

.inputs {
  background: var(--glass);
  border: 1px solid #222;
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(var(--blur));
  margin-bottom: 24px;
  transition: background var(--transition);
}

.inputs:hover {
  background: rgba(255, 255, 255, 0.05);
}

label {
  display: block;
  font-size: 0.95rem;
  color: var(--muted);
  margin: 10px 0 6px;
}

textarea {
  width: 100%;
  padding: 12px;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: var(--radius);
  color: var(--fg);
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  transition: border var(--transition), background var(--transition);
}

textarea:focus {
  border-color: var(--accent);
  background: #181818;
  outline: none;
}

/* ============================================================
   Emotion Buttons
   ============================================================ */

.emotions {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.emotions button {
  width: 44px;
  height: 44px;
  font-size: 22px;
  border-radius: 50%;
  background: #202020;
  border: 1px solid #2e2e2e;
  cursor: pointer;
  transition: all 0.2s ease;
}

.emotions button:hover {
  transform: scale(1.1);
  background: #252525;
}

.emotions button.active {
  transform: scale(1.2);
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

/* ============================================================
   Audio Controls
   ============================================================ */

.audio {
  margin-top: 16px;
}

.audio .row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.audio button {
  background: #222;
  color: var(--fg);
  border: 1px solid #333;
  border-radius: var(--radius);
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--transition);
}

.audio button:hover {
  background: var(--accent);
  color: #000;
}

audio {
  width: 100%;
  margin-top: 8px;
  border-radius: 8px;
}

/* ============================================================
   Action Buttons
   ============================================================ */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

button, .btn {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

button:hover, .btn:hover {
  transform: scale(1.05);
  background: #38ff9d;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid #2a2a2a;
}

button.ghost:hover {
  border-color: var(--accent);
}

button.danger {
  color: var(--danger);
  border-color: var(--danger);
}

button.danger:hover {
  background: var(--danger);
  color: #fff;
}

/* ============================================================
   Timeline
   ============================================================ */

.timeline-section {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 20px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.3);
}

#timelineCanvas {
  width: 100%;
  height: 20px;
  border-radius: var(--radius);
  animation: fadeIn 1.2s ease forwards;
}

/* ============================================================
   Log (Entries)
   ============================================================ */

.log .entry {
  background: var(--panel);
  border-radius: var(--radius);
  margin-bottom: 14px;
  padding: 14px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.log .entry:hover {
  transform: scale(1.01);
}

.log img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 8px;
}

/* ============================================================
   Footer
   ============================================================ */

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 32px;
}

footer .fine {
  color: #777;
  margin-top: 6px;
}

/* ============================================================
   Responsive Adjustments
   ============================================================ */

@media (max-width: 640px) {
  h1 { font-size: 2rem; }
  .inputs, .timeline-section { padding: 14px; }
  .emotions button { width: 38px; height: 38px; font-size: 20px; }
  button { padding: 8px 14px; }
}

/* Emotion bar */
#emotionBar {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 1.5rem;
}

#emotionBar button {
  font-size: 1.4rem;
  background: transparent;
  border: none;
  transition: transform 0.2s ease, filter 0.2s ease;
}

#emotionBar button.active {
  transform: scale(1.3);
  filter: drop-shadow(0 0 6px var(--accent));
}

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

/* Entry card */
.entry {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  animation: fadeIn 0.8s ease forwards;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.3);
}

@keyframes slowDrift {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.03) translate(-1%, -1%); }
  100% { transform: scale(1) translate(0, 0); }
}

#fragmentCanvas.loaded {
  animation: slowDrift 20s ease-in-out infinite;
}


/* === Ambient Background === */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1; /* <— unter main, aber über body */
  background: radial-gradient(circle at center, #0e0e0e 0%, #000 100%);
  filter: blur(60px);
  opacity: 0.35;
  transition: opacity 2s ease;
  pointer-events: none;
}

/* Stelle sicher, dass dein Hauptinhalt darüber liegt */
body {
  position: relative;
  z-index: 0; /* body ist Basis */
}

main,
.container,
.stage,
#fragmentCanvas,
header,
footer {
  position: relative;
  z-index: 5; /* Inhalt sicher über Ambient */
}

/* Notfall: falls Canvas trotzdem blockiert */
#fragmentCanvas {
  mix-blend-mode: normal;
}

#fragmentCanvas.loaded {
  opacity: 1 !important;
  transform: scale(1) !important;
  z-index: 5;
}
