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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Header Styles */
.header {
    background-color: #FCE531;
    color: #2181E3;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

.header-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.header-text {
    flex: 1;
}

.header-logout {
    margin-left: auto;
}

.logout-btn {
    padding: 0.6rem 1.2rem;
    background-color: white;
    color: #2181E3;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    border: 2px solid white;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.logout-btn:hover {
    background-color: transparent;
    color: white;
    border-color: white;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.header-subtitle {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.95;
}

/* Navigation Styles */
.navigation {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-start;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 1.2rem 1.8rem;
    text-decoration: none;
    color: #333;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
    background-color: #f8f8f8;
    color: #2181E3;
    border-bottom-color: #2181E3;
}

.nav-link.active {
    color: #2181E3;
    border-bottom-color: #2181E3;
    background-color: #fafafa;
}

.nav-link-down {
    display: block;
    padding: 1.2rem 1.8rem;
    text-decoration: none;
    background-color: #f8f8f8;
    color: #2181E3;
    border-bottom-color: #2181E3;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-link-down:hover {
    background-color: #b8b7b7;
    color: #2181E3;
    border-bottom-color: #2181E3;
}

.nav-link-down.active {
    color: #2181E3;
    border-bottom-color: #2181E3;
    background-color: #fafafa;
}

/* Main Content Area */
.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.content-card {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.content-card h2 {
    color: #2181E3;
    margin-bottom: 1rem;
    font-size: 1.6rem;
    font-weight: 600;
}

.content-card p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    background-color: #2181E3;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    background-color: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(238, 0, 0, 0.2);
}

.btn-secondary {
    background-color: #fff;
    color: #2181E3;
    border: 2px solid #2181E3;
}

.btn-secondary:hover {
    background-color: #2181E3;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-logo {
        height: 45px;
    }

    .header h1 {
        font-size: 1.4rem;
    }

    .header-subtitle {
        font-size: 0.9rem;
    }

    .nav-container {
        overflow-x: auto;
    }

    .nav-link {
        padding: 1rem 1.2rem;
        font-size: 0.95rem;
        white-space: nowrap;
    }

    .main-content {
        padding: 0 1rem;
        margin: 1rem auto;
    }

    .content-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1rem 1rem;
    }

    .header-content {
        gap: 1rem;
    }

    .header-logo {
        height: 35px;
    }

    .header h1 {
        font-size: 1.2rem;
    }

    .nav-link {
        padding: 0.9rem 1rem;
        font-size: 0.9rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* Upload Page Styles */
.upload-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.upload-box {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-box h3 {
    color: #2181E3;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.file-upload-wrapper {
    position: relative;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 0.1px;
    height: 0.1px;
    overflow: hidden;
    z-index: -1;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background-color: #f8f8f8;
    border: 2px dashed #ccc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover {
    background-color: #fff5f5;
    border-color: #2181E3;
}

.file-input:focus+.file-label {
    outline: 2px solid #2181E3;
    outline-offset: 2px;
}

.upload-icon {
    width: 40px;
    height: 40px;
    color: #2181E3;
    margin-bottom: 0.8rem;
    stroke-width: 2;
}

.file-label-text {
    color: #666;
    font-size: 0.95rem;
    font-weight: 500;
}

.filename-display {
    padding: 0.8rem 1rem;
    background-color: #f0f0f0;
    border-radius: 4px;
    font-size: 0.95rem;
    color: #333;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    word-break: break-all;
}

.filename-display:empty::before {
    content: 'Keine Datei ausgewählt';
    color: #999;
}

.upload-status {
    padding: 0.8rem 1rem;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-status.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.upload-status.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.upload-status.loading {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Upload Button - Kombinierte Definition */
.upload-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 250px;
}

.upload-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.upload-btn:disabled:hover {
    background-color: #ccc;
    transform: none;
    box-shadow: none;
}

.btn-text {
    display: inline;
}

/* Gleich breite Buttons in einer Button-Gruppe */
.button-group>button {
    flex: 0 0 260px;
    /* feste einheitliche Breite */
    display: flex;
    justify-content: center;
}

/* Auf kleinerem Bildschirm */
@media (max-width: 480px) {
    .button-group {
        flex-direction: column;
        align-items: center;
    }

    .button-group>button {
        flex: 0 0 100%;
        max-width: 340px;
    }
}


/* Spinner Styling */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: none;
    /* Standardmäßig versteckt! */
    vertical-align: middle;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.upload-form-combined {
    margin-top: 2rem;
}

.user-id-container {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.user-id-label {
    display: block;
    margin-bottom: 0.8rem;
    color: #333;
    font-weight: 600;
}

.label-text {
    display: block;
    font-size: 1.1rem;
    color: #2181E3;
    margin-bottom: 0.3rem;
}

.label-hint {
    display: block;
    font-size: 0.9rem;
    color: #666;
    font-weight: 400;
}

.user-id-input {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.1em;
}

.user-id-input:focus {
    outline: none;
    border-color: #2181E3;
    box-shadow: 0 0 0 3px rgba(238, 0, 0, 0.1);
}

.user-id-input:invalid:not(:placeholder-shown) {
    border-color: #dc3545;
}

.user-id-input:valid {
    border-color: #28a745;
}

.field-error {
    margin-top: 0.5rem;
    color: #dc3545;
    font-size: 0.9rem;
    min-height: 1.2rem;
}

.upload-button-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive Upload Layout */
@media (max-width: 968px) {
    .upload-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .upload-box {
        padding: 1.5rem;
    }

    .file-label {
        padding: 2rem 1rem;
    }

    .upload-icon {
        width: 36px;
        height: 36px;
    }
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem;
}

.login-box {
    background-color: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 450px;
}

.login-box h2 {
    color: #2181E3;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    text-align: center;
}

.login-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 600;
    font-size: 1rem;
}

.form-input {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #2181E3;
    box-shadow: 0 0 0 3px rgba(238, 0, 0, 0.1);
}

.form-input[type="text"] {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.1em;
}

.form-hint {
    display: block;
    margin-top: 0.4rem;
    color: #666;
    font-size: 0.85rem;
}

.login-error {
    display: none;
    padding: 0.8rem 1rem;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.login-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.05rem;
    margin-top: 0.5rem;
}

.user-info {
    padding: 0.8rem 1.2rem;
    background-color: #f0f0f0;
    border-left: 4px solid #2181E3;
    border-radius: 4px;
    margin-top: 1rem;
}

.user-info strong {
    color: #2181E3;
}

@media (max-width: 480px) {
    .login-box {
        padding: 2rem 1.5rem;
    }

    .login-container {
        padding: 1rem;
    }
}

/* Settings Page Styles */
.settings-form {
    margin-top: 2rem;
}

.settings-section {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.settings-section h3 {
    color: #2181E3;
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

.settings-description {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.form-select {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: #2181E3;
    box-shadow: 0 0 0 3px rgba(238, 0, 0, 0.1);
}

.settings-actions {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.settings-status {
    padding: 0.8rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-status.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.settings-status.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.settings-status.loading {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.settings-status.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.button-group {
    display: flex;
    gap: 1rem;
}

.btn-primary {
    flex: 1;
}

.btn-secondary {
    flex: 1;
}

@media (max-width: 768px) {
    .settings-section {
        padding: 1.5rem;
    }

    .button-group {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}

/* OCR Option Styling */
.ocr-option {
    margin: 2rem auto;
    max-width: 800px;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0.5rem;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    height: 24px;
    width: 24px;
    background-color: #fff;
    border: 2px solid #dc0814;
    border-radius: 4px;
    margin-right: 12px;
    transition: all 0.3s ease;
}

.checkbox-container:hover input~.checkmark {
    background-color: #f8f9fa;
}

.checkbox-container input:checked~.checkmark {
    background-color: #dc0814;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.checkbox-label {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.option-description {
    margin: 0.5rem 0 0 36px;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* weichere, performante Übersetzung */
.pdf-canvas {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: block;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

/* die Scrollfläche etwas höher, damit man vernünftig „Greifweg" hat */
.sync-scroll-wrapper {
    height: 20vh;
    /* vorher 10vh */
}

/* Task Selector Button Styles - NEU */
.task-selector {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.task-selector .form-group {
    margin-bottom: 1.5rem;
}

.task-selector .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.task-selector .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.task-selector .form-group select:hover {
    border-color: #2181E3;
}

.task-selector .form-group select:focus {
    outline: none;
    border-color: #2181E3;
    box-shadow: 0 0 0 3px rgba(238, 0, 0, 0.1);
}

.task-description-box {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #2181E3;
}

.task-description-box p {
    margin: 0;
    color: #666;
}

.execute-btn {
    flex: 1;
    min-width: 200px;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #2181E3 0%, #2181E3 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.execute-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(238, 0, 0, 0.3);
}

.execute-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pdf-view-btn {
    flex: 1;
    min-width: 200px;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #666 0%, #555 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.pdf-view-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 102, 102, 0.3);
}

.pdf-view-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.load-result-btn {
    flex: 1;
    min-width: 200px;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.load-result-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.load-result-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
    }

    .execute-btn,
    .pdf-view-btn,
    .load-result-btn {
        width: 100%;
    }
}

.workflow-section {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.workflow-section h2 {
    color: #2181E3;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
    font-weight: 600;
    border-bottom: 2px solid #2181E3;
    padding-bottom: 0.5rem;
}

.workflow-section h3 {
    color: #333;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.workflow-intro {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    margin: 1rem 0;
}

.checkbox-container input[type="checkbox"] {
    /* Native Checkbox verstecken */
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

.checkbox-label {
    position: relative;
    padding-left: 32px;
    line-height: 1.6;
}

/* Custom Checkbox Box */
.checkbox-label::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    border: 2px solid #4a90e2;
    border-radius: 4px;
    background-color: white;
    transition: all 0.2s ease;
}

/* Checkmark (Häkchen) */
.checkbox-label::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 5px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Checked State */
.checkbox-container input[type="checkbox"]:checked+.checkbox-label::before {
    background-color: #4a90e2;
    border-color: #4a90e2;
}

.checkbox-container input[type="checkbox"]:checked+.checkbox-label::after {
    opacity: 1;
}

/* Hover Effect */
.checkbox-container:hover input[type="checkbox"]:not(:checked)+.checkbox-label::before {
    border-color: #357abd;
}

/* Focus State für Accessibility */
.checkbox-container input[type="checkbox"]:focus+.checkbox-label::before {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}