:root {
    color-scheme: dark;
    font-family: Inter, 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #1E1E1E;
    color: #CCCCCC;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: #1E1E1E;
    color: #CCCCCC;
}

body {
    background: #1E1E1E;
    color: #CCCCCC;
}

/* Hide Blazor error UI */
#blazor-error-ui {
    display: none !important;
}

button {
    font: inherit;
}

/* ===== APP SHELL ===== */
html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ===== HEADER ===== */
.app-header {
    height: 60px;
    flex-shrink: 0;
    background: #1A80B6;
    color: white;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    padding: 8px 16px;
}

.app-header * {
    outline: none;
}

.app-header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    height: 100%;
}

.header-left {
    flex: 1;
}

.brand h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand p {
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
    opacity: 0.95;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.github-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    font-weight: 500;
    font-size: 0.95rem;
}

.github-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.github-link svg {
    width: 20px;
    height: 20px;
}

/* ===== MAIN CONTENT ===== */
.app-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ===== THREE COLUMN LAYOUT ===== */
.layout-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.layout-container > * {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.settings-panel {
    width: 200px;
    flex-shrink: 0;
    background: #252526;
    border-right: 1px solid #3E3E3E;
    overflow-y: auto;
    padding: 12px;
    gap: 1rem;
    transition: width 0.2s ease;
}

.settings-panel.collapsed {
    width: 32px;
    padding: 8px;
    overflow: hidden;
}

.settings-toggle {
    background: none;
    border: none;
    color: #CCCCCC;
    cursor: pointer;
    padding: 4px;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-bottom: 8px;
    transition: background-color 0.2s;
}

.settings-toggle:hover {
    background: #3E3E3E;
}

.settings-toggle-icon {
    font-size: 16px;
    line-height: 1;
}

.settings-toggle-text {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(0deg);
}

.settings-panel.collapsed .settings-toggle-text {
    display: block;
}

.settings-panel:not(.collapsed) .settings-toggle-text {
    display: none;
}

.settings-content {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.settings-panel.collapsed .settings-content {
    display: none;
}

.settings-header {
    color: #FFFFFF;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 700;
}

.panel.json-panel {
    flex: 1;
    border-right: 1px solid #3E3E3E;
}

.output-panel {
    flex: 1;
    min-width: 0;
}

.panel-header {
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: #2D2D2D;
    border-bottom: 1px solid #3E3E3E;
}

.panel-title {
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
}

.toolbar {
    background: #2D2D30;
    border-bottom: 1px solid #3E3E42;
    padding: 0.75rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

/* ===== EDITOR CONTAINER ===== */
.editor-container {
    flex: 1;
    position: relative;
    background: #1E1E1E;
}

.editor-container.json-input {
    border-left: 3px solid #1A80B6;
}

.toolbar h2 {
    margin: 0;
    font-size: 1rem;
    color: #CCCCCC;
    font-weight: 600;
}

/* ===== PANELS ===== */
.panel {
    background: #1E1E1E;
    border: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.panel h2 {
    display: none; /* Versteckt, da jetzt in Toolbar */
}

/* ===== EDITOR CONTAINER ===== */
.editor-container {
    flex: 1;
    position: relative;
    background: #1E1E1E;
}

.editor-container.json-input {
    border-left: 3px solid #1A80B6;
}

.editor-placeholder {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    color: #6B6B6B;
    font-family: Menlo, Consolas, 'Courier New', monospace;
    font-size: 0.95rem;
    pointer-events: none;
    white-space: pre-wrap;
    opacity: 0.8;
    z-index: 1;
}

/* ===== BUTTONS & CONTROLS ===== */
.btn {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: #1A80B6;
    color: white;
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
    height: 26px;
    line-height: 1;
}

.btn-primary:hover:not(:disabled) {
    background: #146691;
}

.btn-secondary {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-secondary:hover:not(:disabled) {
    background: #cbd5e1;
}

.btn-plain {
    background: transparent;
    color: #1A80B6;
    border: 1px solid #e2e8f0;
}

.btn-plain:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #1A80B6;
}

/* ===== COPY BUTTON ===== */
.copy-btn {
    background: #1A80B6;
    border: none;
    color: #CCCCCC;
    height: 26px;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: auto;
}

.copy-btn:hover {
    background: #3E3E3E;
    color: #FFFFFF;
}

.copy-btn:active {
    background: #1A80B6;
}

.copy-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.copy-btn.copied {
    color: #4EC9B0;
}

.copy-btn.copied svg {
    display: none;
}

.copy-btn.copied::after {
    content: "✓";
    font-size: 14px;
    font-weight: bold;
}

/* ===== OPTIONS ===== */
.options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: transparent;
}

.option-group {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-group strong {
    font-size: 11px;
    color: #FFFFFF;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 0.5rem;
    display: block;
    margin-bottom: 6px;
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    font-size: 13px;
    color: #CCCCCC;
    margin: 0;
}

.option-group input[type="radio"],
.option-group input[type="checkbox"] {
    cursor: pointer;
    accent-color: #1A80B6;
    margin: 0;
    width: 14px;
    height: 14px;
}

/* ===== ACTION ROW ===== */
.action-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1.5rem;
}

.status {
    font-size: 0.85rem;
    color: #64748b;
    margin-left: 1rem;
}

.error {
    background: #442626;
    color: #FF6B6B;
    border: 1px solid #FF6B6B;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* ===== ERROR INDICATOR ===== */
.error-indicator {
    color: #F44747;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.error-indicator::before {
    content: "⚠";
}

/* ===== INITIALIZATION ERROR ===== */
.initialization-error {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: #F44747;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(244, 71, 71, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.json-error {
    border-bottom: 2px solid #F44747 !important;
}

/* ===== FOOTER ===== */
.app-footer {
  flex-shrink: 0;
  height: 36px;
  min-height: 36px;
  background: #007ACC !important;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.footer-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 12px;
}

.footer-left, .footer-center, .footer-right {
  color: #ffffff;
}

.footer-right {
  display: flex;
  gap: 12px;
}

.app-footer a {
  color: #ffffff !important;
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

/* ===== LEGAL PAGES ===== */
.legal-container {
    overflow-y: auto;
    height: 100%;
    padding: 2rem;
}

.legal-page {
    background: #1E1E1E;
    border: 1px solid #3E3E42;
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    margin: 0 auto;
    color: #CCCCCC;
}

.legal-page h1 {
    color: #1A80B6;
    margin-top: 0;
    border-bottom: 2px solid #1A80B6;
    padding-bottom: 1rem;
}

.legal-page h2 {
    color: #1A80B6;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.legal-page p {
    line-height: 1.6;
    color: #CCCCCC;
}

.legal-page a {
    color: #1A80B6;
    text-decoration: none;
}

.legal-page a:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #1A80B6;
    text-decoration: none;
    margin-bottom: 2rem;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }

  .app-content {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .settings-panel {
    width: 100% !important;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #3E3E3E;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
  }

  .settings-panel.collapsed {
    height: auto;
    width: 100% !important;
    overflow: hidden;
  }

  .editor-panel,
  .output-panel {
    width: 100%;
    height: 45vh;
    min-height: 300px;
    border-right: none;
    border-bottom: 1px solid #3E3E3E;
  }

  .monaco-container {
    height: 100%;
  }

  .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .footer-center {
    display: none;
  }
}