/**
 * style.css – ZIS-Webanwendung
 * Version 2.3 – vollständige, korrigierte Datei
 */

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

body {
    font-family: 'Ubuntu', Arial, sans-serif;
    background: #f2f4f6;
    color: #333;
    line-height: 1.4;
}

#app {
    max-width: 1600px;
    margin: 0 auto;
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== KOPF – HELLBLAU-VERLAUF ===== */
#app-header {
    background: linear-gradient(135deg, #d4e9f7 0%, #8fc8e8 100%);
    padding: 6px 16px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#app-header h1 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a3a4a;
    margin: 0;
}

#app-header .subtitle {
    font-size: 0.7rem;
    color: #2c5a6a;
    margin: 0;
}

.header-badge {
    font-size: 0.85rem;
    color: #1a3a4a;
    background: rgba(255,255,255,0.6);
    padding: 2px 12px;
    border-radius: 20px;
    display: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-right select,
.header-right label {
    font-size: 0.8rem;
    color: #1a3a4a;
}

.header-right select {
    padding: 2px 6px;
    border: 1px solid #b0c8d8;
    border-radius: 3px;
    background: #f8fcff;
}

/* ===== HAUPTBEREICH ===== */
#app-main {
    display: flex;
    gap: 12px;
    flex: 1;
}

/* ===== LINKES PANEL – OCKER ===== */
#input-panel {
    flex: 0 0 34%;
    min-width: 300px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    background: #faf3e8;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

#input-panel::-webkit-scrollbar {
    width: 5px;
}
#input-panel::-webkit-scrollbar-thumb {
    background: #d0c0b0;
    border-radius: 3px;
}

.panel-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-section {
    margin-bottom: 3px;
    padding-bottom: 3px;
    border-bottom: 1px solid #e8ddd0;
}
.input-section:last-child {
    border-bottom: none;
}
.input-section h2 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a3a2a;
    margin-bottom: 2px;
}

/* Radio & Select */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 10px;
}
.radio-group label {
    font-size: 0.78rem;
    cursor: pointer;
}
select {
    width: 100%;
    padding: 3px 6px;
    border: 1px solid #d0c0b0;
    border-radius: 3px;
    font-size: 0.78rem;
    background: #fff;
}

.weight-link {
    margin-top: 2px;
}
.weight-link a {
    font-size: 0.75rem;
    color: #4a7a9a;
    text-decoration: none;
}
.weight-link a:hover {
    text-decoration: underline;
}

#profile-name-display {
    margin-top: 3px;
    font-size: 0.8rem;
    color: #4a7a9a;
    min-height: 1.2em;
}

/* ===== PARAMETER-GRID ===== */
.parameter-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.parameter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 4px;
    background: rgba(255,255,255,0.5);
    border-radius: 3px;
    border-left: 3px solid #d0c0b0;
}

.param-label {
    flex: 0 0 40%;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.param-name {
    font-weight: 400;
}

.param-block {
    font-size: 0.6rem;
    color: #999;
    margin-left: 3px;
}

.param-inputs {
    display: flex;
    align-items: center;
    gap: 2px;
}

.param-inputs input {
    padding: 2px 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.8rem;
    text-align: right;
    background: #fff;
    width: 60px;
}

.param-inputs input.param-value {
    width: 65px;
}

/* Gewichte ausgeblendet */
.param-weight,
.param-separator {
    display: none !important;
}

/* ===== EBENEN-NAME ===== */
.level-name-input {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-top: 2px;
}
.level-name-input label {
    font-size: 0.78rem;
    color: #4a3a2a;
    white-space: nowrap;
}
.level-name-input input[type="text"] {
    flex: 1;
    padding: 3px 6px;
    border: 1px solid #d0c0b0;
    border-radius: 3px;
    font-size: 0.8rem;
    background: #fff;
}

/* ===== SKALIERUNG ===== */
.scaling-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}
.scaling-input input[type="number"] {
    width: 55px;
    padding: 2px 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.8rem;
}
.scaling-info {
    font-size: 0.75rem;
    color: #666;
}

/* ===== FARBEN ===== */
.color-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.color-picker-group {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
}
.color-picker-group input[type="color"] {
    width: 28px;
    height: 24px;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 1px;
}
.color-picker-group input[type="range"] {
    width: 60px;
}

.color-preview {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
}
.preview-box {
    display: inline-block;
    width: 32px;
    height: 24px;
    border: 1px solid #ccc;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    background-image:
        linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
        linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
        linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
}
#color-preview-overlay {
    width: 100%;
    height: 100%;
    border-radius: 2px;
}

/* ===== BUTTONS ===== */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.btn {
    padding: 3px 12px;
    border: none;
    border-radius: 3px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-primary {
    background: #4a7a9a;
    color: #fff;
}
.btn-primary:hover {
    background: #3a6a8a;
}
.btn-secondary {
    background: #b0a090;
    color: #fff;
}
.btn-secondary:hover {
    background: #a09080;
}
.btn-danger {
    background: #c05050;
    color: #fff;
}
.btn-danger:hover {
    background: #b04040;
}

/* ===== RECHTES PANEL – VORSCHAU ===== */
#preview-panel {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
}

#svg-wrapper {
    flex: 1;
    min-height: 450px;
    background: #fafafa;
    border-radius: 4px;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

#svg-wrapper svg {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
}

#legend-container {
    margin-top: 4px;
    padding: 4px 10px;
    background: #f8f8f8;
    border-radius: 4px;
    font-size: 0.75rem;
    min-height: 18px;
    color: #555;
}

/* ===== FUSS ===== */
#app-footer {
    margin-top: 6px;
    text-align: center;
    padding: 4px;
    color: #aaa;
    font-size: 0.65rem;
    background: #f8f8f8;
    border-radius: 6px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    #app-main {
        flex-direction: column;
    }
    #input-panel {
        flex: none;
        max-height: none;
        min-width: unset;
    }
}

@media (max-width: 600px) {
    #app-header {
        flex-direction: column;
        align-items: stretch;
    }
    .header-right {
        justify-content: flex-start;
    }
    .param-label {
        flex: 0 0 35%;
        font-size: 0.7rem;
    }
    .param-inputs input {
        width: 50px;
        font-size: 0.7rem;
    }
    .param-inputs input.param-value {
        width: 55px;
    }
}