/* mitarbeiter1 - Basis-Styles */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #222121;
    margin: 0;
    padding: 20px;
    line-height: 1.5;
    color: #333;
}

h1, h2, h3 {
    margin-top: 0;
}

/* Login */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: #ececec;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.login-container h1 {
    margin-bottom: 5px;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
}

/* Formulare */
.container {
    max-width: 1000px;
    margin: 0 auto;
    background: #dddddd;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #7e5252;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333333;
}

.form-group textarea {
    min-height: 120px;
    font-family: monospace;
    resize: vertical;
}

/* Höhere Textareas für Anmelde-Mail und Impressum */
#anmelde_mail,
#impressum_text {
    height: 180px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-success {
    background: #28a745;
    color: #fff;
}

.btn-success:hover {
    background: #1e7e34;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-sm {
    padding: 10px 16px !important;
    font-size: 14px !important;
}

/* Nachrichten */
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.warning {
    background: #fff3cd;
    color: #856404;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.info {
    background: #d1ecf1;
    color: #0c5460;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Feldstatus */
.field-missing {
    border-color: #dc3545 !important;
    background: #fff5f5;
}

.field-uncertain {
    border-color: #ffc107 !important;
    background: #fffdf5;
}

.field-hint {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.field-hint.missing {
    color: #dc3545;
}

.field-hint.uncertain {
    color: #856404;
}

/* Vorschläge (klickbar) - untereinander */
.suggestions {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.suggestion-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
}

.suggestion-btn:hover {
    background: #545b62;
}

.suggestion-btn.selected {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* Input mit Copy-Button (links) */
.input-with-copy {
    display: flex;
    gap: 10px;
}

.input-with-copy input,
.input-with-copy select,
.input-with-copy textarea {
    flex: 1;
    order: 2;
}

.input-with-copy .copy-btn-small {
    order: 1;
}

.input-with-copy .btn {
    order: 3;
}

/* Horizontales Layout: Copy | Label | Input in einer Zeile */
.form-group-horizontal {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.form-group-horizontal label {
    min-width: 110px;
    margin-bottom: 0;
    font-weight: 600;
    color: #a74e4e;
    text-align: right;
}

.form-group-horizontal input,
.form-group-horizontal select {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333333;
}

.form-group-horizontal textarea {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333333;
    min-height: 80px;
    font-family: monospace;
    resize: vertical;
}

.form-group-horizontal input:focus,
.form-group-horizontal select:focus,
.form-group-horizontal textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.copy-btn-small {
    padding: 10px 16px;
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.copy-btn-small:hover {
    background: #545b62;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.header h1 {
    margin: 0;
}

/* Sections */
.section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    /* border-bottom: 1px solid #eee; */ /* Entfernt für kompaktere Ansicht */
}

.section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section h2 {
    font-size: 18px;
    color: #495057;
    margin-bottom: 20px;
}

/* Mail Output */
.mail-output {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 20px;
    font-family: monospace;
    white-space: pre-wrap;
    font-size: 13px;
}

.mail-output .copy-btn {
    float: right;
    margin: -10px -10px 10px 10px;
}

/* Review-Seite: Textareas für Anmeldung und Impressum 30% höher */
textarea[name="anmelde_mail_display"],
textarea[name="impressum_text_display"] {
    height: 234px;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }
}

/* E-Mail Tab-System */
.email-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.email-tab {
    flex: 1;
    padding: 10px 16px;
    background: #6c757d;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    color: #fff;
    transition: all 0.15s ease;
    text-align: center;
}

.email-tab:first-child {
    border-radius: 4px 0 0 0;
}

.email-tab:last-child {
    border-radius: 0 4px 0 0;
}

.email-tab:hover {
    background: #545b62;
}

.email-tab.active {
    background: #007bff;
    color: #fff;
    font-weight: 600;
}

.email-content {
    background: #dddddd;
    border: none;
    border-radius: 0 0 6px 6px;
    padding: 20px;
}

/* E-Mail Toolbar */
.email-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.email-toolbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.email-toolbar-right {
    display: flex;
    gap: 10px;
}

.email-mode-buttons {
    display: flex;
    gap: 8px;
}

.email-mode-btn {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 10px 16px !important;
    font-size: 14px !important;
    cursor: pointer;
    transition: all 0.15s ease;
}

/* Alle Buttons im E-Mail-Bereich gleich groß */
.email-toolbar .btn,
.email-copy-row .btn,
.email-signature-header .btn {
    padding: 10px 16px !important;
    font-size: 14px !important;
}

.email-mode-btn:hover {
    background: #545b62;
}

.email-mode-btn.active {
    background: #007bff;
    color: #fff;
}

/* E-Mail Vorschau */
.email-preview {
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    padding: 25px;
    min-height: 1350px;
    max-height: 1600px;
    overflow-y: auto;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.email-preview a {
    color: #007bff;
    text-decoration: underline;
}

/* E-Mail Editor */
.email-editor {
    width: 100%;
    min-height: 1575px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    padding: 20px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    resize: vertical;
    line-height: 1.5;
    color: #333;
}

.email-editor:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* Copy Button unter Textbereich */
.email-copy-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

/* Signatur-Bereich */
.email-signature-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.email-signature-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.email-signature-editor {
    width: 100%;
    min-height: 200px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    padding: 15px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    resize: vertical;
    line-height: 1.5;
    color: #333;
}

.email-signature-editor:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.email-signature-preview {
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    padding: 20px;
    min-height: 200px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.email-signature-preview a {
    color: #337ab7;
    text-decoration: none;
}

/* E-Mail Header */
.email-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.email-subject-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.email-subject-row label {
    font-weight: 600;
    color: #7e5252;
    min-width: 70px;
}

.email-subject-row input {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
}

.email-subject-row input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* E-Mail Status */
.email-status {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
}

.email-status.success {
    background: #d4edda;
    color: #155724;
}

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

.email-status.info {
    background: #d1ecf1;
    color: #0c5460;
}

/* E-Mail Send Status (unter dem Button, volle Breite) */
.email-send-status {
    margin-top: 15px;
    margin-bottom: 10px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
}

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

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

/* Gespeicherte Vorlagen */
.saved-templates-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.saved-templates-header {
    margin-bottom: 10px;
}

.saved-templates-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.saved-templates-row select {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
}

.saved-templates-row input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
}

.saved-templates-row input:focus,
.saved-templates-row select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

#saved-templates-status {
    margin-top: 10px;
}
