/* Globale Stile & Mobile-First Defaults (ähnlich den anderen Tools) */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f4f8;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.back-button {
    display: inline-block;
    background-color: #6c757d;
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    margin: 15px 0 0 15px;
    transition: background-color 0.3s, transform 0.2s;
    float: left;
    clear: both;
}

.back-button:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.container {
    background-color: #fff;
    padding: 25px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    text-align: center;
}

h1 {
    color: #0056b3;
    margin-bottom: 5px;
    font-size: 1.8rem;
}

p {
    color: #666;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.input-section {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

textarea {
    width: 100%;
    height: 300px;
    padding: 15px;
    font-family: 'Roboto Mono', 'Courier New', monospace; /* Monospace für Code */
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    resize: vertical; /* Nur vertikal skalierbar */
    line-height: 1.5;
    background-color: #f8f9fa;
    color: #333;
}

button {
    padding: 10px 20px;
    font-size: 0.95rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: bold;
    width: 100%;
    box-sizing: border-box;
}

button:hover:not(:disabled) {
    background-color: #218838;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.result-box {
    margin-top: 30px;
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    font-size: 1rem;
    line-height: 1.6;
    border: 1px solid transparent; /* Für spätere Farbwechsel */
}

.result-box.valid {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.result-box.invalid {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.result-box p {
    margin: 0 0 10px 0;
    color: inherit; /* Textfarbe vom Eltern-Container erben */
}

.result-box pre {
    background-color: rgba(255, 255, 255, 0.5); /* Leichter Hintergrund für Code/Fehler */
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto; /* Horizontal scrollbar bei langen Zeilen */
    font-size: 0.85rem;
    color: #333;
    white-space: pre-wrap; /* Zeilenumbrüche im Pre-Tag zulassen */
    word-break: break-all; /* Lange Wörter umbrechen */
}

.hidden {
    display: none !important;
}

/* Original action-section (wird in dieser HTML-Struktur nicht mehr verwendet) */
.action-section {
    margin-top: 20px;
    text-align: center;
    /* display: none; */ /* Hier wäre display:none; wenn wir das Element verstecken wollen */
}

.copy-button {
    background-color: #007bff; /* Blau für Kopieren */
    padding: 10px 20px;
    width: auto; /* Nicht volle Breite */
}

.copy-button:hover:not(:disabled) {
    background-color: #0056b3;
}

.error-list {
    margin-top: 20px;
    text-align: left;
    color: #dc3545;
    font-size: 0.9rem;
}

.error-list p {
    margin-bottom: 5px;
    text-align: left;
    color: #dc3545;
}

/* --- Hinzugefügte Stile für den formatierten YAML-Output --- */
.formatted-output-box {
    margin-top: 30px;
    padding: 20px;
    background-color: #e9ecef; /* Leichterer Hintergrund passend zum Gesamtstil */
    border: 1px solid #ced4da;
    border-radius: 8px;
    text-align: left;
}

.formatted-output-box h2 {
    color: #0056b3;
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 15px;
}

.formatted-output-box pre {
    background-color: #f8f9fa; /* Hintergrund für den Code-Block */
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Roboto Mono', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #333;
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: 20px;
}

/* Media Queries für größere Bildschirme */
@media (min-width: 600px) {
    body {
        align-items: center;
        padding: 40px;
    }

    .container {
        padding: 30px 40px;
    }

    h1 {
        font-size: 2.2rem;
    }

    p {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .input-section {
        flex-direction: row;
        gap: 20px;
        justify-content: center;
        align-items: flex-start; /* Oben ausgerichtet für TextArea */
    }

    textarea {
        flex-grow: 1; /* Nimmt den verfügbaren Platz ein */
        height: 400px;
    }

    button {
        width: auto;
        min-width: 150px; /* Mindestbreite für Buttons */
    }

    .back-button {
        position: absolute; /* Positionieren außerhalb des Containers */
        top: 30px;
        left: 30px;
        margin: 0;
    }

    .container {
        margin-top: 0; /* Keine zusätzlichen Margin, da Button absolut positioniert ist */
    }
    
    /* Media Query Anpassung für den neuen Output-Box */
    .formatted-output-box {
        padding: 30px;
    }

    .formatted-output-box h2 {
        font-size: 1.4rem;
    }
}