:root {
  --bg: #0b1020;
  --panel: #121a33;
  --panel-2: #0f1630;
  --text: #e6e9f2;
  --text-secondary: #a9b1c7;
  --text-muted: #a9b1c7;
  --muted: #a9b1c7;
  --primary: #5b8cff;
  --primary-600: #3b6ef0;
  --accent: #1dd1a1;
  --danger: #ff6b6b;
  --border: #263053;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg), #080d1a 60%);
  color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(6px);
  background: rgba(8, 13, 26, 0.7);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { font-size: 20px; }
.brand h1 { font-size: 16px; margin: 0; font-weight: 600; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 120ms ease-out;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn-primary { background: linear-gradient(180deg, var(--primary), var(--primary-600)); border-color: transparent; color: white; }
.btn-secondary { background: var(--panel-2); }
.btn-ghost { background: transparent; }

.app-main { padding: 16px; max-width: 1300px; margin: 0 auto; }

.hint {
  border: 1px dashed var(--border);
  background: rgba(18, 26, 51, 0.5);
  color: var(--muted);
  padding: 18px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.card {
  background: linear-gradient(180deg, rgba(18, 26, 51, 0.8), rgba(13, 20, 39, 0.8));
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.card-head .title { font-weight: 600; color: var(--muted); font-size: 12px; }

.thumb {
  background: #0a0f20;
  display: grid;
  place-items: center;
  padding: 10px;
  min-height: 240px;
}

.thumb canvas {
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: white;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
}

.actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,0.06); }
.icon-btn.danger { border-color: rgba(255,107,107,0.45); color: #ffd2d2; }

.dragging { opacity: 0.6; }
.drop-target { outline: 2px dashed var(--accent); outline-offset: -6px; }

.empty { opacity: 0.8; text-align: center; grid-column: 1/-1; padding: 32px 12px; }

/* Modal / Editor */
.modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,0.6); }
.hidden { display: none; }
.modal-content {
  width: min(96vw, 1200px);
  height: min(92vh, 900px);
  background: #0c1226;
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: #0e1630;
}
.tools { display: flex; gap: 6px; }
.tool-btn {
  background: #131c3b; color: var(--text); border: 1px solid var(--border);
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.tool-btn.active { outline: 2px solid var(--accent); }
.text-input { width: 220px; padding: 8px; border-radius: 8px; border: 1px solid var(--border); background: #0a1126; color: var(--text); }
.spacer { flex: 1; }

  .editor-canvas-wrap {
    position: relative; 
    flex: 1; 
    display: grid; 
    place-items: center; 
    background: #090e1e;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
  }

.editor-canvas-wrap.grabbing {
  cursor: grabbing;
}

.editor-canvas-container {
  position: relative;
  transform-origin: 0 0;
  transition: transform 0.1s ease-out;
}

#editorCanvas, #editorOverlay { 
  max-width: none; 
  max-height: none; 
  display: block;
}

#editorCanvas { 
  background: white; 
  border-radius: 6px; 
}

#editorOverlay { 
  position: absolute; 
  top: 0; 
  left: 0; 
  pointer-events: none; 
}

/* Zoom Controls */
.zoom-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 100;
}

.zoom-btn {
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.zoom-btn:hover {
  background: rgba(0,0,0,0.9);
}

.zoom-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.zoom-level {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 100;
}

/* Erweiterte Bild- und Signatur-Elemente */
.editable-element {
  position: absolute;
  cursor: move;
  user-select: none;
  transform-origin: center;
}

.editable-element.selected {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

.editable-element img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Kontrollpunkte für Resize, Rotate, Delete */
.control-point {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #007bff;
  border: 2px solid white;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
}

.control-point:hover {
  transform: scale(1.2);
  background: #0056b3;
}

.control-point.resize {
  bottom: -6px;
  right: -6px;
  cursor: nw-resize;
}

.control-point.rotate {
  top: -6px;
  right: -6px;
  cursor: crosshair;
}

.control-point.delete {
  top: -6px;
  left: -6px;
  cursor: pointer;
  background: #dc3545;
}

.control-point.delete:hover {
  background: #c82333;
}

/* Rotationslinie */
.rotation-line {
  position: absolute;
  top: -20px;
  right: 0;
  width: 2px;
  height: 20px;
  background: #007bff;
  transform-origin: bottom;
}

/* Signatur-Einstellungen */
.signature-settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.signature-settings h4 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 14px;
}

.color-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.color-option label {
  font-size: 12px;
  color: var(--text);
  min-width: 80px;
}

.color-input {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  background: var(--panel-2);
}

.background-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.background-option label {
  font-size: 12px;
  color: var(--text);
  min-width: 80px;
}

.background-input {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  background: var(--panel-2);
}

.transparency-slider {
  width: 100px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.transparency-slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background: #007bff;
  border-radius: 50%;
  cursor: pointer;
}

.transparency-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #007bff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Text-Einstellungen */
.text-settings {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.text-settings h4 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 14px;
}

.text-color-option {
  display: flex;
  align-items: center;
  gap: 10px;
}

.text-color-option label {
  font-size: 12px;
  color: #555;
  min-width: 80px;
}

.text-color-input {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* Bild-Einstellungen */
.image-settings {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.image-settings h4 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 14px;
}

.image-opacity-option {
  display: flex;
  align-items: center;
  gap: 10px;
}

.image-opacity-option label {
  font-size: 12px;
  color: #555;
  min-width: 80px;
}

.image-opacity-slider {
  width: 100px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.image-opacity-slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background: #007bff;
  border-radius: 50%;
  cursor: pointer;
}

.image-opacity-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #007bff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Toolbar Erweiterungen */
.tool-opts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tool-opts .color-input {
  width: 40px;
  height: 30px;
}

.tool-opts .size-input {
  width: 60px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #0a1126;
  color: var(--text);
}

/* Editierbare Elemente */
.editable-element {
  position: absolute;
  border: 2px dashed #007bff;
  background: rgba(0, 123, 255, 0.1);
  pointer-events: auto;
  cursor: move;
  transition: border-color 0.2s ease;
}

.editable-element:hover {
  border-color: #0056b3;
  background: rgba(0, 123, 255, 0.2);
}

.control-point {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #007bff;
  border: 2px solid white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  cursor: pointer;
  z-index: 1002;
  transition: background-color 0.2s ease;
}

.control-point:hover {
  background: #0056b3;
}

.control-point.resize {
  bottom: -10px;
  right: -10px;
  cursor: nw-resize;
}

.control-point.rotate {
  top: -10px;
  right: -10px;
  cursor: pointer;
}

.control-point.delete {
  top: -10px;
  left: -10px;
  cursor: pointer;
  background: #dc3545;
}

.control-point.delete:hover {
  background: #c82333;
}

/* Signatur-Modal Styles */
.signature-pad-container {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  max-width: 700px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}

.signature-pad-title {
  margin: 0 0 20px 0;
  color: var(--text);
  font-size: 18px;
  text-align: center;
}

.signature-pad {
  width: 100%;
  height: 200px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: crosshair;
  margin: 15px 0;
}

.signature-pad-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 15px;
}

.signature-pad-button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.signature-pad-button.primary {
  background: var(--primary);
  color: white;
  border: 1px solid var(--primary-600);
}

.signature-pad-button.primary:hover {
  background: var(--primary-600);
}

.signature-pad-button.secondary {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.signature-pad-button.secondary:hover {
  background: var(--panel);
}

.signature-pad-button.clear {
  background: var(--danger);
  color: white;
  border: 1px solid var(--danger);
}

.signature-pad-button.clear:hover {
  background: #ff5252;
}

/* Joystick für Pan-Steuerung */
/* Footer */
.app-footer {
  margin-top: 2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

/* Responsive Design */
@media (max-width: 768px) {
  /* Body und HTML für mobile Geräte optimieren */
  html, body {
    height: 100vh;
    overflow-x: hidden;
    position: fixed;
    width: 100%;
  }
  
  /* Header Anpassungen - Kompakter */
  .app-header {
    padding: 4px 8px;
    flex-wrap: wrap;
    gap: 4px;
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: auto;
  }
  
  .brand h1 {
    font-size: 12px;
  }
  
  .brand .logo {
    font-size: 14px;
  }
  
  /* Toolbar Anpassungen - Sehr kompakt */
  .toolbar {
    gap: 3px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    margin-top: 4px;
  }
  
  .btn {
    padding: 4px 6px;
    font-size: 10px;
    border-radius: 6px;
    min-width: auto;
    min-height: 28px;
  }
  
  /* Hauptbereich Anpassungen */
  .app-main {
    padding: 8px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .hint {
    padding: 12px;
    font-size: 13px;
    margin-bottom: 12px;
  }
  
  /* Grid Anpassungen */
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
  
  .card {
    border-radius: 10px;
  }
  
  .thumb {
    min-height: 180px;
    padding: 8px;
  }
  
  .card-head {
    padding: 6px 8px;
  }
  
  .card-head .title {
    font-size: 11px;
  }
  
  .card-footer {
    padding: 6px 8px;
  }
  
  .icon-btn {
    padding: 4px 6px;
    font-size: 12px;
  }
  
  /* Modal/Editor Anpassungen */
  .modal-content {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    position: fixed;
    top: 0;
    left: 0;
  }
  
  .editor-toolbar {
    padding: 4px 6px;
    flex-wrap: wrap;
    gap: 3px;
    max-height: 60px;
    overflow-y: auto;
  }
  
  .tools {
    gap: 2px;
    flex-wrap: wrap;
  }
  
  .tool-btn {
    padding: 4px 6px;
    font-size: 10px;
    border-radius: 4px;
    min-height: 32px;
    min-width: 32px;
  }
  
  .text-input {
    width: 100%;
    max-width: 150px;
    padding: 4px;
    font-size: 11px;
    min-height: 28px;
  }
  
  .tool-opts {
    flex-direction: row;
    align-items: center;
    gap: 3px;
    width: auto;
    flex-wrap: wrap;
  }
  
  .tool-opts .color-input {
    width: 30px;
    height: 28px;
  }
  
  .tool-opts .size-input {
    width: 45px;
    padding: 3px;
    font-size: 11px;
    min-height: 28px;
  }
  
  /* Zoom Controls */
  .zoom-controls {
    top: 5px;
    right: 5px;
  }
  
  .zoom-btn {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
  
  .zoom-level {
    top: 5px;
    left: 5px;
    font-size: 11px;
    padding: 3px 8px;
  }
  
  /* Editierbare Elemente */
  .control-point {
    width: 10px;
    height: 10px;
  }
  
  /* Signatur-Modal */
  .signature-pad-container {
    width: 95vw;
    padding: 15px;
    max-height: 90vh;
  }
  
  .signature-pad {
    height: 150px;
  }
  
  .signature-pad-buttons {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .signature-pad-button {
    padding: 8px 16px;
    font-size: 13px;
  }
  
  /* Joystick */
  .joystick-container {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }
  
  .joystick-base {
    width: 60px;
    height: 60px;
    background: var(--panel-2);
    border: 2px solid var(--border);
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  
  .joystick-stick {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border: 2px solid var(--primary-600);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    transition: transform 0.1s ease;
  }
  
  .joystick-stick:active {
    cursor: grabbing;
  }
  
  /* Footer Anpassungen */
  .app-footer {
    margin-top: 1.5rem;
    padding: 0.8rem 0;
  }
  
  .footer-links {
    gap: 1.5rem;
    flex-direction: column;
    align-items: center;
  }
  
  .footer-links a {
    font-size: 0.85rem;
  }
}

/* Kleine Mobile Geräte (Smartphones) */
@media (max-width: 480px) {
  /* Body und HTML für sehr kleine Geräte */
  html, body {
    height: 100vh;
    overflow-x: hidden;
    position: fixed;
    width: 100%;
  }
  
  .app-header {
    padding: 2px 4px;
    flex-direction: column;
    align-items: stretch;
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: auto;
  }
  
  .brand {
    justify-content: center;
    margin-bottom: 2px;
  }
  
  .brand h1 {
    font-size: 11px;
  }
  
  .brand .logo {
    font-size: 12px;
  }
  
  .toolbar {
    justify-content: center;
    gap: 2px;
    margin-top: 2px;
  }
  
  .btn {
    padding: 3px 5px;
    font-size: 9px;
    min-width: 50px;
    min-height: 24px;
  }
  
  .app-main {
    padding: 4px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .thumb {
    min-height: 160px;
  }
  
  .modal-content {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  
  .editor-toolbar {
    padding: 2px 4px;
    max-height: 50px;
  }
  
  .tools {
    justify-content: center;
    gap: 1px;
  }
  
  .tool-btn {
    padding: 3px 5px;
    font-size: 9px;
    min-width: 28px;
    min-height: 28px;
  }
  
  .text-input {
    max-width: 120px;
    font-size: 10px;
    padding: 3px;
    min-height: 24px;
  }
  
  .tool-opts .color-input {
    width: 25px;
    height: 24px;
  }
  
  .tool-opts .size-input {
    width: 40px;
    padding: 2px;
    font-size: 10px;
    min-height: 24px;
  }
  
  .zoom-controls {
    top: 3px;
    right: 3px;
  }
  
  .zoom-btn {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
  
  .zoom-level {
    top: 3px;
    left: 3px;
    font-size: 10px;
    padding: 2px 6px;
  }
  
  .joystick-container {
    bottom: 15px;
    left: 15px;
  }
  
  .joystick-base {
    width: 50px;
    height: 50px;
  }
  
  .joystick-stick {
    width: 16px;
    height: 16px;
  }
  
  .footer-links {
    gap: 1rem;
  }
  
  .footer-links a {
    font-size: 0.8rem;
  }
}

/* Touch-Geräte Optimierungen */
@media (hover: none) and (pointer: coarse) {
  /* Verhindert Scrollen auf Touch-Geräten */
  body {
    touch-action: pan-x pan-y;
    overscroll-behavior: none;
  }
  
  .app-main {
    overscroll-behavior: contain;
  }
  
  .btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  .icon-btn {
    min-height: 36px;
    min-width: 36px;
  }
  
  .tool-btn {
    min-height: 40px;
    min-width: 40px;
  }
  
  .control-point {
    width: 16px;
    height: 16px;
  }
  
  .zoom-btn {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Sprachauswahl-Dropdown */
.language-selector {
  position: relative;
  display: inline-block;
  margin-left: auto;
  margin-right: 20px;
}

.language-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  color: var(--text);
  min-width: 120px;
}

.language-btn:hover {
  background: var(--panel-2);
  border-color: var(--primary);
}

.language-btn:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.flag {
  font-size: 16px;
  line-height: 1;
}

.lang-text {
  font-weight: 500;
}

.dropdown-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
  color: var(--text-muted);
}

.language-btn[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.language-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 140px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  margin-top: 4px;
}

.language-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--text);
  transition: background-color 0.2s ease;
  border-radius: 4px;
  margin: 2px;
}

.language-option:hover {
  background: var(--panel-2);
}

.language-option.active {
  background: var(--primary);
  color: white;
}

.language-option.active:hover {
  background: var(--primary-600);
}

/* Anpassung für deutsche Version */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.app-header .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-header .toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Anpassung für englische Version */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: relative;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text);
}

header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Responsive Anpassungen für Sprachauswahl */
@media (max-width: 768px) {
  .language-selector {
    margin-right: 10px;
    margin-left: 0;
  }
  
  .language-btn {
    padding: 6px 8px;
    min-width: 100px;
    font-size: 12px;
  }
  
  .flag {
    font-size: 14px;
  }
  
  .language-dropdown {
    min-width: 120px;
  }
  
  .language-option {
    padding: 8px 10px;
    font-size: 12px;
  }
  
  /* Anpassung für mobile Layout */
  .app-header,
  header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .app-header .toolbar,
  .toolbar {
    justify-content: center;
    width: 100%;
  }
  
  .language-selector {
    margin: 0;
    align-self: flex-end;
  }
}

@media (max-width: 480px) {
  .language-selector {
    margin: 0;
    align-self: center;
    margin-top: 8px;
  }
  
  .language-btn {
    padding: 4px 6px;
    min-width: 80px;
    font-size: 11px;
  }
  
  .flag {
    font-size: 12px;
  }
  
  .lang-text {
    font-size: 11px;
  }
  
  .language-dropdown {
    min-width: 100px;
  }
  
  .language-option {
    padding: 6px 8px;
    font-size: 11px;
  }
}