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

/* ===== ADDITIONAL HELP MODAL STYLES ===== */

/* Help Modal Header */
.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-shrink: 0;
}

.help-modal-title h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-modal-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Search Container */
.help-search-container {
    position: relative;
    display: flex;
    align-items: center;
}

#helpSearch {
    width: 280px;
    padding: 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    transition: all 0.2s;
}

#helpSearch::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

#helpSearch:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* Search Results Dropdown */
.help-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 2001;
    display: none;
    border: 1px solid #e5e7eb;
}

.help-search-result {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f3f4f6;
}

.help-search-result:hover {
    background: #f8f9fa;
}

.help-search-result:last-child {
    border-bottom: none;
}

.help-search-result-header {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    margin-bottom: 4px;
}

.help-search-result-snippet {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

.help-search-result-snippet mark {
    background: #fef3c7;
    color: #92400e;
    padding: 1px 2px;
    border-radius: 2px;
}

.help-search-no-results {
    padding: 16px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    font-style: italic;
}

/* Close Button */
.help-modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.help-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

/* Help Modal Body */
.help-modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.help-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    line-height: 1.6;
    font-size: 14px;
    color: #374151;
}

/* Loading Animation */
.help-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #6b7280;
}

.help-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* Help Content Styling */
.help-content h1 {
    color: #111827;
    font-size: 28px;
    font-weight: 700;
    margin: 32px 0 16px 0;
    border-bottom: 3px solid #3b82f6;
    padding-bottom: 8px;
}

.help-content h2 {
    color: #1f2937;
    font-size: 22px;
    font-weight: 600;
    margin: 28px 0 12px 0;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 6px;
}

.help-content h3 {
    color: #374151;
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 10px 0;
}

.help-content h4 {
    color: #4b5563;
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 8px 0;
}

.help-content h5 {
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    margin: 16px 0 6px 0;
}

.help-content p {
    margin: 12px 0;
    line-height: 1.7;
}

.help-content ul, .help-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.help-content li {
    margin: 6px 0;
    line-height: 1.6;
}

.help-content li::marker {
    color: #3b82f6;
}

.help-content code {
    background: #f3f4f6;
    color: #1f2937;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
}

.help-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.help-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.help-content blockquote {
    border-left: 4px solid #3b82f6;
    background: #f8fafc;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #4b5563;
}

.help-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 13px;
}

.help-content th,
.help-content td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.help-content th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.help-content a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.help-content a:hover {
    text-decoration: underline;
    color: #2563eb;
}

/* Highlight Animation */
.help-highlight {
    background: #fef3c7 !important;
    transition: background-color 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
    margin: -4px -8px;
}

/* Error Display */
.help-error {
    padding: 24px;
    text-align: center;
    color: #ef4444;
}

.help-error h2 {
    color: #dc2626;
    margin-bottom: 16px;
}

.help-error ul {
    text-align: left;
    max-width: 500px;
    margin: 16px auto;
}

.help-error ol {
    text-align: left;
    max-width: 500px;
    margin: 16px auto;
}

/* Help Modal Footer */
.help-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}

/* Help Button Styles */
.help-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.help-btn-primary {
    background: #3b82f6;
    color: white;
}

.help-btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.help-btn-secondary {
    background: #6b7280;
    color: white;
}

.help-btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3);
}

/* Help Button in Header */
.help-button {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

.help-button:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

/* Responsive Help Button */
@media (max-width: 768px) {
    .help-button {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .help-modal-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        max-height: none;
    }
    
    .help-modal-header {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }
    
    .help-modal-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    #helpSearch {
        width: 100%;
        max-width: 250px;
    }
    
    .help-modal-title h2 {
        font-size: 18px;
        text-align: center;
    }
    
    .help-content {
        padding: 16px;
        font-size: 13px;
    }
    
    .help-content h1 {
        font-size: 24px;
    }
    
    .help-content h2 {
        font-size: 20px;
    }
    
    .help-content h3 {
        font-size: 16px;
    }
    
    .help-modal-footer {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }
    
    .help-btn {
        width: 100%;
        justify-content: center;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.5;
}

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

.header {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

.header {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.search-container {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.2s;
    background: #f8fafc;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #ef4444;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
}

.btn-clear:hover {
    background: #dc2626;
    transform: translateY(-50%) scale(1.1);
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #6b7280;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-export {
    background: #059669;
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

.btn-export:hover {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.3);
}

.btn-export:active {
    transform: translateY(0);
}

.btn-batch {
    background: #8b5cf6;
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.2);
}

.btn-batch:hover {
    background: #7c3aed;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.3);
}

.btn-batch:active {
    transform: translateY(0);
}

.btn-danger {
    background: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    min-width: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.project-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.project-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.project-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 12px;
}

.project-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

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

.step-list {
    margin: 16px 0;
}

.step-item {
    background: #f1f5f9;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.step-content {
    flex: 1;
}

.step-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.step-description {
    font-size: 12px;
    color: #64748b;
}

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

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    position: relative;
}

/* Spezielle Modal-Größe für Image Editor */
#imageEditorModal .modal-content {
    max-width: 98vw;
    max-height: 98vh;
    width: auto;
    height: auto;
    min-width: 900px;
    min-height: 800px;
    display: flex;
    flex-direction: column;
    padding: 16px;
}

/* Mobile-Optimierung für Image Editor Modal */
@media (max-width: 768px) {
    #imageEditorModal .modal-content {
        max-width: 100vw !important;
        max-height: 100vh !important;
        width: 100vw !important;
        height: 100vh !important;
        min-width: unset !important;
        min-height: unset !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    #imageEditorModal {
        align-items: stretch !important;
        justify-content: stretch !important;
    }
}

#imageEditorModal .editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: none;
    margin: 5px 0;
    min-height: 0; /* Wichtig für Flexbox */
}

#imageEditorModal .canvas-container {
    flex: 1;
    min-height: 600px;
    max-height: calc(98vh - 220px); /* Mehr Höhe verfügbar */
    overflow: auto; /* Scrollbar wenn nötig */
}

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

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    padding: 4px;
}

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

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.editor-container {
    width: 100%;
    max-width: 900px;
    margin: 20px 0;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px; /* Weniger Padding */
    background: #f1f5f9;
    border-radius: 8px;
    margin-bottom: 6px; /* Weniger Margin */
    flex-shrink: 0; /* Verhindert Schrumpfung */
}

.tool-group {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.tool-btn {
    background: none;
    border: none;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: #e2e8f0;
}

.tool-btn.active {
    background: #3b82f6;
    color: white;
}

.canvas-container {
    position: relative;
    border: 2px solid #e2e8f0;
    border-radius: 0 0 8px 8px;
    background: white;
    overflow: hidden;
    border-top: none;
}

.editor-canvas {
    display: block;
    cursor: crosshair;
    max-width: 100%;
    max-height: none; /* Entferne Höhenbeschränkung */
    object-fit: contain;
    background: #fff;
    border: 1px solid #e2e8f0;
    margin: 0 auto;
}

/* Sicherstellen dass das Canvas korrekt in Container skaliert */
#editorCanvas {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Canvas Container Verbesserungen */
.canvas-container {
    position: relative;
    border: 2px solid #e2e8f0;
    border-radius: 0 0 8px 8px;
    background: white;
    overflow: auto; /* Scrollbar bei Bedarf */
    border-top: none;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px;
    min-height: 400px;
    width: 100%;
    box-sizing: border-box;
}

.annotation-item {
    position: absolute;
    cursor: move;
    user-select: none;
}

.annotation-item.selected {
    border: 2px dashed #3b82f6;
}

.annotation-number {
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.annotation-text {
    background: rgba(59, 130, 246, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
}

.color-picker {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.line-width-slider {
    width: 80px;
}

.step-editor {
    width: 100%;
    max-width: 1000px;
}

.sortable-list {
    min-height: 100px;
}

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

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

/* Export Dropdown Styling */
.export-dropdown-container {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
    flex-wrap: wrap;
}

.export-select {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTQgNkw4IDEwTDEyIDYiIHN0cm9rZT0iIzZiNzI4MCIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9zdmc+Cg==');
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.export-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.export-select:hover {
    border-color: #94a3b8;
}

.export-select option {
    padding: 8px 12px;
    font-size: 14px;
}

#executeExportBtn {
    min-width: 140px;
    padding: 8px 16px;
    font-weight: 600;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

#executeExportBtn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;
}

#executeExportBtn:disabled:hover {
    background: #94a3b8;
    transform: none;
}

#executeExportBtn:not(:disabled):hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary {
    background: #3b82f6;
}

.btn-primary:hover {
    background: #2563eb;
}

/* Loading Animation für Export Button */
#executeExportBtn.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Responsive Design für Export Dropdown */
@media (max-width: 768px) {
    .export-dropdown-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .export-select {
        min-width: 100%;
    }
    
    #executeExportBtn {
        min-width: 100%;
    }
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.export-options .btn {
    font-size: 12px;
    padding: 6px 10px;
    white-space: nowrap;
    min-width: 140px;
}

.hidden {
    display: none !important;
}

.step-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 8px;
}

.image-placeholder {
    width: 100%;
    height: 120px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.image-placeholder:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.image-placeholder.drag-over {
    border-color: #10b981;
    background-color: #ecfdf5;
    color: #10b981;
}

.image-controls {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn-image-control {
    padding: 4px 8px;
    font-size: 12px;
}

.file-input {
    display: none;
}

/* Resize/Rotate Handles */
.resize-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border: 1px solid white;
    border-radius: 50%;
}

.resize-handle-se {
    bottom: -4px;
    right: -4px;
    cursor: nwse-resize;
}

.resize-handle-ne {
    top: -4px;
    right: -4px;
    cursor: nesw-resize;
}

.resize-handle-sw {
    bottom: -4px;
    left: -4px;
    cursor: nesw-resize;
}

.resize-handle-nw {
    top: -4px;
    left: -4px;
    cursor: nwse-resize;
}

.rotate-handle {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: #10b981;
    border: 2px solid white;
    border-radius: 50%;
    cursor: grab;
}

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

/* Properties Panel - Top Toolbar (Inline) */
.properties-toolbar {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
    padding: 4px 8px; /* Weniger Padding */
    margin-bottom: 0;
    border-bottom: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* Weniger Gap */
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 32px; /* Geringere Höhe */
    font-size: 12px;
    flex-shrink: 0; /* Verhindert Schrumpfung */
}

.properties-toolbar.always-visible {
    display: flex;
}

.properties-content {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    flex: 1;
}

.no-selection {
    color: #64748b;
    font-size: 12px;
    font-style: italic;
}

.properties-toolbar h3 {
    font-size: 12px;
    font-weight: 600;
    margin: 0;
    color: #334155;
    min-width: 80px;
}

/* Canvas Container für relative Positionierung */
.editor-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
}

/* Property Group für horizontale Toolbar */
.property-group {
    display: none; /* Versteckt per Standard, werden nur in den Content-Bereich geklont */
    align-items: center;
    gap: 6px;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    min-width: fit-content;
    font-size: 11px;
}

.property-group:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.btn-close-properties {
    background: none;
    border: none;
    font-size: 16px;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    margin-left: auto;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-properties:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.property-label {
    font-size: 10px;
    font-weight: 500;
    min-width: 45px;
    color: #475569;
    flex-shrink: 0;
    white-space: nowrap;
    text-align: left;
}

.property-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
    cursor: pointer;
}

.property-checkbox:hover {
    background: rgba(59, 130, 246, 0.1);
}

.property-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.property-checkbox label {
    cursor: pointer;
    font-size: 12px;
    margin: 0;
}

/* Verbesserte Input-Styles für Properties Panel */
.properties-toolbar input[type="color"] {
    width: 28px;
    height: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.properties-toolbar input[type="color"]:hover {
    border-color: #3b82f6;
}

.properties-toolbar input[type="range"] {
    flex: 1;
    max-width: 80px;
    height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
    outline: none;
    cursor: pointer;
}

.properties-toolbar input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 1px solid white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.properties-toolbar input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 1px solid white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.properties-toolbar select {
    padding: 2px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: white;
    font-size: 10px;
    cursor: pointer;
    max-width: 100px;
}

.properties-toolbar select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.1);
}

/* Value Display Spans */
.properties-toolbar span[id$="Display"] {
    font-size: 9px;
    font-weight: 500;
    color: #64748b;
    min-width: 25px;
    text-align: center;
    background: rgba(248, 250, 252, 0.8);
    padding: 1px 4px;
    border-radius: 2px;
}

/* Text Input Overlay */
.text-input-overlay {
    position: absolute;
    padding: 4px 8px;
    border: 2px solid #3b82f6;
    border-radius: 4px;
    background: white;
    font-family: Arial, sans-serif;
    font-size: 16px;
    min-width: 100px;
    z-index: 100;
    display: none;
}

.text-input-overlay:focus {
    outline: none;
}

/* Text Style Buttons */
.text-style-buttons {
    display: flex;
    gap: 2px;
    margin-left: 8px;
}

.style-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
}

.style-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.style-btn.active {
    background: #3b82f6;
    border-color: #2563eb;
    color: white;
}

.style-btn b {
    font-weight: 900;
}

.style-btn i {
    font-style: italic;
    font-weight: normal;
}

.style-btn u {
    text-decoration: underline;
    font-weight: normal;
}

.style-btn s {
    text-decoration: line-through;
    font-weight: normal;
}

/* Shape fill patterns */
.shape-filled {
    fill-opacity: 0.3;
}

/* Transparency Slider */
.transparency-slider {
    width: 100px;
}

/* Responsive Design für kleinere Bildschirme */
@media (max-width: 1024px) {
    .properties-toolbar {
        padding: 8px 12px;
        gap: 12px;
    }
    
    .property-group {
        padding: 6px 8px;
        gap: 6px;
    }
    
    .property-label {
        min-width: 50px;
        font-size: 11px;
    }
    
    .properties-toolbar h3 {
        font-size: 13px;
        min-width: 80px;
    }
    
    .properties-content {
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .properties-toolbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
        gap: 8px;
    }
    
    .properties-toolbar h3 {
        align-self: center;
        margin-bottom: 8px;
    }
    
    .properties-content {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }
    
    .property-group {
        width: 100%;
        max-width: 300px;
        justify-content: space-between;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .no-selection {
        text-align: center;
        width: 100%;
    }
}

/* ===== HELP MODAL STYLES ===== */

/* Prevent body scroll when modal is open */
body.help-modal-open {
    overflow: hidden;
}

/* Help Modal Container */
.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Help Modal Backdrop */
.help-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Help Modal Content Container */
.help-modal-content {
    background: white;
    border-radius: 16px;
    width: 95vw;
    max-width: 1200px;
    height: 90vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideIn 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
