/* Elimineringer (/eliminations) and the dialogs it opens. */

/* EliminationDialog's fields over its lines. */
.elim-dialog__fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: 16px;
    align-items: start;
}

/* FullEliminationDialog. */
.elim-full {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: min(620px, 86vw);
}

.elim-full__intro,
.elim-copy__intro {
    margin: 0;
    color: var(--mud-palette-text-secondary);
}

.elim-full__pairs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

/* CopyEliminationDialog. */
.elim-copy {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: min(540px, 86vw);
}

/* A year per row, a month per column, so the same month lines up down the years. */
.elim-copy__matrix {
    display: grid;
    grid-template-columns: 48px repeat(12, minmax(0, 1fr));
    gap: 4px;
    align-items: center;
    user-select: none;
}

.elim-copy__month {
    text-align: center;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.elim-copy__year,
.elim-copy__cell {
    height: 32px;
    padding: 0;
    border-radius: 6px;
    font: inherit;
    cursor: pointer;
}

.elim-copy__year {
    border: 0;
    background: none;
    color: var(--mud-palette-text-primary);
    font-weight: 500;
    text-align: left;
}

.elim-copy__year:hover:not(:disabled) {
    color: var(--mud-palette-primary);
}

.elim-copy__cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--mud-palette-divider);
    background: none;
    color: var(--mud-palette-text-disabled);
}

.elim-copy__year:disabled,
.elim-copy__cell:disabled {
    cursor: default;
}

.elim-copy__cell:disabled:not(.is-source) {
    border-style: dashed;
}

.elim-copy__cell .material-symbols-outlined {
    font-size: 18px;
}

.elim-copy__cell.is-source {
    border-color: var(--ms-line-strong);
    background-color: var(--ms-surface-2);
    color: var(--mud-palette-text-secondary);
}

.elim-copy__cell.is-selectable {
    border-color: var(--ms-line-strong);
}

.elim-copy__cell.is-selectable:hover {
    background-color: var(--mud-palette-action-default-hover);
}

.elim-copy__cell.is-selected,
.elim-copy__cell.is-selected:hover {
    border-color: var(--mud-palette-primary);
    background-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

/* The group already has an elimination with this description in that period. */
.elim-copy__mark,
.elim-copy__cell.has-same::after {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--ms-warning-accent);
    box-shadow: 0 0 0 1.5px var(--mud-palette-surface);
}

.elim-copy__cell.has-same::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
}

.elim-copy__summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.elim-copy__muted {
    color: var(--mud-palette-text-secondary);
}

.elim-copy__same {
    display: flex;
    align-items: center;
    gap: 8px;
}

.elim-copy__mark {
    flex: none;
}

@media (max-width: 599px) {
    .elim-dialog__fields,
    .elim-full__pairs {
        grid-template-columns: 1fr;
    }
}
