/* Info box styling for tip text expansion */
.info-box {
    display: inline-block;
    white-space: normal;
    word-break: break-word;
}
/* Tip text styling for localization */
.tip-text {
    display: inline-block;
    white-space: nowrap;
}
/* WinForms Designer - Styles Schritt 5 */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f0f0;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: #0078d4;
    color: white;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: bold;
}

/* Toolbar */
.toolbar {
    background: #f8f8f8;
    border-bottom: 1px solid #ddd;
    padding: 10px 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.toolbar-btn {
    padding: 8px 15px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: #f0f0f0;
    border-color: #0078d4;
}

.toolbar-btn.primary {
    background: #0078d4;
    color: white;
    border-color: #0078d4;
}

.toolbar-btn.primary:hover {
    background: #106ebe;
}

.main-layout {
    display: flex;
    height: 500px;
}

/* Toolbox */
.toolbox {
    width: 180px;
    background: #2d2d30;
    color: white;
    padding: 15px;
    overflow-y: auto;
}

.toolbox h3 {
    margin-bottom: 15px;
    font-size: 14px;
    color: #e8e8e8;
}

.tool-item {
    padding: 10px;
    margin-bottom: 5px;
    background: #3f3f46;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
    user-select: none;
}

.tool-item:hover {
    background: #4a4a50;
}

.tool-item.active {
    background: #0078d4;
}

/* Design Area */
.design-area {
    flex: 1;
    position: relative;
    background: #e8e8e8;
    padding: 20px;
}

.form-window {
    position: absolute;
    top: 50px;
    left: 50px;
    width: 400px;
    height: 300px;
    background: white;
    border: 2px solid #0078d4;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    overflow: hidden;
}

.form-titlebar {
    height: 32px;
    background: #0078d4;
    color: white;
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 14px;
    cursor: move;
    user-select: none;
}

.form-content {
    height: calc(100% - 32px);
    background: #f0f0f0;
    position: relative;
    cursor: default;
}

.form-content.placing {
    cursor: crosshair;
}

.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #0078d4;
    right: -6px;
    bottom: -6px;
    cursor: se-resize;
    border-radius: 2px;
}

.resize-handle:hover {
    background: #106ebe;
}

/* Controls */
.control {
    position: absolute;
    border: 1px dashed #666;
    cursor: move;
    display: flex;
    align-items: center;
    padding: 2px 6px;
    font-size: 12px;
    user-select: none;
    background: white;
    transition: opacity 0.2s ease;
}

.control:hover {
    border-color: #0078d4;
    border-style: solid;
}

.control.selected {
    border: 2px solid #0078d4;
    background: #e7f3ff;
    box-shadow: 0 0 5px rgba(0, 120, 212, 0.3);
}

.control.has-events {
    position: relative;
}

.control.has-events::after {
    content: '⚡';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b35;
    color: white;
    font-size: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.control.dragging {
    opacity: 0.7;
    z-index: 1000;
    cursor: move;
}

.control.button {
    background: #e1e1e1;
    min-width: 75px;
    height: 23px;
    justify-content: center;
    border: 1px solid #adadad;
}

.control.button.selected {
    background: #d0e7ff;
}

.control.textbox {
    background: white;
    border: 1px solid #adadad;
    min-width: 100px;
    height: 20px;
    padding: 2px 4px;
}

.control.textbox.selected {
    background: #f0f8ff;
}

.control.label {
    background: transparent;
    border: 1px dashed #ccc;
    height: 16px;
    color: #000;
}

.control.label.selected {
    background: #e7f3ff;
}

.control.checkbox {
    background: transparent;
    border: 1px dashed #ccc;
    height: 17px;
    color: #000;
    padding-left: 20px;
    position: relative;
}

.control.checkbox::before {
    content: '☐';
    position: absolute;
    left: 2px;
    top: 0px;
    font-size: 12px;
}

.control.checkbox.selected {
    background: #e7f3ff;
}

.control.radiobutton {
    background: transparent;
    border: 1px dashed #ccc;
    height: 17px;
    color: #000;
    padding-left: 20px;
    position: relative;
}

.control.radiobutton::before {
    content: '◯';
    position: absolute;
    left: 2px;
    top: 0px;
    font-size: 12px;
}

.control.radiobutton.selected {
    background: #e7f3ff;
}

.control.listbox {
    background: white;
    border: 1px solid #adadad;
    min-width: 120px;
    min-height: 60px;
    padding: 2px;
    align-items: flex-start;
    flex-direction: column;
}

.control.listbox.selected {
    background: #f0f8ff;
}

.control.combobox {
    background: white;
    border: 1px solid #adadad;
    min-width: 120px;
    height: 21px;
    padding: 2px 20px 2px 4px;
    position: relative;
}

.control.combobox::after {
    content: '▼';
    position: absolute;
    right: 4px;
    top: 2px;
    font-size: 10px;
    color: #333;
}

.control.combobox.selected {
    background: #f0f8ff;
}

.control.panel {
    background: #f7f7f7;
    border: 1px solid #adadad;
    min-width: 100px;
    min-height: 60px;
    align-items: flex-start;
}

.control.groupbox {
    background: #f7f7f7;
    border: 1px solid #adadad;
    min-width: 100px;
    min-height: 60px;
    align-items: flex-start;
    padding: 6px;
}

.control.picturebox {
    background: #fff;
    border: 1px solid #adadad;
    min-width: 100px;
    min-height: 100px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.control.progressbar {
    background: #e1e1e1;
    border: 1px solid #adadad;
    min-width: 100px;
    height: 23px;
    padding: 0;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
}

.control.progressbar .progress-fill {
    background: #0078d4;
    height: 100%;
    width: 50%;
}

.control.progressbar.selected {
    background: #e1e1e1;
}

.control.datagrid {
    background-color: #fff;
    border: 1px solid #adadad;
    min-width: 120px;
    min-height: 60px;
    overflow: hidden;
}

.control.datagrid.selected {
    background-color: #f0f8ff;
}

.control.datagrid table {
    width: 100%;
    height: 100%;
    border-collapse: collapse;
}

.control.datagrid th,
.control.datagrid td {
    border: 1px solid #adadad;
    padding: 2px 4px;
    background-color: #fff;
    font-weight: normal;
}

.control.datagrid th {
    font-weight: bold;
    background-color: #f0f0f0;
}

/* Properties Panel */
.properties-panel {
    width: 320px;
    background: #f8f8f8;
    border-left: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.properties-panel h3 {
    padding: 15px;
    margin: 0;
    color: #333;
    font-size: 16px;
    border-bottom: 1px solid #ddd;
}

/* Property Tabs */
.property-tabs {
    display: flex;
    background: #e8e8e8;
    border-bottom: 1px solid #ccc;
}

.tab-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: #e8e8e8;
    cursor: pointer;
    font-size: 11px;
    transition: background 0.2s;
}

.tab-btn.active {
    background: #f8f8f8;
    border-bottom: 2px solid #0078d4;
}

.tab-btn:hover {
    background: #ddd;
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

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

.property-group h4 {
    margin-bottom: 10px;
    color: #666;
    font-size: 12px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.property-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.property-item label {
    color: #555;
    width: 80px;
}

.property-item input,
.property-item select {
    width: 140px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 2px;
    font-size: 11px;
}
.property-item textarea {
    width: 140px;
    height: 60px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 2px;
    font-size: 11px;
    resize: vertical;
}


/* Events Section */
.events-section h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 14px;
}

.event-list {
    margin-bottom: 20px;
}

.event-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 5px;
    font-size: 11px;
}

.event-item.has-code {
    border-left: 3px solid #0078d4;
}

.event-name {
    font-weight: bold;
    color: #333;
}

.event-actions {
    display: flex;
    gap: 5px;
}

.event-btn {
    padding: 2px 6px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 2px;
    cursor: pointer;
    font-size: 10px;
}

.event-btn:hover {
    background: #f0f0f0;
}

.add-event-section {
    border-top: 1px solid #ddd;
    padding-top: 15px;
}

.add-event-section label {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    color: #667;
}

.add-event-section select {
    width: 100%;
    margin-bottom: 8px;
}

.small-btn {
    padding: 4px 8px;
    border: 1px solid #0078d4;
    background: #0078d4;
    color: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
}

.small-btn:hover {
    background: #106ebe;
}

.info-box {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #0066cc;
}

/* Code Section */
.code-section {
    border-top: 1px solid #ddd;
    background: #1e1e1e;
}

.code-header {
    background: #2d2d30;
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
}

.code-header h3 {
    font-size: 14px;
    margin: 0;
}

.code-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.code-btn {
    padding: 4px 8px;
    background: #0078d4;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.code-btn:hover {
    background: #106ebe;
}

.code-status {
    font-size: 11px;
    color: #ccc;
}

.code-container {
    max-height: 300px;
    overflow-y: auto;
    background: #1e1e1e;
}

.code-container.hidden {
    display: none;
}

.code-output {
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    padding: 20px;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

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

.modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f8f8;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #eee;
    border-radius: 50%;
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.event-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #f0f8ff;
    border-radius: 4px;
    border-left: 4px solid #0078d4;
}

.event-info strong {
    display: block;
    margin-bottom: 5px;
    color: #0078d4;
}

.event-templates {
    margin-bottom: 20px;
}

.event-templates label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.event-templates select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.event-code-editor {
    margin-bottom: 20px;
}

.event-code-editor label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.event-code-editor textarea {
    width: 100%;
    height: 200px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    resize: vertical;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #f8f8f8;
    border-radius: 0 0 8px 8px;
}

.modal-btn {
    padding: 8px 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.modal-btn.primary {
    background: #0078d4;
    color: white;
    border-color: #0078d4;
}

.modal-btn.primary:hover {
    background: #106ebe;
}

.modal-btn.danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.modal-btn.danger:hover {
    background: #c82333;
}

.modal-btn:hover {
    background: #f0f0f0;
}

/* Drag feedback */
body.dragging {
    user-select: none;
}

/* Preview Modal */
#previewContent {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

#previewContent .form-window {
    position: relative;
    left: 0;
    top: 0;
    pointer-events: none;
}

/* About Section */
.about-section {
    padding: 20px;
    background: #f8f8f8;
    border-top: 1px solid #ddd;
    font-size: 14px;
    line-height: 1.5;
}

.about-section h3 {
    margin-bottom: 10px;
}


