/* Relationstabelle CSS */

#relation-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

.relation-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #333;
    position: relative;
}

.relation-header h1 {
    margin: 0;
    color: #333;
}

.toolbar {
    position: absolute;
    left: 0;
    display: flex;
    gap: 10px;
}

/* Toolbar Buttons - helles Grau wie Aktionsspalte */
.toolbar .btn {
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
}

.toolbar .btn:hover {
    background-color: #e9ecef;
}

/* Verstecke eingeklappte Elemente */
.collapsed-antrag-details {
    display: none !important;
}

/* Case Info Section */
.case-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.case-info label {
    font-weight: bold;
    color: #333;
}

.case-info .form-input {
    flex: 1;
}


/* Buttons */
.btn {
    cursor: pointer;
}

.btn-primary, .btn-success, .btn-info, .btn-secondary {
    cursor: pointer;
}

.btn-secondary-sm {
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

.btn-info-sm {
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

.btn-danger-sm {
    background-color: #dc3545;
    color: white;
    padding: 2px 6px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.btn-danger-sm:hover {
    background-color: #c82333;
}

/* Relationstabelle */
.relation-table {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.col-klaeger, .col-beklagter {
    display: flex;
    flex-direction: column;
}

.col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.col-header label {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.btn-add-party {
    padding: 5px 10px;
    cursor: pointer;
    font-size: 13px;
}

.party-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.party-item {
    display: grid;
    grid-template-columns: 30px 2fr 2fr auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    background-color: #fff;
    border-radius: 4px;
}

.party-number {
    font-weight: bold;
    color: #6c757d;
    text-align: center;
}

.party-name, .party-anwalt {
    padding: 6px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.party-name:focus, .party-anwalt:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.form-input {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* PDF Upload Section */
.pdf-upload-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pdf-upload-section h3 {
    margin-top: 0;
    color: #333;
}

.drop-zone {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s;
}

.drop-zone.dragover {
    border-color: #007bff;
    background-color: #e7f3ff;
}

.drop-zone p {
    margin: 0 0 15px 0;
    color: #6c757d;
}

.pdf-list {
    margin-top: 20px;
}

.pdf-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 8px;
    background-color: #fff;
    cursor: move;
    transition: opacity 0.3s, background-color 0.2s;
}

.pdf-item:hover {
    background-color: #f8f9fa;
}

.pdf-item[draggable="true"]:active {
    cursor: grabbing;
}

.pdf-item-name {
    font-weight: 500;
    color: #333;
}

.pdf-item-date {
    font-size: 12px;
    color: #6c757d;
}

/* Anträge Section */
.antraege-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    margin: 0;
    color: #333;
}

.section-header-sm {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.section-header-sm h4, .section-header-sm h5 {
    margin: 0;
    color: #555;
}

.antraege-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Antrag Container */
.antrag-container {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    background-color: #f8f9fa;
    max-width: 100%;
    overflow-x: auto;
}

/* Removed: antrag-container-header is now a table row */

.antrag-list, .gegenantrag-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.einzelantrag-item {
    background-color: #fff;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.einzelantrag-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 5px;
}

/* Antrag Row - Standard grau für alle Spalten */
.antrag-row td {
    background-color: #f8f9fa;
}

/* Linke und mittlere Spalte in Antrag - Grau mit leichtem Rotschimmer */
.antrag-row td:nth-child(1),
.antrag-row td:nth-child(2) {
    background-color: #f5e8e8;
}


/* Readonly-Text im Antrag - fettgedruckt */
.antrag-readonly-text {
    font-weight: bold;
}

.einzelantrag-bezeichnung {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    resize: vertical;
    box-sizing: border-box;
    min-height: 60px;
    overflow-y: hidden;
}

.einzelantrag-pdf-link, .gegenantrag-pdf-link {
    display: flex;
    gap: 5px;
    align-items: center;
    margin-top: 5px;
    padding: 5px;
    background-color: #f8f9fa;
    border-radius: 3px;
    overflow: visible;
    flex-wrap: wrap;
}

.einzelantrag-pdf-select, .gegenantrag-pdf-select {
    flex: 1 1 200px;
    padding: 4px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    font-size: 12px;
    min-width: 150px;
}

.einzelantrag-pdf-page, .gegenantrag-pdf-page {
    width: 60px;
    flex-shrink: 0;
    padding: 4px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    font-size: 12px;
    text-align: center;
}

.einzelantrag-pdf-anchor, .gegenantrag-pdf-anchor {
    color: #007bff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.einzelantrag-pdf-anchor:hover, .gegenantrag-pdf-anchor:hover {
    text-decoration: underline;
}

.antrag-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    background-color: #fff;
    table-layout: fixed;
}

.antrag-table th {
    background-color: #e9ecef;
    padding: 10px;
    text-align: left;
    font-weight: bold;
    border: 1px solid #ced4da;
    width: 50%;
}

.antrag-table td {
    padding: 10px;
    border: 1px solid #ced4da;
    vertical-align: top;
}

.antrag-steller-select, .gegenantrag-steller-select {
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
}

.antrag-col, .gegenantrag-col {
    width: 50%;
}

.gegenantrag-item {
    background-color: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.gegenantrag-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 5px;
}

.gegenantrag-bezeichnung {
    width: 100%;
    padding: 6px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    resize: vertical;
    box-sizing: border-box;
    min-height: 60px;
    overflow-y: hidden;
}

.antrag-body {
    background-color: #fff;
    padding: 15px;
    border-radius: 6px;
}

/* Anspruchsgrundlage */
.asg-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.asg-item td {
    background-color: #e9ecef;
}

.asg-header {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.asg-bezeichnung, .asg-rechtsgrundlage {
    padding: 6px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
}

.asg-body {
    background-color: #fff;
    padding: 12px;
    border-radius: 4px;
}

/* Tatbestandsmerkmal */
.tbm-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

/* Tatbestandsmerkmal Textareas - fettgedruckt */
.tbm-klaeger, .tbm-beklagter {
    font-weight: bold;
}

/* tbm-item ist jetzt ein <tr> Element, kein Grid mehr */
/* Drag & Drop für Tatbestandsmerkmale */
.tbm-item {
    transition: opacity 0.3s, background-color 0.2s;
}

.tbm-item:hover {
    background-color: #f0f0f0;
}

/* Drag-Handle für Tatbestandsmerkmale */
.tbm-drag-handle {
    cursor: move;
    user-select: none;
    transition: background-color 0.2s;
}

.tbm-drag-handle:hover {
    background-color: #5a6268;
}

.tbm-drag-handle:active {
    cursor: grabbing;
    background-color: #495057;
}

.tbm-bezeichnung, .tbm-beschreibung {
    padding: 6px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    font-family: Arial, sans-serif;
    font-weight: bold;
}

.tbm-beschreibung {
    resize: vertical;
}

/* PDF Links Section */
.pdf-links-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.pdf-links-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pdf-link-item {
    display: grid;
    grid-template-columns: 2fr 80px auto auto;
    gap: 8px;
    align-items: center;
    padding: 6px;
    background-color: #e7f3ff;
    border-radius: 4px;
}

.pdf-select, .pdf-page {
    padding: 4px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    font-size: 12px;
}

.pdf-page {
    text-align: center;
}

.pdf-link-anchor {
    color: #007bff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
}

.pdf-link-anchor:hover {
    text-decoration: underline;
}

/* PDF Viewer Styles */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

/* Contenteditable Placeholder */
[contenteditable].empty:before {
    content: attr(placeholder);
    color: #999;
    font-style: italic;
    pointer-events: none;
}

[contenteditable]:focus:before {
    content: none;
}

/* Responsive */
@media (max-width: 768px) {
    .table-header {
        grid-template-columns: 1fr;
    }

    .antrag-header {
        grid-template-columns: 1fr;
    }

    .asg-header {
        grid-template-columns: 1fr;
    }

    .tbm-item {
        grid-template-columns: 1fr;
    }

    .pdf-link-item {
        grid-template-columns: 1fr;
    }
}
