:root {
    /* Fallback-Defaults — werden sofort durch JS überschrieben */
    --ui-bg:         #181825;
    --ui-surface:    #1e1e2e;
    --ui-surface-hi: #313244;
    --ui-text:       #cdd6f4;
    --ui-text-dim:   #585b70;
    --ui-primary:    #b4befe;
    --ui-border:     #313244;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Inter", Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--ui-bg);
    color: var(--ui-text);
    padding: 20px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* ── Header ─────────────────────────────────────── */
header {
    margin-bottom: 25px;
    text-align: center;
}

header h1 {
    font-size: 1.8rem;
    color: var(--ui-primary);
    margin-bottom: 5px;
}

header p {
    color: var(--ui-text-dim);
    font-size: 0.95rem;
}

/* ── Layout ─────────────────────────────────────── */
.container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto 20px auto;
}

@media (max-width: 1000px) {
    .container { grid-template-columns: 1fr; }
}

/* ── Panels ─────────────────────────────────────── */
.panel {
    background-color: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: 28px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.full-width-panel {
    grid-column: 1 / -1;
}

/* ── Drop Zone ───────────────────────────────────── */
.drop-zone {
    border: 2px dashed var(--ui-border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background-color: var(--ui-surface-hi);
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.25s ease;
}

.drop-zone.dragover {
    border-color: var(--ui-primary);
}

/* ── Inputs ──────────────────────────────────────── */
textarea {
    width: 100%;
    height: 180px;
    background-color: var(--ui-surface-hi);
    color: var(--ui-text);
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    padding: 10px;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9rem;
    resize: none;
}

.meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

label {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--ui-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"] {
    background-color: var(--ui-surface);
    color: var(--ui-text);
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.95rem;
    width: 100%;
    transition: background-color 0.25s ease, color 0.25s ease;
}

select {
    background-color: var(--ui-surface);
    color: var(--ui-text);
    border: 1px solid var(--ui-surface);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.95rem;
    width: 100%;
    transition: background-color 0.25s ease, color 0.25s ease;
}

select:hover {
    background-color: var(--ui-surface-hi);
    border: 1px solid var(--ui-surface);
}

/* ── Mapping Grid ────────────────────────────────── */
.mapping-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    background: var(--ui-surface-hi);
    padding: 12px;
    border-radius: 8px;
    transition: background-color 0.25s ease;
}

.select-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.color-preview {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    display: inline-block;
    cursor: pointer;
    position: relative;
}

/* ── Buttons ─────────────────────────────────────── */
.button-group {
    display: flex;
    gap: 10px;
}

button {
    flex: 1;
    background-color: var(--ui-primary);
    color: var(--ui-bg);
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.9;
}

button.secondary-btn {
    background-color: var(--ui-surface-hi);
    color: var(--ui-text);
    border: 1px solid var(--ui-border);
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* ── Output ──────────────────────────────────────── */
.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-output {
    height: 519px;
    overflow: auto;
    white-space: pre;
    background-color: var(--ui-surface-hi);
    color: var(--ui-text);
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    padding: 15px;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.85rem;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* ── Visualizer ──────────────────────────────────── */
.vis-section {
    margin-top: 10px;
}

.vis-section h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--ui-border);
    padding-bottom: 5px;
    color: var(--ui-text);
}

.yaml-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(144px, 1fr));
    gap: 10px;
    margin-bottom: 25px;
}

.yaml-block {
    background: var(--ui-surface-hi);
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: transform 0.1s ease, background-color 0.25s ease;
}

.yaml-block:hover {
    transform: translateY(-2px);
}

.yaml-color-box {
    width: 100%;
    height: 45px;
    border-radius: 0px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.yaml-label {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--ui-text);
}

.yaml-hex {
    font-size: 0.75rem;
    color: var(--ui-text-dim);
    font-family: monospace;
}

.palette-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.palette-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.palette-row-title {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--ui-text);
}

.swatch-timeline {
    display: grid;
    grid-template-columns: repeat(18, 1fr);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--ui-border);
}

@media (max-width: 768px) {
    .swatch-timeline {
        grid-template-columns: repeat(9, 1fr);
    }
}

.tone-swatch {
    height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.tone-number {
    font-size: 0.7rem;
    font-weight: bold;
    font-family: monospace;
}

.tone-hex {
    font-size: 0.6rem;
    font-family: monospace;
    opacity: 0.8;
    display: none;
}

.tone-swatch:hover .tone-hex  { display: block; }
.tone-swatch:hover .tone-number { display: none; }

/* Modern Browser & Firefox (Standard-Syntax) */
.code-output, textarea {
    scrollbar-width: thin;
    scrollbar-color: var(--ui-text-dim) transparent;
}

/* Chrome, Edge, Safari & Opera (WebKit-Syntax) */
.code-output::-webkit-scrollbar,
textarea::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

/* Track */
.code-output::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0 8px 8px 0;
}

/* Thumb */
.code-output::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
    background: var(--ui-text-dim);
    border-radius: 10px;
    border: 2px solid var(--ui-surface-hi);
}

.code-output::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover {
    background: var(--ui-text-dim);
}
