body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f9;
    color: #333;
    display: flex;
    min-height: 100vh;
}

#app {
    display: flex;
    width: 100%;
}

#controls {
    width: 300px;
    padding: 20px 15px;
    background-color: #ffffff;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}

#visualization-settings {
    width: 200px;
    padding: 20px 10px;
    background-color: #ffffff;
    border-left: 1px solid #e0e0e0;
    overflow-y: auto;
    box-shadow: -2px 0 5px rgba(0,0,0,0.05);
}

#main-view {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* Karta */
.card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

/* Tytuły sekcji */
h2, h3 {
    color: #007bff;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-top: 0;
}

/* Elementy formularza */
textarea, input[type="text"], input[type="number"], select {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.input-group label {
    font-weight: bold;
    display: block;
    margin-top: 10px;
}

/* Canvas i Kontener */
#visualization-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.header-controls {
    display: flex;
    gap: 20px;
    align-items: center; /* Dodane dla lepszego wyrównania */
}

.layer-filter-controls {
    display: flex;
    flex-direction: column;
}

#layer-filter-checkboxes {
    display: flex;
    gap: 10px;
}

#canvas-container {
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden; 
    margin-bottom: 20px;
}

#pick-and-place-canvas {
    display: block;
    width: 100%; 
    height: 100%;
}

/* Przyciski Akcji (Eksport) */
.action-buttons button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
}

#copy-canvas-btn {
    background-color: #28a745; /* Zielony */
    color: white;
}

#save-canvas-btn {
    background-color: #007bff; /* Niebieski */
    color: white;
}

/* Tabela podglądu i listy komponentów */
.preview-table {
    max-height: 300px;
    overflow: auto;
}

.preview-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.preview-table th, .preview-table td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid #ddd;
}

.preview-table th {
    background-color: #f1f1f1;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Styling dla nagłówków sortowania */
.component-list-header {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.sort-indicator {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    color: #555;
}

.component-list-header.sort-asc, .component-list-header.sort-desc {
    background-color: #e0f0ff; /* Lekkie podświetlenie posortowanej kolumny */
}

/* Styling dla stałych pozycji (Fixed Width) */
.fixed-width-line {
    white-space: pre; 
    font-family: monospace;
    padding: 10px;
    background-color: #f8f8f8;
    border: 1px dashed #007bff;
    cursor: text;
    margin-top: 5px;
    min-height: 20px;
    overflow-x: auto;
    position: relative;
    font-size: 14px; /* Ustalony rozmiar dla 9px */
}

.fixed-width-marker {
    position: absolute;
    width: 1px;
    height: 100%;
    background-color: red;
    top: 0;
    cursor: pointer;
    pointer-events: all; /* Aby można było na niego kliknąć */
}

.delete-marker {
    position: absolute;
    top: -15px;
    left: -5px;
    font-weight: bold;
    color: red;
    cursor: pointer;
    background: white;
    border: 1px solid red;
    border-radius: 50%;
    padding: 0 4px;
    line-height: 1;
}

/* Wiersze niepasujące w liście komponentów */
:root {
    --color-default: #0000FF;
    --color-missing: #FF0000;
}

/* Zmienne z inputów color będą nadpisywać te zagnieżdżone w atrybutach style */