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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Login-Seite */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 400px;
}

.login-container h1 {
    margin-bottom: 10px;
    color: #333;
    font-size: 24px;
    text-align: center;
}

.login-container p {
    margin-bottom: 20px;
    color: #666;
    text-align: center;
}

.password-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

.password-input:focus {
    outline: none;
    border-color: #667eea;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    border: 1px solid #f5c6cb;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background-color: #667eea;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    margin: 5px;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.btn-secondary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Hauptseite Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    min-height: 100vh;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 3px solid #667eea;
    margin-bottom: 30px;
}

header h1 {
    font-size: 24px;
    color: #333;
}

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

.logout-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.logout-link:hover {
    color: #5568d3;
    text-decoration: underline;
}

/* Save Status - Floating oben rechts */
.save-status {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 6px;
    min-width: 130px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.save-status.saving {
    color: #856404;
    background-color: #fff3cd;
    border: 2px solid #ffc107;
}

.save-status.saved {
    color: #155724;
    background-color: #d4edda;
    border: 2px solid #28a745;
}

.save-status.error {
    color: #721c24;
    background-color: #f8d7da;
    border: 2px solid #dc3545;
}

/* Member Selector */
.member-selector {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.member-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.member-selector select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.member-selector select:focus {
    outline: none;
    border-color: #667eea;
}

/* Data Form */
.data-form {
    margin-top: 30px;
}

.data-form h2 {
    color: #667eea;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

/* Form Groups */
.form-group {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
    position: relative;
}

.form-group:last-of-type {
    border-bottom: none;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    line-height: 1.4;
}

.max-chars {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: #6c757d;
    margin-top: 4px;
}

.hint {
    display: block;
    font-weight: 400;
    font-size: 13px;
    color: #6c757d;
    font-style: italic;
    margin-top: 4px;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
    line-height: 1.5;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Character Counter */
.char-counter {
    text-align: right;
    font-size: 13px;
    color: #6c757d;
    margin-top: 5px;
    font-weight: 500;
}

.char-counter .current {
    font-weight: 700;
    color: #333;
}

/* History Controls */
.history-controls {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Field History Controls (unter jedem Feld) */
.field-history-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.btn-field-small {
    padding: 6px 12px;
    font-size: 13px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-undo {
    background-color: #6c757d;
    color: white;
}

.btn-undo:hover:not(:disabled) {
    background-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.btn-redo {
    background-color: #6c757d;
    color: white;
}

.btn-redo:hover:not(:disabled) {
    background-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.btn-undo:disabled,
.btn-redo:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

/* No Selection Message */
.no-selection {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-selection p {
    font-size: 18px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    header h1 {
        font-size: 20px;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .save-status {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 12px;
        min-width: 100px;
    }
    
    .history-controls {
        flex-direction: column;
    }
    
    .btn-secondary {
        width: 100%;
        margin: 5px 0;
    }
    
    .field-history-controls {
        justify-content: flex-start;
    }
}

/* Animationen */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.data-form {
    animation: fadeIn 0.3s ease-out;
}

/* === BILD-UPLOAD STYLING === */

.image-upload-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 3px solid #667eea;
}

/* Drop Zone */
.drop-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border: 3px dashed #ccc;
    border-radius: 10px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 30px;
}

.drop-zone:hover {
    border-color: #667eea;
    background-color: #f0f2ff;
}

.drop-zone.drag-over {
    border-color: #667eea;
    background-color: #e6e9ff;
    transform: scale(1.02);
}

.drop-zone-content {
    text-align: center;
}

.upload-icon {
    color: #667eea;
    margin-bottom: 15px;
}

.drop-zone-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.drop-zone-hint {
    font-size: 14px;
    color: #6c757d;
}

/* Bild-Vorschau */
.image-preview {
    margin-top: 20px;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 500px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    object-fit: contain;
}

.image-actions {
    margin-top: 15px;
}

.btn-delete-image {
    padding: 10px 20px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-delete-image:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}
