/* Textlupe Pro – style.css v1.4 */

:root {
    --bg: #f4f7f6;
    --fg: #2c3e50;
    --panel: #ffffff;
    --border: #cbd5e0;

    --primary: #3182ce;
    --accent: #38a169;

    --upper: #ebf8ff;
    --lower: #f0fff4;
    --digit: #fffaf0;
    --other: #fff5f5;
}

[data-theme="dark"] {
    --bg: #1a202c;
    --fg: #e2e8f0;
    --panel: #2d3748;
    --border: #4a5568;

    --upper: #2c5282;
    --lower: #276749;
    --digit: #744210;
    --other: #822727;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--fg);
    margin: 0;
    padding: 20px;
}

header {
    max-width: 1200px;
    margin: 0 auto 25px auto;
}

h1 {
    margin: 0 0 10px 0;
}

.version {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-left: 8px;
}

.top-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

main {
    width: 100%;
    max-width: none;
}

.text-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.field-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

textarea {
    width: 100%;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: var(--panel);
    color: var(--fg);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1.1rem;
    resize: vertical;
}

#eingabe {
    min-height: 260px;
}

#ausgabe {
    min-height: 200px;
    background: rgba(0, 0, 0, 0.02);
}

.control-panel {
    display: flex;
    align-items: center;
    gap: 30px;
    background: var(--panel);
    padding: 15px 25px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

#analyseBtn {
    background: var(--accent);
    color: white;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.panel {
    background: var(--panel);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid var(--border);
}

.matrix-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    font-family: monospace;
}

.ascii-char {
    width: 32px;
    height: 32px;
    text-align: center;
    line-height: 32px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 0.9rem;
}

.ascii-char.used {
    opacity: 1;
    border: 1px solid var(--primary);
}

.ascii-char.unused {
    opacity: 0.15;
    border: 1px solid transparent;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
}

.tab {
    background: none;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    color: var(--fg);
    opacity: 0.5;
    font-weight: 600;
}

.tab.active {
    opacity: 1;
    border-bottom: 3px solid var(--primary);
    color: var(--primary);
}

.tab-viewport {
    max-height: 420px;
    overflow: auto;
}

.tab-content {
    display: none;
    white-space: pre-wrap;
    font-family: 'Consolas', monospace;
    font-size: 0.95rem;
}

.tab-content.active {
    display: block;
}

.bar {
    display: inline-block;
    height: 14px;
    background: var(--primary);
    border-radius: 3px;
    vertical-align: middle;
}

button {
    cursor: pointer;
    border-radius: 6px;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
}

.btn-secondary {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 10px 16px;
}

.btn-icon {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 8px 12px;
}

.bg-upper { background: var(--upper); }
.bg-lower { background: var(--lower); }
.bg-digit { background: var(--digit); }
.bg-other { background: var(--other); }

.beispiel-panel {
    display: flex;
    gap: 15px;
    background: var(--panel);
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    align-items: center;
    flex-wrap: wrap;
}

#beispielSelect {
    flex: 1;
    min-width: 180px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--fg);
    font-family: inherit;
}

#tab-beispiele h4 {
    margin: 10px 0 4px 0;
}

#tab-beispiele pre {
    margin: 0 0 6px 0;
    background: rgba(0, 0, 0, 0.02);
    padding: 8px;
    border-radius: 6px;
}

#tab-beispiele hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 8px 0;
}

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