/* Grundlegende Stildefinitionen */
body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f7f6;
    color: #333;
    /* Flexbox für Spaltenanordnung, um Footer am unteren Rand zu positionieren */
    display: flex;
    flex-direction: column; /* Elemente untereinander anordnen */
    min-height: 100vh; /* Mindesthöhe des Bodys ist die volle Viewport-Höhe */
    box-sizing: border-box; /* Padding im Box-Modell berücksichtigen */
}

.container {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    margin: 30px auto; /* Zentriert den Container und gibt oberen/unteren Abstand */
    box-sizing: border-box;
    /* flex-grow: 1; /* Lässt den Container den verfügbaren Platz einnehmen, schiebt Footer nach unten */
}

header {
    text-align: center;
    margin-bottom: 30px;
}

.monster-bag-graphic {
    max-width: 120px;
    height: auto;
    margin-bottom: 15px;
    animation: bounceIn 1s ease-out; /* Kleine Animation beim Laden */
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); opacity: 1; }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

h1 {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: #2c3e50;
    font-size: 2.2em;
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 1.2;
}

h2 {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: #34495e;
    font-size: 1.5em;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-top: 30px;
    margin-bottom: 25px;
    text-align: center;
}

/* Formular-Stil */
form {
    display: flex;
    flex-direction: column;
    gap: 18px; /* Abstand zwischen den Formular-Elementen */
}

.form-item {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Label links, Input/Select rechts */
    flex-wrap: wrap; /* Erlaubt Umbruch auf kleineren Bildschirmen */
    padding: 5px 0;
}

.form-item label {
    flex-basis: 55%; /* Nimmt 55% der Breite ein */
    font-weight: 600;
    color: #4a4a4a;
    padding-right: 15px; /* Abstand zum Input/Select */
    box-sizing: border-box;
}

.form-item select,
.form-item input[type="number"] {
    flex-basis: 40%; /* Nimmt 40% der Breite ein */
    padding: 10px 12px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    font-size: 1em;
    color: #555;
    background-color: #fdfdfd;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-item input[type="number"] {
    width: 80px; /* Feste Breite für das Nummernfeld */
    text-align: center;
}

.form-item span {
    flex-basis: 100%; /* Einheit unter dem Input auf neuer Zeile */
    font-size: 0.85em;
    color: #777;
    margin-top: 5px;
    text-align: right;
    padding-left: 55%; /* Einrücken unter dem Input */
    box-sizing: border-box;
}

/* Anpassung für mobile Ansicht */
@media (max-width: 480px) {
    .form-item {
        flex-direction: column; /* Elemente untereinander anordnen */
        align-items: flex-start; /* Links ausrichten */
    }
    .form-item label,
    .form-item select,
    .form-item input[type="number"],
    .form-item span {
        flex-basis: 100%; /* Volle Breite */
        width: 100%;
        padding-right: 0;
        text-align: left; /* Text links ausrichten */
        margin-top: 5px; /* Etwas Abstand zwischen den Elementen */
    }
    .form-item span {
        padding-left: 0; /* Keine Einrückung mehr */
    }
}


.form-item select:focus,
.form-item input[type="number"]:focus {
    border-color: #6a82fb;
    box-shadow: 0 0 0 3px rgba(106, 130, 251, 0.2);
    outline: none;
}

.form-item select:disabled {
    background-color: #ececec;
    color: #999;
    cursor: not-allowed;
}

/* Meldung für maximale Gegenstände */
#max-items-message {
    background-color: #ffcccc;
    color: #cc0000;
    padding: 10px 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    margin-top: 20px;
    display: none; /* Standardmäßig versteckt, wird von JS angezeigt */
    align-items: center; /* Für Flexbox-Zentrierung */
    justify-content: center;
}

/* Buttons */
button {
    display: block; /* Jeder Button in einer eigenen Zeile */
    width: 100%;
    padding: 12px 20px;
    margin-top: 25px; /* Abstand nach oben */
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#calculateWeight {
    background-color: #4CAF50; /* Grün */
    color: white;
}

#calculateWeight:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

#resetForm {
    background-color: #6c757d; /* Grau */
    color: white;
    margin-top: 20px; /* Abstand zur Trennlinie */
}

#resetForm:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

/* Ergebnisbereich */
.result {
    background-color: #e8f5e9; /* Sehr hellgrüner Hintergrund */
    padding: 25px;
    border-radius: 12px;
    margin-top: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    color: #2e7d32; /* Dunkelgrüner Text */
}

.result h2 {
    color: #2e7d32; /* Überschrift passend zum Hintergrund */
    border-bottom: 2px solid #a5d6a7; /* Hellere Linie */
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 20px;
}

.result p {
    font-size: 1.4em;
    font-weight: 600;
    margin-bottom: 15px;
}

.result span {
    font-size: 1.6em; /* Größer für das Gewicht */
    color: #1b5e20; /* Dunkelgrüner für das Gewicht */
}

#comparison {
    font-style: italic;
    color: #424242; /* Etwas dunkler für den Vergleichstext */
    margin-top: 15px;
    font-size: 1.1em;
}

/* Styling für die elegante Trennlinie */
.separator {
    width: 80%; /* Breite der Linie, z.B. 80% des Eltern-Containers */
    max-width: 300px; /* Maximale Breite, damit sie nicht zu breit wird */
    height: 1px; /* Die Dicke der Linie */
    background-color: #a5d6a7; /* Eine helle, dezente grüne Farbe, passend zum Ergebnisbereich */
    margin: 30px auto; /* 30px Abstand oben/unten, 'auto' zentriert horizontal */
    border-radius: 5px; /* Ganz leichte Rundung */
}

/* Footer Styling */
footer {
    text-align: center;
    margin-top: auto; /* Sorgt dafür, dass der Footer an den unteren Rand gedrückt wird */
    padding: 20px 0;
    color: #777;
    font-size: 0.9em;
    border-top: 1px solid #e0e0e0; /* Eine feine Linie zur Abgrenzung */
    width: 100%; /* Stelle sicher, dass der Footer die volle Breite einnimmt */
    box-sizing: border-box; /* Wichtig für die Breitenberechnung mit Padding */
    /* background-color: #f0f0f0; /* Optional: Leichter Hintergrund für den Footer */
}

footer p {
    margin: 5px 0; /* Etwas Abstand zwischen den Absätzen im Footer */
}

footer a {
    color: #6a82fb; /* Farbe für Links im Footer */
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}