/* ========================================
   GENETICS MODAL — genetická predikce štěňat
   Mobile first
   ======================================== */

.genetics-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.genetics-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.genetics-modal__dialog {
    position: relative;
    background: #ffffff;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
    animation: geneticsSlideUp 0.22s ease-out;
}

@keyframes geneticsSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.genetics-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid #e5e7eb;
}

.genetics-modal__header-text { min-width: 0; flex: 1; }

.genetics-modal__title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2px;
    line-height: 1.25;
}

.genetics-modal__subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    line-height: 1.35;
}

.genetics-modal__close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.genetics-modal__close:hover { background: #e2e8f0; color: #0f172a; }
.genetics-modal__close svg { width: 18px; height: 18px; }

.genetics-modal__body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* Sekce */
.genetics-modal__section { margin-bottom: 20px; }
.genetics-modal__section:last-child { margin-bottom: 0; }

.genetics-modal__section-title {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px;
}

/* Genotypy rodičů */
.genetics-modal__parents {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.genetics-modal__parent {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
}

.genetics-modal__parent-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.genetics-modal__parent-label {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.genetics-modal__parent-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.genetics-modal__locus-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 10px;
    font-size: 12px;
}

.genetics-modal__locus {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.genetics-modal__locus-name {
    color: #64748b;
    font-weight: 600;
}

.genetics-modal__locus-value {
    color: #0f172a;
    font-weight: 600;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

/* Bar chart — barvy / srst */
.genetics-modal__bars { display: flex; flex-direction: column; gap: 8px; }

.genetics-modal__bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.genetics-modal__bar-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.genetics-modal__bar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #475569;
}
.genetics-modal__bar-icon svg { width: 100%; height: 100%; }

.genetics-modal__bar-label {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    width: 40%;
    line-height: 1.3;
}

.genetics-modal__bar-track {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    min-width: 0;
}

.genetics-modal__bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #f97316, #ea580c);
    border-radius: 4px;
}

.genetics-modal__bar-percent {
    flex-shrink: 0;
    width: 48px;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

/* Speciální znaky */
.genetics-modal__special-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.genetics-modal__special-item {
    position: relative;
    padding-left: 16px;
    font-size: 13px;
    color: #374151;
    line-height: 1.4;
}

.genetics-modal__special-item::before {
    content: '•';
    position: absolute;
    left: 4px;
    color: #f97316;
    font-weight: 700;
}

/* Chybí testy — warning box */
.genetics-modal__missing {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 3px solid #f59e0b;
    border-radius: 8px;
    padding: 10px 12px;
}

.genetics-modal__missing-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #92400e;
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.genetics-modal__missing-title svg { width: 14px; height: 14px; }

.genetics-modal__missing-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.genetics-modal__missing-item {
    font-size: 13px;
    color: #78350f;
    line-height: 1.4;
}

/* Footer */
.genetics-modal__footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 0;
}

.genetics-modal__legend {
    font-size: 11px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.genetics-modal__btn {
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.genetics-modal__btn--primary {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #ffffff;
}

.genetics-modal__btn--primary:hover {
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.3);
}

/* === TABLET + DESKTOP === */
@media (min-width: 768px) {
    .genetics-modal {
        align-items: center;
        padding: 20px;
    }
    .genetics-modal__dialog {
        border-radius: 16px;
        max-height: 85vh;
    }
    .genetics-modal__parents {
        grid-template-columns: 1fr 1fr;
    }
    .genetics-modal__header { padding: 20px 22px 16px; }
    .genetics-modal__body { padding: 20px 22px; }
    .genetics-modal__footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 16px 22px;
    }
    .genetics-modal__legend { flex: 1; }
}
