/* ============================================================
   Kalkulator koloru kotów — styl specyficzny dla aplikacji
   ============================================================ */

/* Tabs */
.input-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-border);
}

.tab-btn {
    padding: 0.5rem 1.25rem;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    font-family: var(--font);
    cursor: pointer;
    color: var(--color-text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
    color: var(--color-text);
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 500;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Parents grid */
.parents-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 700px) {
    .parents-grid {
        grid-template-columns: 1fr;
    }
}

.parent-fieldset {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    background: var(--color-surface);
}

.parent-fieldset legend {
    font-weight: 600;
    font-size: 1rem;
    padding: 0 0.5rem;
}

/* Checkbox label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.hint {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-top: 0.15rem;
}

/* EMS preview */
.ems-preview {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f5f5f5;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.ems-preview strong {
    font-family: 'Courier New', Courier, monospace;
    color: var(--color-primary);
}

/* EMS decoded (for EMS tab) */
.ems-decoded {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    min-height: 1.5rem;
}

.ems-decoded-ok {
    color: var(--color-success);
}

.ems-decoded-warn {
    color: var(--color-warning);
}

/* Calculate button */
.btn-calculate {
    font-size: 1.05rem;
    padding: 0.75rem 2rem;
}

/* Results section */
.results-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--color-border);
}

.results-section h2 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

/* Results tabs */
.results-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.results-tab-btn {
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    font-family: var(--font);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.results-tab-btn:hover {
    background: #f0f0f0;
}

.results-tab-btn.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* Results table */
.results-table td:first-child {
    font-weight: 500;
}

.results-table code {
    background: #f5f5f5;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

/* Probability bar */
.prob-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}

.prob-bar {
    height: 8px;
    background: var(--color-accent);
    border-radius: 4px;
    min-width: 2px;
    transition: width 0.3s ease;
}

.prob-text {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    min-width: 45px;
}

/* High probability rows (>=10%) */
.results-table tr.prob-high {
    background-color: #e8f5e9;
}

.results-table tr.prob-high td:first-child {
    font-weight: 600;
}

.results-table tr.prob-high .prob-bar {
    background: #66bb6a;
}

/* Low probability rows (<5%) */
.results-table tr.prob-low {
    color: #999;
}

.results-table tr.prob-low td:first-child {
    font-weight: 400;
}

.results-table tr.prob-low .prob-bar {
    background: #ccc;
}

.results-table tr.prob-low .prob-text {
    color: #aaa;
}

/* Genetic tests section */
.genetic-tests {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.genetic-tests h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--color-primary);
}

.genetic-tests .form-group {
    margin-bottom: 0.6rem;
}

.genetic-tests label {
    font-size: 0.85rem;
    font-weight: 500;
}

.genetic-tests select {
    font-size: 0.85rem;
}

/* EMS Reference card */
.ems-reference {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0;
}

.ems-reference summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 500;
    user-select: none;
}

.ems-reference summary:hover {
    background: #f9f9f9;
}

.ems-ref-content {
    padding: 0 1rem 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .ems-ref-content {
        grid-template-columns: 1fr;
    }
}

.ems-ref-group h4 {
    font-size: 0.9rem;
    margin: 0.75rem 0 0.25rem;
    color: var(--color-text-secondary);
}

.ems-ref-group h4:first-child {
    margin-top: 0;
}

.ems-ref-group .table {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.ems-ref-group .table td {
    padding: 0.2rem 0.5rem;
}

.ems-ref-group .table td:first-child {
    width: 30px;
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
}
