/* ===== Allgemeine Styles ===== */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    overflow-x: hidden;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
}

/* ===== Eingabeformular ===== */
.input-section,
.table-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    overflow: hidden;
}

.form-group {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.form-group label {
    display: inline-block;
    font-weight: normal;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group select {
    padding: 8px;
    margin-right: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex: 0 0 auto;
    width: auto;
}

.form-group input[type="date"] {
    width: 150px;
}

.form-group input[type="time"] {
    width: 100px;
}

.form-group input[type="submit"],
.button {
    padding: 8px 15px;
    background-color: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-right: 10px;
    font-size: 14px;
}

.form-group input[type="submit"]:hover,
.button:hover {
    background-color: #1a252f;
}

/* Action Buttons in Table */
.button.delete,
.button.edit {
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    display: inline-block;
    padding: 0;
    margin: 0 2px;
    font-size: 14px;
    border-radius: 4px;
}

.button.delete {
    background-color: #e74c3c;
    color: #fff;
}

.button.delete:hover {
    background-color: #c0392b;
}

.button.edit {
    background-color: #3498db;
    color: #fff;
}

.button.edit:hover {
    background-color: #2980b9;
}

/* ===== Tabelle ===== */
.table-section {
    overflow-x: auto;
}

.table-section table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    table-layout: auto;
}

.table-section th,
.table-section td {
    padding: 8px 10px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
    word-wrap: break-word;
}

.table-section th {
    background-color: #2c3e50;
    color: #fff;
    cursor: pointer;
}

.table-section th:hover {
    background-color: #1a252f;
}

.table-section tr:nth-child(even) {
    background-color: #f2f2f2;
}

.table-section tr:hover {
    background-color: #e9e9e9;
}

.actions-cell {
    white-space: nowrap;
    text-align: center;
    width: 60px;
}

/* Datum & Uhrzeit Zelle */
.date-time-cell {
    white-space: nowrap;
    min-width: 90px;
    max-width: 110px;
    line-height: 1.2;
    padding: 8px 5px !important;
}

.time-in-date-cell {
    font-size: 0.8em;
    color: #666;
    line-height: 1;
    display: block;
}

/* Markdown-Darstellung in der Tabelle */
.markdown-content {
    white-space: normal;
    line-height: 1.2;
    padding-top: 0;
    margin-top: 0;
}
.markdown-content p {
    margin: 0 0 5px 0;
    padding-top: 0;
}
.markdown-content ul {
    margin: 0 0 5px 0;
    padding-left: 20px;
    padding-top: 0;
}
.markdown-content ul ul {
    padding-left: 20px;
    padding-top: 0;
}
.markdown-content ul ul ul {
    padding-left: 20px;
    padding-top: 0;
}
.markdown-content li {
    margin: 0 0 3px 0;
    padding-top: 0;
}

/* Tags als Hashtags */
.tag {
    display: inline-block;
    background-color: #e0e0e0;
    color: #333;
    padding: 2px 6px;
    border-radius: 10px;
    margin-right: 5px;
    margin-bottom: 5px;
    font-size: 0.8em;
    font-weight: normal;
    line-height: 1.4;
    cursor: pointer;
}

.tag:hover {
    background-color: #d0d0d0;
}

.tags-cell {
    white-space: normal;
    max-width: 100%;
    overflow: hidden;
    padding-top: 0;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
    margin-left: 0px;
    max-width: 100%;
}

.tag-checkbox {
    display: inline-flex;
    align-items: center;
    background-color: #e0e0e0;
    padding: 2px 6px;
    border-radius: 10px;
    margin-right: 5px;
    margin-bottom: 5px;
    font-size: 0.9em;
    font-weight: normal;
    cursor: pointer;
    flex: 0 0 auto;
    max-width: fit-content;
}

.tag-checkbox input[type="checkbox"] {
    margin-right: 5px;
    cursor: pointer;
}

/* Markdown-Hilfe */
.markdown-help {
    font-size: 0.8em;
    color: #666;
    margin-top: 5px;
    margin-left: 0px;
}

/* Textarea für Thema */
.form-group textarea {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    min-height: 100px;
    resize: vertical;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
}

/* ===== Druck-Styles ===== */
@media print {
    body * {
        visibility: hidden;
    }

    .table-section,
    .table-section * {
        visibility: visible;
    }

    .no-print {
        display: none !important;
    }

    .table-section {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0;
        margin: 0;
        box-shadow: none;
        background-color: transparent;
    }

    .table-section table {
        width: 100%;
        border-collapse: collapse;
        font-size: 10pt;
    }

    .table-section th,
    .table-section td {
        padding: 4px;
        border: 1px solid #000;
    }

    .table-section th {
        background-color: #f0f0f0 !important;
        color: #000 !important;
    }

    .table-section tr:nth-child(even) {
        background-color: #f9f9f9 !important;
    }

    @page {
        size: A4 portrait;
        margin: 15mm;
    }
}

/* ===== Responsive Design ===== */
@media screen and (max-width: 768px) {
    .container {
        width: 95%;
        padding: 10px;
    }

    .form-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-group label {
        width: 100%;
        margin-bottom: 5px;
        margin-right: 0;
    }

    .form-group input[type="text"],
    .form-group input[type="date"],
    .form-group input[type="time"],
    .form-group select,
    .form-group textarea {
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
    }

    .table-section table {
        font-size: 14px;
    }

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

    .actions-cell {
        width: 60px;
    }

    .date-time-cell {
        min-width: 80px;
        max-width: 100px;
    }
}