/* CSS Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Skalierbare Schriftgrößen mit clamp() */
    --font-size-xs: clamp(0.75rem, 0.5vw + 0.65rem, 0.9rem);
    --font-size-sm: clamp(0.875rem, 0.8vw + 0.7rem, 1rem);
    --font-size-base: clamp(1rem, 1.2vw + 0.8rem, 1.125rem);
    --font-size-lg: clamp(1.125rem, 1.5vw + 0.9rem, 1.25rem);
    --font-size-xl: clamp(1.25rem, 2vw + 1rem, 1.5rem);
    --font-size-2xl: clamp(1.5rem, 2.5vw + 1.2rem, 2rem);
    --font-size-3xl: clamp(1.875rem, 3vw + 1.5rem, 2.5rem);

    /* Farben */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* Spacing */
    --nav-height: clamp(60px, 5vw, 80px);
    --container-padding: clamp(1rem, 4vw, 2rem);
}

body {
    /*font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;*/
    font-family: Arial, Helvetica, sans-serif;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    text-align: justify;
}

p {
    margin-bottom: 1em;
}

ul {
    margin-left: 2rem;
}

table {
    border-collapse: collapse;
    font-size: 0.9rem;
    line-height: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

th,
td {
    padding: 6px 10px;
    text-align: left;
}

thead th {
    border-bottom: 2px solid var(--text-primary);
}

tbody td {
    border-bottom: 1px solid var(--text-primary);
}

#tableContainer {
    hyphens: none;
    -webkit-hyphens: none;
    -ms-hyphens: none;
}

#tableContainer table {
    border-collapse: collapse;
    width: 100%;
}

#tableContainer td,
th {
    border: 1px solid #000;
    padding: 8px;
    text-align: center;
    font-size: 1em;
}

/* Transformer CSS*/
.log {
    background: #1a202c;
    color: #68d391;
    padding: 15px;
    border-radius: 8px;
    font-family: monospace;
    height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-size: 12px;
}
.chat-container {
    border: 2px solid #4299e1;
    border-radius: 10px;
    padding: 20px;
    background: white;
    margin-top: 20px;
}
.chat-history {
    height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    background: #f7fafc;
}
.message {
    margin: 10px 0;
    padding: 10px;
    border-radius: 10px;
}
.user-message {
    background: #4299e1;
    color: white;
    margin-left: 50px;
    font-size: var(--font-size-sm);
}
.bot-message {
    background: #48bb78;
    color: white;
    margin-right: 50px;
    font-size: var(--font-size-sm);
}
.model-info {
    background: #e6fffa;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #38b2ac;
    font-size: var(--font-size-sm);
}
.progress {
    width: 100%;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4299e1, #48bb78);
    transition: width 0.3s ease;
}
.paintInfo {
    line-height: 1.5em;
}
.flex {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
#user-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    box-sizing: border-box;
}
.neon {
    color: #4299e1;
}
.wrong {
    color: #48bb78;
}
#popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    visibility: hidden;
    z-index: 9999;
    pointer-events: auto;
    overflow: auto;
}
#popup.active {
    visibility: visible;
}
#popup canvas {
    background: white;
    border-radius: 12px;
    margin-bottom: 10px;
}
#controls {
    border-radius: 6px;
    padding: 6px;
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
#controls button {
    margin: 0 5px;
    padding: 5px 10px;
}
#speedControl {
    width: 150px;
}

.checkbox-input {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.checkbox-input:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.checkbox-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-input:checked::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.main-content a {
    color: var(--primary-color);
}

.main-content a:visited {
    color: var(--primary-color);
}

.main-content a:hover {
    color: var(--primary-hover);
}

#footer {
    border-top: 1px solid var(--border-color);
}

#footer-text {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Header und Navigation */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    z-index: 1000;
    height: var(--nav-height);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.logo {
    font-size: var(--font-size-xl);
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Dropdown-Menü */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.nav-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.dropdown-link:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.dropdown-link:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-link:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
    padding-left: 1.25rem;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-btn span {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Main Content */
.main-content {
    margin-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height));
}

.container {
    max-width: 1200px;
    /*background-color: var(--bg-primary);*/
    margin: 0 auto;
    padding: var(--container-padding);
}

.section {
    padding: clamp(2rem, 1vw, 4rem) 0;
}

.section-title {
    font-size: var(--font-size-2xl);
    font-weight: bold;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--text-primary);
}

.content-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.content-card {
    border: 1px solid var(--border-color);
    flex: 1;
    min-width: 300px;
    /*background-color: var(--bg-primary);*/
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    /*box-shadow: var(--shadow);*/
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.content-card-blank {
    flex: 1;
    min-width: 300px;
    background-color: var(--bg-primary);
    padding: 2rem;
    /*border-radius: 12px;*/
    /*box-shadow: var(--shadow);*/
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.inner-card {
    flex: 1;
    width: 100%;
    padding: 1rem;
    background-color: var(--bg-primary);
    margin-bottom: 3rem;
}

.anleitung p {
    margin-top: 1rem;
    font-size: var(--font-size-sm);
}

.aufgaben p {
    margin-top: 1rem;
    font-size: var(--font-size-sm);
}

.anleitung ul {
    margin-left: 2rem;
    margin-top: 1rem;
    font-size: var(--font-size-sm);
}

.aufgaben h3 {
    font-size: var(--font-size-base);
    font-weight: 600;
    border-bottom: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.aufgaben ol {
    margin-left: 2rem;
    margin-top: 1rem;
    font-size: var(--font-size-sm);
}

.aufgaben ul {
    margin-left: 2rem;
    margin-top: 1rem;
    font-size: var(--font-size-sm);
}

.blau {
    color: #5f7fff;
}

.rot {
    color: #ff7f7f;
}

.gruen {
    color: green;
}

.braun {
    color: saddlebrown;
}

.platzhalter_440 {
    width: 440px;
}

.platzhalter_147 {
    width: 147px;
}

#datenX,
#datenY,
#testX,
#testY,
#training-data,
#training-data-A,
#training-data-B {
    font-family: "Courier New", Courier, monospace;
    font-size: var(--font-size-sm);
    font-weight: 400;
    padding: 5px;
}

/*.content-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}*/

.anleitung {
    margin-top: 3rem;
}

.anleitung h3 {
    font-size: var(--font-size-base);
    font-weight: 600;
    border-bottom: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.card-content h3 {
    margin-top: 3rem;
}

.task-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    border-bottom: 1px solid var(--primary-color);
    color: var(--primary-color);
    margin-top: 3rem;
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.card-content {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Canvas Container für interaktive Elemente */
.canvas-container {
    margin: 2rem 0;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    /*text-align: center;*/
    display: flex;
    justify-content: center; /* Container zentriert die Scroll-Box */
    border: 1px solid var(--border-color);
}

.canvas-container:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.scrollable {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.scrollable .scrollcontent {
    display: flex;
    flex-direction: column;
    align-items: center; /* Zentriert die inneren Blöcke (vertikal gestapelt) */
    /*gap: 1rem;*/
    width: max-content; /* <-- wichtig: nimmt die Breite der Inhalte an */
    margin: 0 auto; /* zentriert die ganze Gruppe, solange sie in den Viewport passt */
    box-sizing: border-box;
    /*padding: 0.5rem;*/
}

.nebeneinander {
    display: flex;
    align-items: center;
}

.canvas-placeholder {
    width: 100%;
    height: 400px;
    background-color: var(--bg-primary);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    /*display: flex;*/
    /*align-items: center;*/
    /*justify-content: center;*/
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
}

/* Input-Felder und Buttons */
.input-group {
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.input-field {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: var(--font-size-base);
    font-family: inherit;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
    flex: 1;
    /*min-width: 200px;*/
}
.input-field-small {
    padding: 0.25rem 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: var(--font-size-sm);
    font-family: inherit;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
    flex: 1;
    /*min-width: 200px;*/
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-field:hover {
    border-color: var(--primary-hover);
}

.input-field::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: var(--font-size-base);
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    /* min-width: 100px; */
    margin-left: 1rem;
    margin-right: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-primary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
    /* min-width: 80px; */
}

.btn-mini {
    padding: 2px 4px;
    margin: 0px;
    background-color: var(--primary-color);
    color: white;
    font-size: var(--font-size-sm);
    /* min-width: 80px; */
}

.btn-mini:hover {
    background-color: var(--primary-hover);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: var(--font-size-lg);
    /* min-width: 150px; */
}

/* Label für Input-Felder */
.input-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

@media (min-width: 1024px) {
    canvas {
        width: 100%;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .section-title {
        text-align: left;
    }
    .card-title {
        text-align: left;
    }
    .task-title {
        text-align: left;
    }

    .input-row {
        flex-direction: column;
    }

    .input-field {
        /*.btn {*/

        min-width: auto;
        width: 100%;
    }

    .btn-mini {
        width: auto;
    }

    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background-color: var(--bg-primary);
        border-top: 1px solid var(--border-color);
        flex-direction: column;
        gap: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: var(--shadow-lg);
        max-height: calc(100vh - var(--nav-height));
        overflow-y: auto;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-item {
        border-bottom: 1px solid var(--border-color);
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-link {
        display: block;
        padding: 1rem var(--container-padding);
        font-size: var(--font-size-base);
    }

    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background-color: var(--bg-secondary);
        display: none;
    }

    .nav-item.dropdown-open .dropdown {
        display: block;
    }

    .dropdown-link {
        padding-left: 2rem;
        background-color: transparent;
    }

    .dropdown-link:hover {
        background-color: var(--bg-primary);
        padding-left: 2.5rem;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .content-grid {
        flex-direction: column;
    }

    .content-card {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .canvas-placeholder {
        height: 250px;
    }
}

/* Responsive Bilder */
.image-container {
    margin: 3rem 0;
    text-align: center;
}

.responsive-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    /*box-shadow: var(--shadow);*/
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
    /* Einheitliche maximale Größen */
    max-height: 500px;
    object-fit: contain; /* Behält Seitenverhältnis bei */
}

/*.responsive-image:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}*/

/* Spezielle Größen für verschiedene Bildtypen */
.image-small {
    max-width: 300px;
    max-height: 200px;
}

.image-medium {
    max-width: 600px;
    max-height: 400px;
}

.image-large {
    max-width: 900px;
    max-height: 600px;
}

.image-caption {
    margin-top: 0.5rem;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-style: italic;
}

/* Bild-Grid für mehrere Bilder */
.image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.image-grid-item {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.image-grid-item .responsive-image {
    width: 100%;
    height: 200px; /* Einheitliche Höhe für Grid-Bilder */
    object-fit: contain; /* Füllt Container, schneidet wenn nötig */
    border: none;
}

/* Inline-Bilder im Text */
.inline-image {
    max-width: 250px; /* Etwas größer für bessere Lesbarkeit */
    max-height: 200px;
    height: auto;
    float: right;
    margin: 0 0 1rem 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    object-fit: contain; /* Behält Proportionen bei */
}

/* Varianten für verschiedene Inline-Größen */
.inline-image-small {
    max-width: 150px;
    max-height: 120px;
}

.inline-image-large {
    max-width: 350px;
    max-height: 280px;
}

@media (max-width: 768px) {
    .inline-image,
    .inline-image-small,
    .inline-image-large {
        float: none;
        display: block;
        margin: 1rem auto;
        max-width: 90%; /* Auf Mobile etwas kleiner */
    }

    .image-grid-item .responsive-image {
        height: 150px; /* Kleinere Höhe auf Mobile */
    }
}

/* Hero-Bilder */
.hero-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    /*border-radius: 12px;
    box-shadow: var(--shadow-lg);*/
}

/* Utility Classes */
.text-center {
    text-align: center;
}
.mb-4 {
    margin-bottom: 2rem;
}
.mt-4 {
    margin-top: 2rem;
}
