:root {
    --primary-color: #2c6fbe;
    --secondary-color: #3498db;
    --error-color: #e74c3c;
    --warning-color: #f39c12;
    --style-color: #27ae60;
    --text-color: #333;
    --bg-color: #f8f9fa;
    --light-gray: #e2e2e2;
    --dark-gray: #777;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* Top checklist section styling */
#top-checklist-section {
    padding: 20px;
    margin-bottom: 20px;
}

/* Disabled upload area when checklist is empty */
.checklist-upload-disabled #drop-area {
    opacity: 0.5;
    pointer-events: none;
    background-color: #f5f5f5 !important;
    border-color: #ccc !important;
    cursor: not-allowed;
}

.checklist-upload-disabled #drop-area p {
    color: #999;
}

.checklist-upload-disabled #drop-area .upload-button {
    background-color: #ccc !important;
    color: #666 !important;
    cursor: not-allowed;
}

/* Disabled upload area for Vorjahresvergleich tab */
.vorjahresvergleich-upload-disabled #drop-area {
    opacity: 0.5;
    pointer-events: none;
    background-color: #f5f5f5 !important;
    border-color: #ccc !important;
    cursor: not-allowed;
}

.vorjahresvergleich-upload-disabled #drop-area p {
    color: #999;
}

.vorjahresvergleich-upload-disabled #drop-area .upload-button {
    background-color: #ccc !important;
    color: #666 !important;
    cursor: not-allowed;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    margin-bottom: 30px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.llm-debug-info {
    background-color: rgba(44, 111, 190, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 500;
}

.llm-debug-info span {
    white-space: nowrap;
}

/* Responsive adjustments for LLM debug info */
@media (max-width: 768px) {
    .header-right {
        flex-direction: column;
        align-items: flex-end;
        gap: 10px;
    }
    
    .llm-debug-info {
        font-size: 0.75rem;
        padding: 3px 6px;
    }
    
    .user-menu {
        font-size: 0.8rem;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .header-right {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .llm-debug-info {
        order: -1;
    }
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
}

.user-menu span {
    color: var(--dark-gray);
}

.logout-link {
    color: var(--error-color);
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid var(--error-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.logout-link:hover {
    background-color: var(--error-color);
    color: white;
}

h1 {
    color: var(--primary-color);
    margin: 0;
}

.tabs {
    display: flex;
    list-style: none;
    border-bottom: 2px solid var(--light-gray);
    margin-bottom: 20px;
}

.tabs li {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tabs li.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    font-weight: bold;
}

.tabs li.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.tabs li.disabled:hover {
    color: inherit;
    background-color: transparent;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

#drop-area {
    border: 2px dashed var(--secondary-color);
    border-radius: 5px;
    padding: 50px;
    text-align: center;
    margin: 30px auto;
    background-color: #fff;
    transition: background-color 0.3s ease;
}

#drop-area.highlight {
    background-color: rgba(52, 152, 219, 0.1);
}

.upload-form {
    margin-bottom: 15px;
}

#file-input {
    display: none;
}

.upload-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.upload-button:hover {
    background-color: #1d5895;
}

.hidden {
    display: none !important;
}

/* Upload State Styling */
#drop-area.uploading {
    background-color: rgba(52, 152, 219, 0.05);
    border-color: var(--primary-color);
    opacity: 0.8;
    pointer-events: none;
    cursor: not-allowed;
}

#drop-area.uploading p {
    opacity: 0.6;
}

#drop-area.uploading .upload-form {
    opacity: 0.6;
    pointer-events: none;
}

#drop-area.uploading .upload-button {
    background-color: var(--light-gray);
    color: var(--dark-gray);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Checkpoint System */
.checkpoint-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 20px auto !important;
    gap: 15px !important;
    width: 280px !important;
    padding: 0 !important;
}

.checkpoint {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
    width: 70px !important;
}

.checkpoint-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.checkpoint.active .checkpoint-icon {
    background-color: var(--primary-color);
    color: white;
}

.checkpoint.completed .checkpoint-icon {
    background-color: var(--style-color);
    color: white;
}

.checkpoint-number {
    font-weight: bold;
    font-size: 16px;
}

.checkpoint-check {
    font-size: 20px;
    font-weight: bold;
    position: absolute;
}

.checkpoint.completed .checkpoint-number {
    display: none;
}

.checkpoint.completed .checkpoint-check {
    display: block !important;
}

.checkpoint-connector {
    width: 50px !important;
    height: 2px !important;
    background-color: var(--light-gray) !important;
    transition: background-color 0.3s ease !important;
    flex: 0 0 50px !important;
    align-self: center !important;
    margin: 0 !important;
}

.checkpoint-connector.completed {
    background-color: var(--style-color) !important;
}

.checkpoint-label {
    font-size: 14px;
    color: var(--dark-gray);
    font-weight: 500;
    text-align: center;
}

.checkpoint.active .checkpoint-label {
    color: var(--primary-color);
    font-weight: bold;
}

.checkpoint.completed .checkpoint-label {
    color: var(--style-color);
}

/* Current Step Display */
.current-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
    gap: 15px;
}

.current-step .loading-spinner {
    margin: 0;
}

.current-step p {
    margin: 0;
    font-size: 16px;
    color: var(--primary-color);
    font-weight: 500;
    text-align: center;
}

.correction-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    gap: 15px;
}

.legend {
    display: flex;
    gap: 15px;
}

.filter-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
}

.filter-button {
    padding: 6px 12px;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    background-color: white;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.filter-button:hover {
    background-color: #f0f0f0;
}

.filter-button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.marker {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
}

.marker::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 5px;
    border-radius: 50%;
}

.marker.error::before {
    background-color: var(--error-color);
}

.marker.warning::before {
    background-color: var(--warning-color);
}

.marker.style::before {
    background-color: var(--style-color);
}

.action-button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.action-button:hover {
    background-color: #1d5895;
}

.document-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    align-items: stretch; /* Beide Container haben gleiche Höhe */
}

.document-viewer, 
.text-analyzer {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

.document-viewer h3,
.text-analyzer h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.pdf-js-viewer {
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: auto; /* Erlaubt Scrollen für größere Dokumente */
    min-height: 600px; /* Erhöht von 500px auf 600px */
    flex: 1; /* Nimmt verfügbaren Platz im Container ein */
    max-height: 120vh; /* Erhöht von 110vh auf 120vh für bessere PDF-Anzeige */
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 10px; /* Zusätzlicher Abstand um den Inhalt */
    
    /* Optimierungen für schärfere PDF-Darstellung */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    backface-visibility: hidden;
    will-change: transform;
    transform: translateZ(0);
}

.pdf-js-viewer canvas {
    max-width: 100%;
    margin: 0 auto;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Subtiler Schatten für besseren Kontrast */
    background-color: white; /* Weißer Hintergrund für bessere Lesbarkeit */
    
    /* Moderate Text-Schärfe und Rendering-Optimierungen */
    image-rendering: auto;
    image-rendering: smooth;
    
    /* Erweiterte Text-Rendering-Optimierungen */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-smooth: always;
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
    
    /* Hardware-Beschleunigung für bessere Performance */
    will-change: transform;
    backface-visibility: hidden;
    
    /* Entferne aggressive Anti-Aliasing-Eigenschaften für natürlichere Darstellung */
}

.svg-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 400px;
}

.svg-container svg {
    max-width: 100%;
    height: auto;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    background-color: white;
    
    /* SVG-spezifische Rendering-Optimierungen */
    shape-rendering: geometricPrecision;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* Transition für smooth fade-in */
    transition: opacity 0.2s ease-in-out;
}

/* Font-Fallbacks für SVG-Text */
.svg-container svg text {
    font-family: 'Arial', 'Helvetica', 'DejaVu Sans', 'Liberation Sans', sans-serif !important;
    font-feature-settings: normal !important;
    text-rendering: optimizeLegibility !important;
    shape-rendering: geometricPrecision !important;
}

.svg-container svg text[font-family*="serif"],
.svg-container svg text[font-family*="Times"] {
    font-family: 'Times New Roman', 'DejaVu Serif', 'Liberation Serif', serif !important;
}

.svg-container svg text[font-family*="mono"],
.svg-container svg text[font-family*="Courier"] {
    font-family: 'Courier New', 'DejaVu Sans Mono', 'Liberation Mono', monospace !important;
}

/* Für bessere Schriftdarstellung in SVG */
.svg-container svg g[data-font-name] text {
    font-synthesis: none;
    font-variant-ligatures: none;
}

.pdf-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
    gap: 15px;
    width: 100%;
    order: -1; /* Stelle sicher, dass es oben steht */
}

.pdf-controls button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
}

.pdf-controls button:hover {
    background-color: #1d5895;
}


#text-content,
#text-content-numbers,
#text-content-completeness,
#text-content-checklist,
#text-content-consistency {
    background-color: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
    min-height: 600px; /* Angepasst an PDF-Viewer */
    flex: 1; /* Nimmt verfügbaren Platz im Container ein */
    max-height: 120vh; /* Angepasst an PDF-Viewer */
    overflow-y: auto;
    font-size: 16px;
}

/* Neue Stile für die Korrekturen-Liste */
.corrections-list-header {
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--light-gray);
}

.corrections-list-header h4 {
    margin: 0;
    color: var(--primary-color);
}

.corrections-list {
    display: flex;
    flex-direction: column;
    gap: 0; /* Kein Gap für nahtloses Hovering */
}

.correction-item {
    background-color: #f9f9f9;
    border-radius: 0; /* Entferne Border-Radius für nahtlose Verbindung */
    padding: 20px 12px; /* Noch mehr Padding für größere Hover-Bereiche */
    border-left: 4px solid;
    border-bottom: 1px solid #e0e0e0; /* Subtile Trennung statt Gap */
    box-shadow: none; /* Entferne Box-Shadow um Lücken zu vermeiden */
    cursor: pointer;
    margin: 0; /* Kein Margin */
    transition: all 0.1s ease; /* Sehr schnelle Transition */
    position: relative;
    min-height: 70px; /* Größere Mindesthöhe */
}

/* Erste und letzte Items bekommen abgerundete Ecken */
.correction-item:first-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.correction-item:last-child {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    border-bottom: none;
}

.correction-item:hover {
    background-color: #f0f0f0;
    border-left-width: 6px;
    box-shadow: inset 0 0 0 1px rgba(44, 111, 190, 0.2);
    transition: all 0.1s ease;
    position: relative;
    z-index: 1;
}

.correction-item.highlighting {
    background-color: #e8f4fd;
    border-left-width: 8px;
    box-shadow: inset 0 0 0 2px rgba(44, 111, 190, 0.4);
    transition: all 0.1s ease;
    position: relative;
    z-index: 2;
}



.correction-item.error {
    border-left-color: var(--error-color);
}

.correction-item.warning {
    border-left-color: var(--warning-color);
}

.correction-item.style {
    border-left-color: var(--style-color);
}

.correction-item.accepted {
    background-color: #e8f5e8;
    border-left-color: #4caf50;
    opacity: 0.7;
}

.correction-item.accepted::after {
    content: "✓ Angenommen";
    position: absolute;
    top: 8px;
    right: 12px;
    background-color: #4caf50;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.correction-item.rejected {
    background-color: #ffeaea;
    border-left-color: #f44336;
    opacity: 0.7;
}

.correction-item.rejected::after {
    content: "✗ Abgelehnt";
    position: absolute;
    top: 8px;
    right: 12px;
    background-color: #f44336;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.correction-item.accepted,
.correction-item.rejected {
    position: relative;
    cursor: pointer;
}

.correction-item.accepted:hover,
.correction-item.rejected:hover {
    opacity: 1;
    background-color: #f0f0f0;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.correction-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.correction-type {
    font-weight: bold;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
}

.correction-item.error .correction-type {
    background-color: var(--error-color);
}

.correction-item.warning .correction-type {
    background-color: var(--warning-color);
}

.correction-item.style .correction-type {
    background-color: var(--style-color);
}

.correction-message {
    font-weight: 500;
}

.correction-context {
    background-color: white;
    padding: 10px;
    border-radius: 4px;
    font-family: monospace;
    margin-bottom: 8px;
    white-space: pre-wrap;
    overflow-x: auto;
    line-height: 1.5;
}

.highlight-inline {
    padding: 2px 0;
    border-bottom: 2px wavy;
}

.highlight-inline.error {
    background-color: rgba(231, 76, 60, 0.1);
    border-bottom-color: var(--error-color);
}

.highlight-inline.warning {
    background-color: rgba(243, 156, 18, 0.1);
    border-bottom-color: var(--warning-color);
}

.highlight-inline.style {
    background-color: rgba(39, 174, 96, 0.1);
    border-bottom-color: var(--style-color);
}

.correction-suggestion {
    color: var(--primary-color);
    font-style: italic;
}

.suggestion-label {
    font-weight: bold;
    font-style: normal;
}

.correction-reasoning {
    color: var(--dark-gray);
    font-size: 0.9em;
    margin-top: 8px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.reasoning-label {
    font-weight: bold;
    color: var(--primary-color);
}

.correction-timestamp {
    color: #28a745;
    font-size: 0.9em;
    font-weight: bold;
    margin-top: 5px;
    padding: 3px 6px;
    background-color: rgba(40, 167, 69, 0.1);
    border-radius: 3px;
    border-left: 3px solid #28a745;
}

.no-errors-message {
    padding: 30px;
    text-align: center;
    color: var(--dark-gray);
    background-color: #f0f8ff;
    border: 1px solid #d1ecf1;
    border-radius: 8px;
    margin: 20px 0;
}

.no-errors-message h4 {
    color: var(--style-color);
    margin-bottom: 10px;
    font-size: 1.2em;
}

.no-errors-message p {
    color: #495057;
    font-size: 1em;
    line-height: 1.5;
}

.highlight {
    position: relative;
    cursor: pointer;
    padding: 0 2px;
    border-bottom: 2px wavy;
}

.highlight.error {
    background-color: rgba(231, 76, 60, 0.1);
    border-bottom-color: var(--error-color);
}

.highlight.warning {
    background-color: rgba(243, 156, 18, 0.1);
    border-bottom-color: var(--warning-color);
}

.highlight.style {
    background-color: rgba(39, 174, 96, 0.1);
    border-bottom-color: var(--style-color);
}

/* Popup für Korrekturen */
#correction-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background-color: white;
    width: 90%;
    max-width: 500px;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.popup-header {
    padding: 15px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#correction-type {
    font-weight: bold;
}

#close-popup {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.popup-body {
    padding: 20px;
}

#correction-message {
    margin-bottom: 15px;
}

.correction-text {
    background-color: var(--bg-color);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.label {
    font-weight: bold;
    margin-right: 5px;
}

#reasoning-container {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

#reasoning-text {
    font-style: italic;
    color: var(--dark-gray);
    line-height: 1.4;
}

#custom-suggestion-container {
    margin-top: 10px;
}

#custom-suggestion-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    font-size: 14px;
    margin-top: 5px;
}

#custom-suggestion-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 111, 190, 0.2);
}

.popup-footer {
    padding: 15px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--light-gray);
    flex-wrap: wrap;
}

.edit-button {
    background-color: var(--warning-color);
}

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

.save-button {
    background-color: var(--style-color);
}

.save-button:hover {
    background-color: #229954;
}

.cancel-button {
    background-color: var(--dark-gray);
}

.cancel-button:hover {
    background-color: #5a5a5a;
}

/* API-Warnung Styles */
.api-warning {
    display: flex;
    align-items: center;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.warning-icon {
    font-size: 24px;
    margin-right: 10px;
}

.warning-message {
    font-size: 14px;
}

footer {
    text-align: center;
    margin-top: 30px;
    color: var(--dark-gray);
    font-size: 14px;
}



/* Loading Indicators */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-gray);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    border-right: 4px solid var(--primary-color);
    border-bottom: 4px solid transparent;
    border-left: 4px solid transparent;
    animation: spin 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    margin: 20px auto;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.loading-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--dark-gray);
}

.loading-message h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2em;
}

.loading-message p {
    margin-bottom: 20px;
    line-height: 1.5;
}

@keyframes spin {
    0% { 
        transform: rotate(0deg) translateZ(0);
    }
    100% { 
        transform: rotate(360deg) translateZ(0);
    }
}

/* Tab loading overlay */
.tab-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 4px;
}

.tab-loading-overlay .loading-spinner {
    margin-bottom: 20px;
}

.tab-loading-overlay .loading-text {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 16px;
}

/* Upload progress enhancements */
#upload-progress {
    position: relative;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#upload-progress .checkpoint-container {
    margin: 20px auto !important;
    width: 280px !important;
}

#upload-progress .loading-spinner {
    width: 30px;
    height: 30px;
    border-width: 3px;
    margin: 10px auto;
}

/* Hover-Highlighting für PDF-Annotationen */
.annotation-hover-highlight {
    transition: all 0.3s ease-in-out !important;
    animation: highlight-pulse 2s infinite !important;
}

@keyframes highlight-pulse {
    0% { 
        filter: drop-shadow(0 0 5px rgba(255, 0, 0, 0.8)) !important;
        opacity: 1 !important;
    }
    50% { 
        filter: drop-shadow(0 0 10px rgba(255, 0, 0, 1)) !important;
        opacity: 0.9 !important;
    }
    100% { 
        filter: drop-shadow(0 0 5px rgba(255, 0, 0, 0.8)) !important;
        opacity: 1 !important;
    }
}

/* Verstärkte Sichtbarkeit für gehäufte Annotationen */
.annotation-hover-highlight[fill*="red"] {
    fill: rgba(255, 0, 0, 0.9) !important;
    stroke: #ff0000 !important;
    stroke-width: 4 !important;
}

.annotation-hover-highlight[fill*="orange"] {
    fill: rgba(255, 165, 0, 0.9) !important;
    stroke: #ff8800 !important;
    stroke-width: 4 !important;
}

.annotation-hover-highlight[fill*="green"] {
    fill: rgba(0, 255, 0, 0.9) !important;
    stroke: #00ff00 !important;
    stroke-width: 4 !important;
}

/* ========== CHECKLISTE STYLING ========== */

/* Checkliste-Eingabebereich */
.checklist-input-section {
    background: white;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.checklist-input-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.checklist-creator {
    margin-bottom: 20px;
}

.checklist-creator textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 10px;
}

.checklist-creator textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 111, 190, 0.2);
}

.checklist-creator button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.checklist-creator button:hover {
    background: #1e4a84;
}

/* Checkliste-Vorschau */
.checklist-items-preview {
    margin-bottom: 20px;
}

.checklist-items-preview h4 {
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 1em;
}

.checklist-items-preview ul {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    background: #f8f9fa;
}

.checklist-items-preview li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--light-gray);
}

.checklist-items-preview li:last-child {
    border-bottom: none;
}

.checklist-item-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.remove-item-btn {
    background: var(--error-color);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    transition: background-color 0.3s;
}

.remove-item-btn:hover {
    background: #c0392b;
}

/* Checkliste-Buttons */
.primary-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.primary-button:hover:not(:disabled) {
    background: #1e4a84;
}

.primary-button:disabled {
    background: var(--light-gray);
    color: var(--dark-gray);
    cursor: not-allowed;
}

.secondary-button {
    background: transparent;
    color: var(--dark-gray);
    border: 1px solid var(--light-gray);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.secondary-button:hover {
    background: var(--light-gray);
    color: var(--text-color);
}

/* Checkliste-Ergebnisse */
/* Removed min-height override to use consistent styling with other tabs */

/* Checkliste-Tab-Content */
#checkliste {
    display: none;
}

#checkliste.active {
    display: block;
}


/* Responsive Design für Checkliste */
@media (max-width: 768px) {
    .checklist-input-section {
        padding: 15px;
    }
    
    .checklist-creator textarea {
        min-height: 100px;
    }
    
    .checklist-items-preview ul {
        max-height: 150px;
    }
    
    .checklist-item-text {
        font-size: 13px;
    }
}

/* Checklisten-spezifische Styles für erweiterte Anzeige */
.checklist-results {
    padding: 10px;
}

.checklist-results-header {
    margin-bottom: 20px;
}

.checklist-results-header h4 {
    margin: 0;
    color: var(--text-color);
}

.checklist-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checklist-item-group {
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    background: #fff;
}

.checklist-item-header {
    display: flex;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    background: #f5f5f5;
    transition: background 0.2s;
    user-select: none;
}

.checklist-item-header:hover {
    background: #ebebeb;
}

.checklist-arrow {
    font-size: 12px;
    margin-right: 10px;
    transition: transform 0.2s;
    color: var(--dark-gray);
}

.checklist-item-text {
    flex: 1;
    font-weight: 500;
    color: var(--text-color);
}

.checklist-item-number {
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 8px;
    min-width: 25px;
    display: inline-block;
}

.checklist-status {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.checklist-status.correction-style {
    background: #d4edda;
    color: #155724;
}

.checklist-status.correction-warning {
    background: #fff3cd;
    color: #856404;
}

.checklist-status.correction-error {
    background: #f8d7da;
    color: #721c24;
}

.checklist-findings {
    padding: 0 15px 15px 40px;
    background: #fafafa;
}

.checklist-finding {
    margin-top: 10px;
    padding: 10px;
    border-left: 3px solid;
    background: white;
    cursor: pointer;
    transition: box-shadow 0.2s;
    border-radius: 3px;
}

.checklist-finding:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.checklist-finding.correction-error {
    border-left-color: var(--error-color);
}

.checklist-finding.correction-warning {
    border-left-color: var(--warning-color);
}

.checklist-finding.correction-style {
    border-left-color: var(--style-color);
}

.finding-text {
    font-style: italic;
    color: #666;
    margin-bottom: 5px;
    font-size: 14px;
}

.finding-message {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.finding-suggestion {
    font-size: 13px;
    color: #555;
    margin-top: 5px;
    font-style: italic;
}

.checklist-no-findings {
    padding: 10px;
    text-align: center;
    color: #999;
    font-style: italic;
    font-size: 14px;
}

/* Hide batch buttons in checklist tab but keep layout */
#checkliste .action-buttons {
    visibility: hidden;
}

/* Style checklist title in top-checklist-section to match other tabs */
#top-checklist-section h2 {
    margin: 0 0 20px 0;
    padding: 0;
    font-size: 1.5em;
    font-weight: bold;
    color: inherit;
    background: transparent;
}

/* Position checklist section normally and add styling like previous-year-section */
#top-checklist-section {
    position: static;
    margin-top: 0;
    padding-top: 0;
}

#top-checklist-section .checklist-input-section {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Vorjahresvergleich Tab Styles - Match checklist box styling */
.previous-year-section {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.upload-previous-year,
.stored-reports-section {
    margin-bottom: 20px;
}

.comparison-section {
    margin-bottom: 20px;
}

#previous-year-dropdown {
    padding: 10px;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    font-size: 14px;
    width: auto;
    min-width: 200px;
    max-width: 600px;
    margin-bottom: 15px;
}

#previous-year-dropdown:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

