/* ========== Basis/Reset ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    color: #333;
    background-color: #f5f7fa;
    line-height: 1.5;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========== Header ========== */
header {
    background-color: #2a7ae2;
    color: #fff;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

    header h1 {
        margin: 0;
        font-size: 1.6rem;
    }

.logo-container img {
    max-height: 72px;
    width: auto;
}

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ========== Layout ========== */
.container {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    max-width: none;
    margin: 0;
    width: 100%;
}


#sideMenu {
    width: 220px;
    background-color: #e3e7ed;
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 1rem; /* bleibt beim Scrollen sichtbar */
}

    /* Links in der Sidebar wie Buttons stylen */
    #sideMenu .side-link {
        display: block;
        width: 100%;
        background-color: #e3e7ed;
        border: none;
        padding: 0.6rem 0.75rem;
        margin-bottom: 0.5rem;
        border-radius: 6px;
        text-align: left;
        font-size: 0.95rem;
        cursor: pointer;
        transition: background-color 0.2s ease, box-shadow 0.2s ease;
        text-decoration: none; /* <a> ohne Unterstreichung */
        color: inherit; /* Textfarbe wie umgebend */
        outline: none;
    }

        #sideMenu .side-link:hover {
            background-color: #cfd6e3;
        }

        #sideMenu .side-link:focus-visible {
            box-shadow: 0 0 0 3px #bcd2ff; /* Tastaturfokus sichtbar */
        }

        #sideMenu .side-link.active {
            background-color: #1d66c2;
            color: #fff;
        }

/* Hauptbereich */
#mainContent {
    flex: 1;
    padding: 0.5rem;
    min-width: 0; /* bessere Shrinkbarkeit */
}

.sidecontent {
    display: none;
    background-color: #fff;
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0 0 4px rgba(0,0,0,0.05);
    margin-bottom: 1rem;
}

    .sidecontent.active {
        display: block;
    }

h2 {
    margin-top: 0;
}

/* ========== Formulare & Buttons ========== */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

    .form-row label {
        min-width: 140px;
        font-weight: bold;
    }

    .form-row input[type="text"],
    .form-row input[type="number"],
    .form-row input[type="file"],
    .form-row select,
    .form-row textarea {
        flex: 1;
        padding: 0.5rem;
        border: 1px solid #cfd6e3;
        border-radius: 6px;
        font-size: 0.95rem;
        background: #fff;
    }

textarea {
    width: 100%;
    resize: vertical;
}

button {
    background-color: #2a7ae2;
    color: #fff;
    border: none;
    padding: 0.5rem 0.9rem;
    font-size: 0.95rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.02s ease;
}

    button:hover {
        background-color: #235ba8;
    }

    button:active {
        transform: translateY(1px);
    }

    button:focus-visible {
        outline: 3px solid #bcd2ff;
    }

/* Listen */
.list-container {
    margin-top: 1rem;
}

.list-item {
    background-color: #fff;
    border: 1px solid #e6eaf1;
    padding: 0.6rem;
    margin-bottom: 0.6rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

    .list-item button {
        background-color: #d9534f;
        padding: 0.35rem 0.7rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }

        .list-item button:hover {
            background-color: #c9302c;
        }

.small-list .list-item {
    padding: 0.3rem;
    font-size: 0.85rem;
}

pre {
    background-color: #f0f4f8;
    border: 1px solid #e3e7ed;
    border-radius: 6px;
    padding: 0.6rem;
    max-height: 300px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 0.85rem;
}

/* ========== Iframes (WebGL) ========== */
:root {
    --header-space: 120px;
    --section-overhead: 120px;
}

.iframe-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(100%, calc((100dvh - var(--header-space) - var(--section-overhead)) * (16/9)));
    margin: 1rem auto;
}

    .iframe-container iframe {
        aspect-ratio: 16 / 9;
        width: 100%;
        height: auto;
        background: #231F20;
        border: none;
        display: block;
    }

.iframe-controls {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

    .iframe-controls button {
        background-color: #2a7ae2;
        color: #fff;
        border: none;
        padding: 0.45rem 0.9rem;
        font-size: 0.9rem;
        border-radius: 6px;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

        .iframe-controls button:hover {
            background-color: #1f63c0;
        }

/* ========== Responsiv ========== */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }

    #sideMenu {
        position: static;
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: 0.5rem;
    }

        #sideMenu .side-link {
            margin-bottom: 0;
            text-align: center;
        }
}
