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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding-bottom: 60px;
}

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

/* Header Section */
.header-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo-upload {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.logo-preview {
    width: 120px;
    height: 120px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    background: #fafafa;
    transition: border-color 0.3s;
}

.logo-preview:hover {
    border-color: #007bff;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-preview-text {
    text-align: center;
    color: #999;
    font-size: 12px;
    padding: 10px;
}

.header-fields {
    flex: 1;
}

.header-fields input,
.header-fields textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 12px;
    transition: border-color 0.3s;
}

.header-fields input:focus,
.header-fields textarea:focus {
    outline: none;
    border-color: #007bff;
}

.header-fields input[name="title"] {
    font-size: 20px;
    font-weight: 600;
}

.header-fields textarea {
    min-height: 80px;
    resize: vertical;
}

/* Steps Section */
.steps-container {
    margin-bottom: 24px;
}

.step-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    transition: box-shadow 0.3s, transform 0.2s;
}

.step-card.dragging {
    opacity: 0.5;
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.step-card.drag-over {
    border: 2px dashed #007bff;
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.step-number {
    font-weight: 600;
    color: #007bff;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.drag-handle {
    cursor: grab;
    color: #999;
    padding: 4px;
}

.drag-handle:active {
    cursor: grabbing;
}

.step-actions {
    display: flex;
    gap: 8px;
}

.step-actions button {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.step-actions button:hover {
    background: #f0f0f0;
}

.step-actions button.delete:hover {
    background: #fee;
    border-color: #f00;
    color: #f00;
}

.step-content {
    display: flex;
    gap: 20px;
}

/* Image Upload */
.step-image {
    flex: 0 0 300px;
    min-height: 200px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    background: #fafafa;
    position: relative;
    transition: border-color 0.3s;
}

.step-image:hover {
    border-color: #007bff;
}

.step-image.has-image {
    border-style: solid;
}

.step-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.step-image-placeholder {
    text-align: center;
    color: #999;
    padding: 20px;
}

.step-image-placeholder svg {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
    fill: #ccc;
}

.image-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,0,0,0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: none;
    font-size: 14px;
    line-height: 1;
}

.step-image.has-image .image-remove {
    display: block;
}

/* Rich Text Editor */
.step-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.editor-toolbar {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    flex-wrap: wrap;
}

.editor-toolbar button {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    min-width: 32px;
}

.editor-toolbar button:hover {
    background: #e8e8e8;
}

.editor-toolbar button.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.editor-content {
    flex: 1;
    min-height: 150px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 0 0 6px 6px;
    outline: none;
    overflow-y: auto;
}

.editor-content:focus {
    border-color: #007bff;
}

/* Add Step Divider */
.add-step-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
}

.add-step-divider hr {
    flex: 1;
    border: none;
    border-top: 2px dashed #ddd;
}

.add-step-btn {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    margin: 0 16px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-step-btn:hover {
    background: #0056b3;
    transform: scale(1.1);
}

/* Export Section */
.export-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

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

.section-header h3 {
    margin: 0;
    color: #333;
}

.new-btn {
    background: #ffc107;
    color: #212529;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.new-btn:hover {
    background: #e0a800;
}

.export-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.export-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-btn.html {
    background: #28a745;
    color: white;
}

.export-btn.html:hover {
    background: #218838;
}

.export-btn.pdf {
    background: #dc3545;
    color: white;
}

.export-btn.pdf:hover {
    background: #c82333;
}

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

.export-btn.json:hover {
    background: #5a6268;
}

.export-btn.import {
    background: #17a2b8;
    color: white;
}

.export-btn.import:hover {
    background: #138496;
}

.export-btn.docx {
    background: #2b579a;
    color: white;
}

.export-btn.docx:hover {
    background: #1e3f6f;
}

.export-btn.docx-import {
    background: #5b9bd5;
    color: white;
}

.export-btn.docx-import:hover {
    background: #4a89c4;
}

.export-btn.docx-import:disabled {
    background: #9cc4e8;
    cursor: not-allowed;
}

/* Loading Spinner für Import */
.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* PDF Options Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 8px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
}

.modal h3 {
    margin-bottom: 16px;
}

.modal label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.modal select,
.modal input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 16px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-buttons button {
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.modal-buttons .cancel {
    background: #f0f0f0;
    border: 1px solid #ddd;
}

.modal-buttons .confirm {
    background: #007bff;
    color: white;
    border: none;
}

/* Footer */
.license-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #333;
    color: white;
    padding: 12px;
    text-align: center;
    font-size: 12px;
}

.license-footer a {
    color: #7fb3ff;
    text-decoration: none;
}

.license-footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .step-content {
        flex-direction: column;
    }

    .step-image {
        flex: none;
        width: 100%;
        min-height: 150px;
    }

    .logo-upload {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Hidden file inputs */
input[type="file"] {
    display: none;
}
