body { font-family: sans-serif; margin: 0; background: #e9ecef; overflow-x: hidden; min-height: 100vh; }
.controls { background: #343a40; padding: 10px 15px; color: white; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; z-index: 100; position: sticky; top: 0;}
.controls input, .controls button { padding: 8px 12px; border-radius: 4px; border: none; font-size: 16px;}
.btn-group { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

#board {
    position: relative;
    min-height: 100vh;
    min-width: 100%;
    background: #eee;
    display: block; /* Block oder Flex, beides funktioniert mit min-height */
    overflow: auto;
    /* Erzeugt 200px Platz unter der untersten Karte */
    padding-bottom: 200px; 
    box-sizing: border-box;
}

/* Der Hintergrund-Layer */
.board-background-layer {
	display: none !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* Berechnet die Höhe dynamisch: Immer 100% plus das Padding des Boards */
    height: 100%; 
    min-height: 100vh;
    z-index: 1;
    pointer-events: none;
}


/* Kanban Modus: 3 Spalten */
.layout-kanban .board-background-layer,
.layout-scrum .board-background-layer {
    display: grid !important;
    /* grid-template-rows: 1fr sorgt dafür, dass die Zeile den Platz füllt */
    grid-template-rows: 1fr; 
}

.layout-kanban .board-background-layer {
    grid-template-columns: 1fr 1fr 1fr;
    min-width: 1000px;
}

/* Scrum Modus: 4 Spalten */
.layout-scrum .board-background-layer {
    grid-template-columns: 1fr 1fr 1fr 1fr;
    min-width: 1200px;
}

/* Spalten-Styling */
/* Spalten-Styling: Hier liegt der Schlüssel für die Optik */
.col {
    border-right: 2px dashed #ccc;
    padding-top: 50px;
    height: 100%; /* Füllt den Background-Layer komplett aus */
}

/* Letzte Spalte braucht keine Border rechts */
/* Letzte Spalte ohne Rand */
.col-3:last-child, .col-4:last-child {
    border-right: none;
}

.col span {
    font-weight: bold;
    text-transform: uppercase;
    color: #888;
    background: rgba(255,255,255,0.7);
    padding: 5px 15px;
    border-radius: 20px;
	position: sticky; /* Die Spaltenüberschrift scrollt mit */
    top: 70px;
}

/* Farben für die Spalten */
.col-1 { background-color: #f8f9fa; }
.col-2 { background-color: #fff9db; }
.col-3 { background-color: #e7f5ff; }
.col-4 { background-color: #ebfbee; }


/* Sicherstellen, dass Karten ÜBER dem Layer liegen */
.card {
    z-index: 10;
    position: absolute;
	width: 250px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.drag-handle { height: 35px; background: rgba(0,0,0,0.1); cursor: grab; display: flex; justify-content: flex-end; padding: 0 10px; align-items: center; }
.card-content { padding: 15px; }
.card-content strong { display: block; outline: none; margin-bottom: 5px;}
.card-content p { outline: none; min-height: 40px; margin: 0;}

.card-content a {
    position: relative;
    z-index: 20; /* Höher als der Rest der Karte */
    cursor: pointer;
    pointer-events: auto !important; /* Erzwingt, dass Klicks durchgehen */
}

/* Modal Styling */
.modal { position: fixed; z-index: 200; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; }
.modal-content { background: white; padding: 20px; border-radius: 8px; width: 90%; max-width: 350px; text-align: center; }

/* Auth Pages */
.auth-container { width: 90%; max-width: 380px; margin: 60px auto; background: white; padding: 25px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); text-align: center; box-sizing: border-box;}
.auth-container input,
.auth-container select { 
    width: 100%; 
    padding: 12px; 
    margin: 10px 0; 
    box-sizing: border-box; 
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}




.auth-container button { width: 100%; padding: 12px; background: #007bff; color: white; border: none; border-radius: 4px;
    cursor: pointer; 
    font-weight: bold;
    font-size: 1em; }

.login-guide {
    text-align: left;
    font-size: 0.9em;
    color: #555;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    border-left: 4px solid #17a2b8;
}

/* 20260208 10:17 Uhr */

.card-link {
    color: #007bff;
    text-decoration: underline;
    word-break: break-all; /* Verhindert, dass lange URLs die Karte sprengen */
    pointer-events: auto;  /* Stellt sicher, dass Links klickbar sind */
}

/* Im Editiermodus wollen wir, dass der Klick den Text fokussiert, nicht dem Link folgt */
[contenteditable="true"] .card-link {
    pointer-events: none; 
    color: inherit;
    text-decoration: none;
}


/* --- SPEZIALMODUS: READONLY (FÜR SCHÜLER-SMARTPHONES) --- */
.readonly-mode #board {
    display: inline-block; /* Sorgt dafür, dass der Container mit den Karten mitwächst */
    min-width: 100%;
    /* Verhindert, dass das Board bei wenigen Karten zu klein ist */
    min-height: 100vh; 
    padding-bottom: 500px; /* Großzügiger Puffer für die Optik unten */
}

.readonly-mode .card-link,
.readonly-mode .card-content a {
    color: #0000EE !important; /* Klassisches Link-Blau */
    text-decoration: underline !important;
    cursor: pointer !important;
    position: relative;
    z-index: 999; /* Ganz nach oben, damit das Drag-Skript nicht stört */
	pointer-events: auto !important;
}

/* Verhindert, dass die Karte den Klick "verschluckt" */
.readonly-mode .card {
    pointer-events: auto;
}

.readonly-mode .drag-handle {
    cursor: default; /* In der Read-only Ansicht kein Drag-Cursor */
}


/* Sicherstellen, dass der Hintergrund im Read-Only Modus die volle Scroll-Höhe nimmt */
.readonly-mode .board-background-layer {
    height: 100%;
    min-height: 100%;
    position: absolute;
}

/**********************/

/* 20260208 10:59 Uhr: Bestehendes CSS beibehalten und dies ergänzen: */

.img-preview {
    width: 100%;
    height: auto;
    border-radius: 4px;
    cursor: zoom-in;
}

.file-preview {
    text-align: center;
    padding: 10px 0;
}

.pdf-icon a {
    text-decoration: none;
    font-weight: bold;
    color: #dc3545;
    font-size: 1.2em;
}

.file-card {
    width: 200px; /* Bilder-Karten etwas schmaler */
}

.file-card .card-content {
    padding: 5px; /* Weniger Padding für Bilder */
}


/* --- MEDIA QUERIES FÜR MOBILE GERÄTE --- */
@media (max-width: 600px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }

    .btn-group {
        margin-left: 0;
        justify-content: center;
        width: 100%;
    }

    .btn-group button, .btn-group a {
        flex: 1;
        text-align: center;
        font-size: 14px;
        padding: 10px 5px;
    }
	
	/* Im Read-Only Modus (Schüleransicht) Hinweise geben */
    .readonly-mode::before {
        content: "Board-Ansicht (scrollbar)";
        display: block;
        background: #6f42c1;
        color: white;
        text-align: center;
        font-size: 12px;
        padding: 5px;
    }

    .auth-container {
        margin: 20px auto;
        padding: 20px;
        width: 95%;
    }

    h2 { font-size: 1.5rem; }
    
    /* Ermöglicht dem User das horizontale Scrollen im Board, 
       ohne dass das gesamte Layout bricht */
    #board {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}



