* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    padding: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

h1 {
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    color: #1a202c;
}

.input-section, .output-section {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* --- ECLIPSE FARBSCHEMA FÜR DEN EDITOR --- */
.query-input-editor {
    width: 100%;
    min-height: 180px;
    font-size: 1.25rem !important;
    line-height: 1.6;
    font-family: 'Fira Code', 'Courier New', Courier, monospace !important;
    letter-spacing: normal !important;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background-color: #ffffff;
    overflow-y: auto;
    outline: none;
    white-space: pre-wrap;
    word-break: break-all;
}

.query-input-editor:focus {
    border-color: #3182ce;
}

.query-input-editor:empty:before {
    content: attr(placeholder);
    color: #a0aec0;
    cursor: text;
}

.eclipse-keyword {
    color: #7f0055 !important;
    font-weight: bold !important;
}

.eclipse-string {
    color: #2a00ff !important;
}


#json-output-container {
    width: 100%;
    min-height: 250px;
    max-height: 600px;
    overflow: auto;
    background-color: #ffffff;
    color: #000000;
    padding: 1.25rem;
    border: 1px solid #a9a9a9;
    border-radius: 4px;
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 1rem;
    white-space: pre-wrap;
    word-break: break-all;
    user-select: text !important;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 0.75rem;
}

.hidden-btn {
    display: none !important;
}

button {
    padding: 0.75rem 1.5rem;
    background-color: #3182ce;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background-color: #2b6cb0;
}

#graph-btn {
    background-color: #28a745;
}

#graph-btn:hover {
    background-color: #218838;
}

h3 {
    margin-bottom: 0.5rem;
    color: #4a5568;
}


.query-legend-container {
    background-color: #ffffff;
    border: 1px solid #b8b8b8;
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 12px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 16px; 
    color: #000000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    line-height: 1.8;
}

.legend-title {
    font-family: sans-serif;
    font-weight: bold;
    font-size: 16px; 
    color: #555555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

/* Eclipse Keywords (Lila) */
.legend-kw {
    color: #7f0055;
    font-weight: bold;
}


.legend-op {
    color: #000000;
    font-weight: bold;
}

/* Interaktive Hover-Elemente */
.legend-item {
    position: relative;
    display: inline-block;
    background-color: #f0f4f8;
    color: #000000;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #7f0055;
    cursor: help;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.legend-item:hover {
    background-color: #e2e8f0;
}

/* Popover Infokasten */
.legend-popover {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 700px;
    max-height: 650px;
    overflow-y: auto;
    background-color: #ffffff;
    color: #000000;
    padding: 14px 18px;
    border: 1px solid #7f0055;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 9999;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px; /* Zurückgesetzt auf 12.5px */
    white-space: pre;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: auto;
    margin-top: 6px;
}

/* Pfeil oben am Popover */
.legend-popover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #7f0055 transparent;
}

/* Einblenden bei Hover */
.legend-item:hover .legend-popover {
    visibility: visible;
    opacity: 1;
}

/* Eclipse Syntax-Highlighting innerhalb der Popovers */
.grammar-head {
    color: #7f0055;
    font-weight: bold;
    display: block;
    margin-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 4px;
}

/* Strings in Anführungszeichen (Eclipse String Blue) */
.str {
    color: #2a00ff;
    font-weight: normal;
}
.legend-title {
    font-family: sans-serif;
    font-weight: bold;
    font-size: 12px;
    color: #555555;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}
/* Placeholder-Styling wenn der Platzhalter aktiv ist */
.query-input-editor.is-placeholder {
    color: #888888;
    font-style: normal;
}