/* =======================
   Farbvariablen
   ======================= */
   :root {
    --bg: #ffffff;
    --fg: #111111;
    --accent: #007aff;
    --card-bg: #ffffff;
    --sidebar-bg: #04426bf0;
  }
  
  [data-theme="dark"] {
    --bg: #121212;
    --fg: #e5e5e5;
    --accent: #00c8ff;
    --card-bg: #1e1e1e;
    --sidebar-bg: #1e1e1e;
  }
  
  /* =======================
     Grund-Layout
     ======================= */
  html, body {
    height: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    font-weight: 400;
    line-height: 1.6;
    font-family: 'IBM Plex Sans', sans-serif;
    scroll-behavior: smooth;
  }
  
  body {
    background-color: var(--bg);
    color: var(--fg);
    font-family: 'Inter', sans-serif;
  }
  
  h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.015em;
  }
  
  /* =======================
     Utility Tailwind Overrides
     ======================= */
  .bg-bg {
    background-color: var(--bg) !important;
  }
  .text-fg {
    color: var(--fg) !important;
  }
  .text-bg {
    color: var(--bg) !important;
  }
  .bg-card-bg {
    background-color: var(--card-bg) !important;
  }
  .text-accent {
    color: var(--accent) !important;
  }
  .bg-accent {
    background-color: var(--accent) !important;
  }
  .border-accent {
    border-color: var(--accent) !important;
  }
  .hover\:bg-accent:hover {
    background-color: var(--accent) !important;
  }
  .hover\:text-bg:hover {
    color: var(--bg) !important;
  }
  .hover\:text-accent:hover {
    color: var(--accent) !important;
  }
  .hover\:border-accent:hover {
    border-color: var(--accent) !important;
  }
  .transition-theme {
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
  }
  
  /* Dark Mode Specifics */
  [data-theme="dark"] .bg-card-bg {
    background-color: #000 !important;
  }
  [data-theme="dark"] .text-gray-700 {
    color: #cccccc95 !important;
  }
  [data-theme="dark"] .hover\:bg-blue-50:hover {
    background-color: #e0f2fe;
  }
  [data-theme="dark"] .hover\:text-dark:hover {
    color: #000 !important;
  }
  [data-theme="dark"] .hover\:bg-blue-100:hover {
    background-color: #2c3e50 !important;
  }
  
  [data-theme="light"] aside,
  [data-theme="dark"] aside {
    background-color: var(--sidebar-bg) !important;
    color: var(--fg) !important;
  }
  
  /* =======================
     Toggle Switch
     ======================= */
  input#theme-toggle:checked ~ .dot {
    transform: translateX(1.25rem);
  }
  input#theme-toggle:checked ~ .toggle-track {
    background-color: var(--accent);
  }
  
  /* =======================
     Responsive Layout & Sidebar
     ======================= */
  
  /* Mobile: Sidebar hidden by default */
  @media (max-width: 768px) {
    aside {
      position: fixed;
      top: 0;
      left: 0;
      width: 16rem;
      height: 100vh;
      background-color: var(--sidebar-bg);
      transform: translateX(-100%);
      transition: transform 0.3s ease-in-out;
      z-index: 50;
      overflow-y: auto;
    }
  
    aside.show {
      transform: translateX(0);
    }
  
    .ml-64 {
      margin-left: 0 !important;
    }
  
    .p-8 {
      padding: 1rem !important;
    }
  
    header .flex {
      flex-direction: column;
      align-items: flex-start;
      gap: 0.5rem;
    }
  
    h1 {
      font-size: 1.75rem;
    }
  
    h2 {
      font-size: 1.5rem;
    }
  
    h3 {
      font-size: 1.25rem;
    }
  
    .text-lg {
      font-size: 1rem !important;
    }
  
    .text-sm {
      font-size: 0.875rem !important;
    }
  
    .rounded-lg {
      border-radius: 0.5rem !important;
    }
  
    .max-w-4xl {
      max-width: 100% !important;
    }
  
    .container {
      padding-left: 1rem;
      padding-right: 1rem;
    }
  
    #theme-toggle {
      position: relative;
      top: 0.2rem;
    }
  
    main {
      padding: 1rem !important;
    }
  
    .flex.h-screen {
      flex-direction: column !important;
      height: auto !important;
      min-height: 100vh;
    }
  }
  
  /* Tablet & Desktop */
  @media (min-width: 769px) {
    aside {
      position: relative;
      width: 16rem;
      height: 100vh;
      padding: 1rem;
    }
  
    .flex.h-screen {
      flex-direction: row;
      height: 100vh;
    }
  
    main {
      padding: 2rem;
      flex: 1 1 auto;
      overflow-y: auto;
      min-height: 0;
    }
  }
  html {
    -webkit-text-size-adjust: 100%; /* Verhindert Zoom-Anpassung auf iOS */
  }
  body {
    max-width: 100vw;
    overflow-x: hidden;
  }
  aside {
    z-index: 50;
  }
  
  header {
    z-index: 40;
    position: relative;
  }
/* optional für saubere Ausrichtung im Header */
header {
  align-items: center;
}

/* Ergebnis-Text schöner setzen */
.result-copy-wrap { position: relative; }
.result-text { 
  font-size: 1.0625rem;       /* etwas größer als text-sm */
  line-height: 1.7; 
  text-align: justify; 
  text-justify: inter-word;
}
.result-text p, .result-text li { margin-bottom: 0.5rem; }

/* Kopieren-Button oben rechts */
.copy-btn {
  position: absolute; 
  top: 0.5rem; 
  right: 0.5rem;
  display: inline-flex; 
  align-items: center; 
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 0.375rem;
  background: #111827;        /* dunkel, wie ChatGPT */
  color: white;
  font-size: 0.85rem;
}
.copy-btn:hover { opacity: .9; }
.copy-icon {
  width: 16px; height: 16px; 
  border: 2px solid currentColor; 
  border-radius: 3px; 
  display: inline-block; 
  box-sizing: border-box;
  position: relative;
}
.copy-icon::after {
  content: ""; 
  position: absolute; 
  top: -3px; left: -3px;
  width: 16px; height: 16px; 
  border: 2px solid currentColor; 
  border-radius: 3px; 
  background: transparent;
}


/* ===== Farb-Variablen für Light/Dark ===== */
:root {
  --bg: #ffffff;
  --fg: #111111;
  --card-bg: #ffffff;
  --sidebar-bg: #f8f8f8;
  --border: #e5e7eb;      /* neutral-200 */
  --muted: #6b7280;       /* neutral-500 */
}

html.dark {
  --bg: #000000;
  --fg: #f5f5f5;
  --card-bg: #0b0b0b;
  --sidebar-bg: #111111;
  --border: rgba(255,255,255,0.2);
  --muted: #9ca3af;       /* neutral-400 */
}

/* ===== Anwendung auf Grundelemente ===== */
body {
  background-color: var(--bg);
  color: var(--fg);
}

/* Karten, Panels, Sektionen */
.bg-bg {
  background-color: var(--bg);
}
.bg-card-bg {
  background-color: var(--card-bg);
}
.bg-sidebar-bg {
  background-color: var(--sidebar-bg);
}

/* Textfarben */
.text-fg {
  color: var(--fg);
}
.text-muted {
  color: var(--muted);
}

/* Rahmen */
.border {
  border-color: var(--border);
}
/* Chrome/Edge/Safari Autofill neutralisieren */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: inherit;
  box-shadow: 0 0 0px 1000px currentColor inset;
  transition: background-color 99999s ease-in-out 0s;
}
html:not(.dark) input:-webkit-autofill {
  -webkit-text-fill-color: #000; /* Light: schwarz auf weiß */
}
html.dark input:-webkit-autofill {
  -webkit-text-fill-color: #fff; /* Dark: weiß auf schwarz */
}
