/* === GRUNDLEGENDE STYLES === */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden; /* kein horizontales Scrollen */
    background-color: #f9f9f9;
    font-family: Arial, sans-serif;
    color: #333;
}

/* === ROT ALS PRIMÄRFARBE === */
:root {
    --main-color: #d32f2f;
}

/* === CONTAINER ZENTRIERT === */
.container,
.user-form,
.med-table,
.data-table,
.site-footer {
    width: 95%;
    max-width: 600px;
    margin: 20px auto;
    padding: 15px;
    box-sizing: border-box;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* === ÜBERSCHRIFTEN === */
h1, h2, h3 {
    color: var(--main-color);
    text-align: center;
}

/* === FORMULARE === */
form {
    display: flex;
    flex-direction: column;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea {
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    width: 100%;
    max-width: 100%;
}

/* === BUTTONS === */
input[type="submit"],
button {
    padding: 10px 15px;
    background-color: var(--main-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

input[type="submit"]:hover,
button:hover {
    background-color: #b71c1c;
}

/* === NACHRICHTEN === */
.message {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    font-weight: bold;
}

.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

/* === LINKS === */
a {
    color: var(--main-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* === NAVIGATION === */
.main-nav {
    width: 100%;
    background-color: var(--main-color);
    padding: 10px 15px;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 15px;
}

.nav-links li {
    position: relative;
}

.nav-links li a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 12px;
    display: inline-block;
}

.nav-links li a:hover {
    text-decoration: underline;
    cursor: pointer;
}

/* Dropdown */
.nav-links .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--main-color);
    padding: 10px 0;
    list-style: none;
    min-width: 180px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.nav-links li:hover .submenu {
    display: block;
}

.nav-links .submenu li a:hover {
    background-color: #990000;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.nav-buttons button {
    background-color: #cc0000;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.nav-buttons button:hover {
    background-color: #990000;
}

/* === TABELLEN === */
table,
.med-table,
.data-table table {
    width: 100%;
    table-layout: fixed;
    overflow-wrap: break-word;
    border-collapse: collapse;
    margin-bottom: 2em;
}

table th, table td,
.med-table th, .med-table td,
.data-table th, .data-table td {
    padding: 12px 15px;
    border: 1px solid #cc0000;
    text-align: left;
}

table th {
    background-color: #fddede;
}

.med-table {
    border: 2px solid #cc0000;
    border-radius: 6px;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

.med-table tbody tr:nth-child(even) {
    background-color: #f9d6d6;
}

.med-table tbody tr:nth-child(odd) {
    background-color: #fff0f0;
}

.med-table tbody tr:hover {
    background-color: #f4baba;
    cursor: default;
}

.med-table tbody tr:last-child td {
    border-bottom: none;
}

/* === FORMULAR-BOXEN === */
.user-form {
    margin-bottom: 30px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

/* === FOOTER === */
.site-footer {
    background-color: #f2f2f2;
    color: #333;
    text-align: center;
    padding: 20px;
    border-top: 1px solid #ccc;
    font-size: 14px;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 20px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.footer-left {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-left img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.footer-col a {
    margin: 5px 0;
    color: #333;
    text-decoration: none;
}

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

/* === RESPONSIVE DESIGN === */
@media screen and (max-width: 768px) {
    /* Container, Tabellen, Footer mobil */
    .container,
    .user-form,
    .med-table,
    .data-table,
    .site-footer {
        width: 95%;
        padding: 15px;
        margin: 15px auto;
    }

    table, .med-table table, .data-table table {
        font-size: 0.9em;
    }

    .med-table th, .med-table td {
        padding: 8px;
    }

    .footer-grid {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Nav-Punkte untereinander auf mobilen Geräten (alle Seiten) */
    .nav-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .nav-links {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .nav-links .submenu {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        box-shadow: none !important;
    }
}

/* === ALLGEMEIN RESPONSIVE ELEMENTS === */
img, input, textarea {
    max-width: 100%;
    height: auto;
    display: block;
}