/* === Pyonir Ultra-Dark Blue Theme === */
:root {
  --accent: #3b82f6;
  --accent-2: #1d4ed8;
  --accent-3: #0b1a43;
  --dark-bg: #020a18;
  --text-light: #f8fafc;
  --text-muted: #8fa0b8;
}

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

body {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, #000308 0%, #010713 45%, var(--dark-bg) 100%);
  min-height: 100vh;
  color: var(--text-light);
  overflow-x: hidden;
  position: relative;
}

/* === Chat Split-View & Visual Panel === */
#chat-split-container {
  width: 100%;
  height: 100%;
  display: flex;
  position: relative;
}

#chat-side {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: width 0.1s ease-out;
}

#visual-side {
  position: relative;
  background: rgba(2, 6, 23, 0.98);
  border-left: 1px solid rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(12px);
  transition: width 0.1s ease-out;
  overflow-y: auto;
}

#visual-content-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
  gap: 20px;
  min-height: 100%;
}

#chat-resizer {
  position: absolute;
  width: 4px;
  height: 100%;
  top: 0;
  cursor: col-resize;
  z-index: 1000;
  transition: background 0.2s ease;
}

#chat-resizer:hover {
  background: rgba(59, 130, 246, 0.5) !important;
}

#chat-resizer:active {
  background: rgba(59, 130, 246, 0.8) !important;
}

/* Stream spinner animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.chat-stream-spinner svg circle {
  animation: spin 1s linear infinite;
  transform-origin: center;
}

/* Responsive adjustments for split-view */
@media (max-width: 1280px) {
  #chat-split-container {
    flex-direction: column;
  }
  
  #chat-side {
    width: 100% !important;
    height: 50% !important;
  }
  
  #visual-side {
    width: 100% !important;
    height: 50% !important;
    border-left: none;
    border-top: 1px solid rgba(30, 41, 59, 0.4);
  }
  
  #chat-resizer {
    width: 100% !important;
    height: 4px !important;
    cursor: row-resize !important;
  }
}

/* Sternenhimmel Hintergrund */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.star {
  position: absolute;
  border-radius: 50%;
  animation: twinkle 4s ease-in-out infinite alternate;
  opacity: 0.5;
}

.star.small {
  width: 1px;
  height: 1px;
  background: #cbd5e1;
  box-shadow: 0 0 1px #cbd5e1;
  opacity: 0.25;
}

.star.medium {
  width: 2px;
  height: 2px;
  background: #2f66f0;
  box-shadow: 0 0 3px #2f66f0;
  opacity: 0.25;
}

.star.large {
  width: 3px;
  height: 3px;
  background: #e2e8f0;
  box-shadow: 0 0 5px #e2e8f0, 0 0 9px rgba(59, 130, 246, 0.25);
  opacity: 0.35;
}

@keyframes twinkle {
  0% { opacity: 0.2; transform: scale(0.9); }
  50% { opacity: 0.7; transform: scale(1); }
  100% { opacity: 0.3; transform: scale(0.95); }
}

/* Nebel-Effekt */
.nebula {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.02) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.015) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 80%, rgba(59, 130, 246, 0.012) 0%, transparent 50%);
}

/* Layout */
.page {
  display: none;
  min-height: 100vh;
  position: relative;
  z-index: 5;
}

.page.active {
  display: block;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 0.875rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(2, 6, 16, 0.92);
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
  backdrop-filter: blur(16px);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(10, 17, 35, 0.9), rgba(3, 8, 20, 0.9));
  border: 1px solid rgba(59, 130, 246, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 10px 24px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.logo-img {
  width: 68%;
  height: 68%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.35));
}

.brand-name {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text-light);
}

.auth-buttons {
  display: flex;
  gap: 0.6rem;
}

/* Buttons */
.btn {
  padding: 0.65rem 1.3rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.95rem;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid rgba(59, 130, 246, 0.55);
}

.btn-outline:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.22);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-3) 0%, var(--accent-2) 100%);
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 100%);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(59, 130, 246, 0.25);
}

/* Home Page */
.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 3rem 2rem;
  padding-top: 6rem; /* Platz für fixed Header */
}

.hero-logo {
  width: 100px;
  height: 100px;
  margin-bottom: 1.5rem;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 18px rgba(59, 130, 246, 0.28));
  animation: subtleFloat 6s ease-in-out infinite;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 300;
  margin-bottom: 0.8rem;
  letter-spacing: 6px;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.12);
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.cta-button {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #22d3ee 0%, #3b82f6 50%, #1d4ed8 100%) !important;
  border: 1.5px solid rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), 0 14px 36px rgba(37, 99, 235, 0.55), inset 0 -2px 0 rgba(255, 255, 255, 0.12);
  color: #fff;
  letter-spacing: 0.4px;
  padding: 0.9rem 2.2rem;
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cta-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18), 0 18px 48px rgba(37, 99, 235, 0.65), inset 0 -2px 0 rgba(255, 255, 255, 0.14);
  filter: saturate(1.1);
}

.cta-button:active {
  transform: translateY(0) scale(0.99);
}

/* Registration Section */
.registration-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  gap: clamp(8rem, 10vw, 12rem);
}

#register-section {
  scroll-margin-top: 80px;
}

.registration-content {
  flex: 1;
  max-width: 500px;
  margin-top: 0;
}

.registration-content h2 {
  font-size: 2.2rem;
  margin-bottom: 2rem;
  color: var(--text-light);
  font-weight: 300;
}

.registration-content p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.8rem;
  font-size: 1.1rem;
}

.features-list {
  list-style: none;
  margin-top: 3rem;
}

.features-list li {
  display: flex;
  align-items: center;
  margin-bottom: 1.2rem;
  color: var(--text-muted);
}

.features-list li::before {
  content: "✓";
  color: var(--accent);
  font-weight: bold;
  margin-right: 0.75rem;
  font-size: 1.2rem;
}

.registration-form {
  flex: 0 0 420px;
  background: linear-gradient(145deg, #091225, #050c1a);
  padding: 2.5rem;
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.22);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.55);
  margin-top: 0;
}

.registration-form h3 {
  text-align: center;
  margin-bottom: 2rem;
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--text-light);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: linear-gradient(145deg, #091225, #050c1a);
  padding: 2.5rem;
  border-radius: 16px;
  width: 90%;
  max-width: 420px;
  border: 1px solid rgba(59, 130, 246, 0.22);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.55);
  position: relative;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #7c8da4;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.3s;
  background: none;
  border: none;
}

.close-modal:hover {
  color: var(--accent);
}

.modal-content h3 {
  text-align: center;
  margin-bottom: 2rem;
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--text-light);
}

.form-group {
  margin-bottom: 1.4rem;
}

.form-group label {
  display: block;
  color: #9fb0c9;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 0.85rem;
  background: rgba(6, 12, 24, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  transition: all 0.25s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: rgba(6, 12, 24, 1);
}

.form-submit {
  width: 100%;
  margin-top: 1rem;
}

.form-switch {
  text-align: center;
  margin-top: 1.3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-switch a {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
}

.form-switch a:hover {
  text-decoration: underline;
}

.error-message {
  color: #ef4444;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: none;
}

.success-message {
  color: #10b981;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: none;
}

/* App Page Styles */
.app-container {
  padding: 100px 2rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.app-header h2 {
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--text-light);
}

.app-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.dashboard-card {
  background: linear-gradient(145deg, #091225, #050c1a);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.22);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.dashboard-card h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--text-light);
}

.dashboard-card p {
  color: var(--text-muted);
  line-height: 1.6;
}

/* Animations */
@keyframes subtleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

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

.spinner {
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 3px solid var(--accent);
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-right: 10px;
  vertical-align: middle;
}

/* Responsive Design */
@media (max-width: 968px) {
  .registration-section {
    flex-direction: column;
    min-height: auto;
    padding: 6rem 1.5rem 3rem;
    gap: 5rem;
  }

  .registration-form {
    flex: 1;
    width: 100%;
    max-width: 500px;
    margin-top: 0;
  }

  .registration-content {
    max-width: 100%;
    margin-top: 0;
  }
}

@media (max-width: 768px) {
  header {
    padding: 0.8rem 1rem;
  }

  .logo-badge {
    width: 34px;
    height: 34px;
  }

  .brand-name {
    font-size: 1.1rem;
  }

  .hero-title {
    font-size: 2.2rem;
    letter-spacing: 4px;
  }

  .hero-subtitle {
    font-size: 0.85rem;
    letter-spacing: 1px;
  }

  .hero-logo {
    width: 80px;
    height: 80px;
  }

  .auth-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn {
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
  }

  .registration-content h2 {
    font-size: 1.8rem;
  }

  .registration-form,
  .modal-content {
    padding: 2rem;
  }

  .registration-section {
    gap: 4rem;
    padding: 6rem 1.5rem 2rem;
  }

  .app-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .app-content {
    grid-template-columns: 1fr;
  }
}


#app-page ~ .nebula,
#app-page ~ .stars {
  display: none;
}

#app-page ~ header {
  display: none;
}

.app-container {
  padding: 0;
  max-width: none;
}

/* Entfernen Sie den Hintergrund-Gradienten für die App-Seite */
#app-page {
  background: var(--dark-bg);
}


/* === FUTURISTIC APP STYLES === */

/* Ultra Blurry Background */
.ultra-blurry-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: radial-gradient(ellipse at top, #0f172a 0%, #020617 70%);
}

.bg-orbs {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(400px);
  animation: float-minimal 120s ease-in-out infinite;
}

.orb-1 {
  width: 1200px;
  height: 1200px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.02) 0%, transparent 90%);
  top: -40%;
  left: -40%;
  animation-delay: 0s;
}

.orb-2 {
  width: 1000px;
  height: 1000px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.015) 0%, transparent 90%);
  top: 30%;
  right: -35%;
  animation-delay: 40s;
}

.orb-3 {
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.01) 0%, transparent 90%);
  bottom: -10%;
  left: 20%;
  animation-delay: 80s;
}

.bg-noise {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.01) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.008) 0%, transparent 60%),
    radial-gradient(ellipse at 40% 80%, rgba(34, 211, 238, 0.005) 0%, transparent 60%);
}

@keyframes float-minimal {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(10px, -10px) rotate(15deg); }
}

/* App Layout Override */
#app-page .app-container {
  display: flex;
  height: 100vh;
  background: transparent;
  position: relative;
  z-index: 10;
  padding: 0;
  max-width: none;
}

/* Modern font for app */
#app-page * {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Sidebar */
.app-sidebar {
  width: 280px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(59, 130, 246, 0.1);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 20;
}

.app-sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg,
    rgba(59, 130, 246, 0.02) 0%,
    transparent 50%,
    rgba(139, 92, 246, 0.02) 100%);
  pointer-events: none;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.08);
  position: relative;
  z-index: 2;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  z-index: 2;
}

.nav-item {
  position: relative;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 12px;
  overflow: hidden;
}

.nav-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 12px;
}

.nav-item.active .nav-glow {
  opacity: 1;
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.25);
}

.nav-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-item:hover .nav-content {
  color: white;
  transform: translateX(4px);
}

.nav-item:hover .nav-glow {
  opacity: 0.7;
}

.nav-item.active .nav-content {
  color: white;
  transform: translateX(4px);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

/* Main Content */
.app-main {
  flex: 1;
  overflow-y: auto;
  background: transparent;
  position: relative;
  z-index: 15;
}

.tab-content {
  display: none;
  height: 100%;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
}

/* Chat Styles */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 2rem;
  justify-content: center;
  width: 100%;
}

/* Smooth transition for chat messages when visual panel opens */
#chat-messages {
  transition: margin-right 0.3s ease;
}

.chat-header {
  text-align: center;
  margin-bottom: 3rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.white-title {
  font-size: 2.75rem;
  font-weight: 300;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: white;
}

.chat-input-container {
  display: flex;
  justify-content: center;
  width: 750px !important;
  max-width: 750px !important;
  margin: 0 auto;
}

/* Chat Input Wrapper - ausgewogene Breite */
.chat-input-wrapper {
  position: relative;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 0.875rem;
  display: flex;
  align-items: flex-end;
  gap: 0.875rem;
  transition: all 0.3s ease;
  width: 750px !important;
  max-width: 750px !important; /* Ausgewogene Breite */
  box-sizing: border-box !important;
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  font-size: 1rem;
  resize: none;
  outline: none;
  min-height: 32px;
  max-height: 120px;
  font-family: inherit;
  line-height: 1.5;
  padding: 0.5rem 0;
}

.chat-input::placeholder {
  color: #64748b;
  font-size: 1rem;
}

#app-page .btn-primary {
  position: relative;
  overflow: hidden;
  padding: 0.75rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

#app-page .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.send-button svg {
  transition: transform 0.3s ease;
}

#app-page .btn-primary:hover svg {
  transform: translateY(-2px);
}

/* Agents Styles */
.agents-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.agents-header {
  padding: 2rem 2rem 0;
}

.agents-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  gap: 2rem;
}

.empty-icon-container {
  position: relative;
}

.empty-icon {
  position: relative;
  color: var(--accent);
  opacity: 0.8;
}

.icon-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
  filter: blur(20px);
  animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.empty-title {
  font-size: 2rem;
  font-weight: 500;
  color: white;
  margin: 0;
}

.highlight {
  color: white;
}

.empty-description {
  color: #94a3b8;
  font-size: 1.1rem;
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .app-sidebar {
    width: 240px;
  }

    .white-title {
        font-size: 3rem;
        font-weight: 300;
        margin: 0;
        letter-spacing: -0.02em;
        line-height: 1.2;
        color: white;
        max-width: 1400px; /* Stelle sicher, dass die Überschrift schmaler bleibt */
        margin-left: auto;
        margin-right: auto;
    }

    .chat-container {
      display: flex;
      flex-direction: column;
      height: 100%;
      max-width: 1200px; /* Erhöht von 1000px */
      margin: 0 auto;
      padding: 0 2rem;
      justify-content: center;
    }

  .agents-header {
    padding: 1.5rem 1rem 0;
  }

  .agents-empty {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 640px) {
  #app-page .app-container {
    flex-direction: column;
  }

  .app-sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
  }

  .sidebar-header {
    border-bottom: none;
    border-right: 1px solid rgba(59, 130, 246, 0.08);
  }

  .sidebar-nav {
    flex-direction: row;
    padding: 1rem;
    gap: 0.5rem;
    overflow-x: auto;
  }

  .nav-item {
    white-space: nowrap;
    min-width: 140px;
  }

  .white-title {
    font-size: 2rem;
  }
}

/* === Chat: runde Icon-Buttons (Send + Attachment) === */
.chat-input-wrapper .icon-button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0 !important;          /* überschreibt btn-Defaults */
  border-radius: 9999px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-input-wrapper .icon-button svg {
  width: 18px;
  height: 18px;
}

/* Send-Button bleibt primary, aber rund */
#app-page .send-button {
  border-radius: 9999px !important;
}

/* Attachment-Button: dezente Outline-Variante */
#app-page .attach-button {
  background: transparent;
  border: 1.5px solid #334155;     /* Slate-Outline, passend zum Input */
  color: #cbd5e1;
}

#app-page .attach-button:hover {
  background: rgba(51, 65, 85, 0.25);
  border-color: #475569;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.20);
}


/* Profile Section Styles */
.sidebar-profile {
  margin-top: auto;
  padding: 1rem;
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(59, 130, 246, 0.08);
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.3s ease;
}

.profile-button:hover {
  background: rgba(59, 130, 246, 0.1);
  color: white;
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-text {
  flex: 1;
  text-align: left;
  font-weight: 500;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-chevron {
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.profile-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 1rem;
  right: 1rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: none;
  z-index: 1000;
}

.profile-menu.active {
  display: block;
  animation: fadeInUp 0.2s ease;
}

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

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.profile-menu-item:hover {
  background: rgba(59, 130, 246, 0.15);
}

.profile-menu-item svg {
  opacity: 0.8;
  flex-shrink: 0;
}

.profile-menu-divider {
  height: 1px;
  background: rgba(59, 130, 246, 0.1);
  margin: 0.25rem 0;
}

.logout-item {
  color: #ef4444 !important;
}

.logout-item:hover {
  background: rgba(239, 68, 68, 0.1) !important;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .sidebar-profile {
    border-top: none;
    border-right: 1px solid rgba(59, 130, 246, 0.08);
    padding: 0.5rem;
  }

  .profile-button {
    justify-content: center;
    padding: 0.5rem;
  }

  .profile-text {
    display: none;
  }

  .profile-chevron {
    display: none;
  }

  .profile-menu {
    left: 0.5rem;
    right: 0.5rem;
    bottom: 100%;
  }
}

/* --- App: Logo ohne Badge auf fixe Höhe setzen --- */
#app-page .app-sidebar .logo-container .logo-img {
  height: 28px !important;
  width: auto !important;
  display: block;
}

#app-page .app-sidebar .logo-container {
  align-items: center;
  gap: 0.6rem;
}

#app-page .app-sidebar .brand-name {
  line-height: 1;
}

/* --- Collapsible Sidebar --- */
#app-page .app-sidebar { transition: width .25s ease; }

/* Breite im eingeklappten Zustand */
#app-page .app-sidebar.is-collapsed { width: 80px; }

/* Texte im Collapsed-Zustand verstecken */
#app-page .app-sidebar.is-collapsed .brand-name,
#app-page .app-sidebar.is-collapsed .nav-text,
#app-page .app-sidebar.is-collapsed .profile-text,
#app-page .app-sidebar.is-collapsed .profile-chevron { display: none !important; }

/* Header & Toggle-Button */
#app-page .app-sidebar .sidebar-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between; /* Logo links, Button rechts */
}

#app-page .app-sidebar .sidebar-toggle {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(10,17,35,.9), rgba(3,8,20,.9));
  border: 1px solid rgba(59,130,246,.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02), 0 10px 24px rgba(0,0,0,.45);
  cursor: pointer;
  transition: left .25s ease, right .25s ease, transform .25s ease, opacity .25s ease;
  z-index: 5; /* über Logo */
}

#app-page .app-sidebar .sidebar-toggle svg {
  transition: transform .25s ease;
}

/* WENN eingeklappt & hover auf Sidebar => Button deckt das Logo */
#app-page .app-sidebar.is-collapsed:hover .sidebar-toggle {
  right: auto;          /* nicht mehr rechts kleben */
  left: 1.5rem;         /* auf Logo-Position schieben */
}

/* Icons mittig, wenn Text wegfällt */
#app-page .app-sidebar.is-collapsed .sidebar-nav { align-items: center; }
#app-page .app-sidebar.is-collapsed .nav-content { justify-content: center; }
#app-page .app-sidebar.is-collapsed .nav-item .nav-content { padding: .875rem; }

/* (Optional) Logo-Größe konsistent halten */
#app-page .app-sidebar .logo-container .logo-img {
  height: 28px;
  width: auto;
  display: block;
}

/* ===================== WORKFLOW NODE CONNECTIONS ===================== */

/* Node connections */
.node-connections {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.node-input, .node-output {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--dark-bg);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  pointer-events: auto;
}

.node-input {
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  background: white !important;
  border: 2px solid var(--dark-bg);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  pointer-events: auto;
}

.node-output {
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  background: white !important;
  border: 2px solid var(--dark-bg);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  pointer-events: auto;
}

.node-input:hover, .node-output:hover {
  background: var(--accent-2);
  transform: translateY(-50%) scale(1.2);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.node-input.hover-target {
  background: var(--accent) !important;
  transform: translateY(-50%) scale(1.3);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.8);
  animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { box-shadow: 0 0 12px rgba(59, 130, 246, 0.8); }
  to { box-shadow: 0 0 20px rgba(59, 130, 246, 1); }
}

/* Modern connection lines */
.connection-line {
  position: absolute;
  pointer-events: none;
  z-index: 2;
}

.connection-line svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.connection-line path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.3));
  transition: all 0.3s ease;
}

.connection-line:hover path {
  stroke: var(--accent-2);
  stroke-width: 3;
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.6));
}

/* Connection animation */
.connection-line.connecting path {
  stroke-dasharray: 5, 5;
  animation: dash 1s linear infinite;
}

@keyframes dash {
  to {
    stroke-dashoffset: -10;
  }
}

/* Connection points */
.connection-point {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--dark-bg);
  z-index: 3;
  transition: all 0.2s ease;
}

.connection-point:hover {
  background: var(--accent-2);
  transform: scale(1.3);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
}