/* Der Haupt-Wrapper. 
  Diese Stile (wie 'display: grid') waren vorher im 'body' Tag.
*/
.ts-simulation-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f7f6;
    color: #333;
    display: grid;
    grid-template-areas:
        "header"
        "simulation"
        "toolbox"
        "status";
    gap: 20px;
    padding: 20px;
    max-width: 900px;
    margin: 20px auto; /* Etwas Abstand zur Seite */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Alle anderen Regeln sind jetzt mit dem Wrapper "ge-scoped" */
.ts-simulation-wrapper h1,
.ts-simulation-wrapper h2 {
    color: #005a9c;
    border-bottom: 2px solid #005a9c;
    padding-bottom: 5px;
}

/* Bereiche der Anwendung */
.ts-simulation-wrapper header { grid-area: header; text-align: center; }
.ts-simulation-wrapper .simulation-container { grid-area: simulation; }
.ts-simulation-wrapper .toolbox-container { grid-area: toolbox; }
.ts-simulation-wrapper .status-container { grid-area: status; }

/* Der DNA-Strang und seine Elemente */
.ts-simulation-wrapper .simulation-container h2 { margin-bottom: 15px; }
.ts-simulation-wrapper .dna-strand {
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, #b3e0ff, #e6f7ff, #b3e0ff);
    border-radius: 10px;
    padding: 10px;
    height: 100px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}

.ts-simulation-wrapper .dna-strand::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    background-color: #5c9ac4;
    transform: translateY(-2px);
    z-index: 1;
}

/* Die "Drop-Zonen" (Zielbereiche) */
.ts-simulation-wrapper .drop-zone {
    min-height: 80px;
    min-width: 120px;
    border: 2px dashed #888;
    border-radius: 8px;
    padding: 5px;
    margin: 0 10px;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #555;
    transition: background-color 0.2s, border-color 0.2s;
    z-index: 2;
}

.ts-simulation-wrapper .drop-zone.drag-over {
    background-color: #c8e6c9;
    border-color: #4caf50;
}

.ts-simulation-wrapper .drop-zone.drag-over-invalid {
    background-color: #ffcdd2;
    border-color: #f44336;
}

.ts-simulation-wrapper #enhancer { border-color: #64b5f6; }
.ts-simulation-wrapper #silencer { border-color: #f44336; }
.ts-simulation-wrapper #promoter { border-color: #4caf50; }

.ts-simulation-wrapper #gene {
    flex-grow: 1;
    text-align: center;
    background: #a5d6a7;
    height: 50px;
    line-height: 50px;
    border-radius: 5px;
    font-weight: bold;
    color: #2e7d32;
    z-index: 2;
}

/* Die Werkzeugkiste */
.ts-simulation-wrapper #toolbox {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #ddd;
}

/* Die ziehbaren Elemente (Proteine) */
.ts-simulation-wrapper .draggable {
    padding: 10px 15px;
    border-radius: 25px;
    font-weight: bold;
    color: #fff;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    user-select: none;
}

.ts-simulation-wrapper .draggable:active {
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.ts-simulation-wrapper #activator { background-color: #29b6f6; }
.ts-simulation-wrapper #repressor { background-color: #ef5350; }
.ts-simulation-wrapper #polymerase { background-color: #66bb6a; }
.ts-simulation-wrapper #mediator { background-color: #ffa726; }

.ts-simulation-wrapper .placed {
    cursor: default;
    opacity: 0.8;
    margin-top: 5px;
}

/* Status- und Reset-Bereich */
.ts-simulation-wrapper #status-message {
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s, color 0.3s;
}

.ts-simulation-wrapper .status-info { background-color: #e3f2fd; color: #0d47a1; }
.ts-simulation-wrapper .status-success { background-color: #e8f5e9; color: #1b5e20; }
.ts-simulation-wrapper .status-warning { background-color: #fff3e0; color: #e65100; }
.ts-simulation-wrapper .status-error { background-color: #ffebee; color: #b71c1c; }

.ts-simulation-wrapper #reset-button {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 1em;
    font-weight: bold;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.2s;
}

.ts-simulation-wrapper #reset-button:hover {
    background-color: #0056b3;
}
