/**
 * Fixture Quick Edit modals (#fastEditModal, #botdEditModal, #scoreEditModal, #fastEditModal1)
 * Refined native overlay — same spirit as 100surepredict manual-prediction AJAX modal.
 */

#fastEditModal,
#botdEditModal,
#scoreEditModal,
#fastEditModal1 {
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-sizing: border-box;
}

#fastEditModal.hidden,
#botdEditModal.hidden,
#scoreEditModal.hidden,
#fastEditModal1.hidden {
    display: none !important;
}

#fastEditModal.flex,
#botdEditModal.flex,
#scoreEditModal.flex,
#fastEditModal1.flex {
    display: flex !important;
}

#fastEditModal > .fe-qm__shell,
#botdEditModal > .fe-qm__shell,
#scoreEditModal > .fe-qm__shell,
#fastEditModal1 > .fe-qm__shell {
    width: min(920px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    margin: 0 auto;
    padding: 1.25rem 1.35rem 1.1rem;
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
    position: relative;
}

html.dark #fastEditModal > .fe-qm__shell,
html.dark #botdEditModal > .fe-qm__shell,
html.dark #scoreEditModal > .fe-qm__shell,
html.dark #fastEditModal1 > .fe-qm__shell {
    background-color: #ffffff;
}

#scoreEditModal > .fe-qm__shell {
    width: min(560px, 100%);
}

#fastEditModal1 > .fe-qm__shell--vip {
    width: min(720px, 100%);
}

.fe-qm__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.fe-qm__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.fe-qm__hint {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.35;
}

.fe-qm__close {
    border: 0;
    background: transparent;
    font-size: 1.35rem;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    flex-shrink: 0;
}

.fe-qm__close:hover {
    color: #111827;
}

#fastEditModal .fe-qm__body,
#botdEditModal .fe-qm__body,
#scoreEditModal .fe-qm__body,
#fastEditModal1 .fe-qm__body {
    margin: 0;
    padding: 0;
    background: transparent;
    color: #111827;
    border: 0;
    box-shadow: none;
}

.fe-qm__match {
    padding: 0.75rem 0.85rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #f9fafb;
}

.fe-qm__league {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
}

.fe-qm__league img {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    object-fit: cover;
    background: #fff;
}

.fe-qm__league-name,
.fe-qm__team-name {
    color: #111827 !important;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25;
}

.fe-qm__teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.fe-qm__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
    flex: 1;
}

.fe-qm__team img {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    object-fit: cover;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.fe-qm__team-name {
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.fe-qm__vs {
    font-size: 0.75rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.04em;
}

.fe-qm__section {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.fe-qm__section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.fe-qm__section-head strong {
    font-size: 0.9rem;
    color: #111827;
}

.fe-qm__rows {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.fe-qm__row {
    display: grid;
    grid-template-columns: minmax(7rem, 1.1fr) minmax(0, 2fr);
    gap: 0.5rem;
    align-items: center;
}

.fe-qm__rows--tips-only .fe-qm__row {
    grid-template-columns: minmax(7rem, 1.1fr) minmax(0, 2fr);
}

.fe-qm__row-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fe-qm__row-tip,
.fe-qm__row-odds {
    min-width: 0;
}

/* Reset Filament / global form styles inside quick-edit modals */
#fastEditModal input,
#fastEditModal select,
#fastEditModal textarea,
#fastEditModal button,
#fastEditModal1 input,
#fastEditModal1 select,
#fastEditModal1 textarea,
#fastEditModal1 button {
    appearance: auto;
    -webkit-appearance: auto;
    box-shadow: none;
    font-family: inherit;
}

#fastEditModal .fe-qm__field,
#botdEditModal .fe-qm__field,
#scoreEditModal .fe-qm__field,
#fastEditModal1 .fe-qm__field {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 2.5rem;
    margin: 0;
    padding: 0.55rem 0.65rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: #ffffff !important;
    color: #111827 !important;
    font-size: 0.875rem;
    line-height: 1.25rem;
    box-sizing: border-box;
}

#fastEditModal .fe-qm__field:focus,
#botdEditModal .fe-qm__field:focus,
#scoreEditModal .fe-qm__field:focus,
#fastEditModal1 .fe-qm__field:focus {
    outline: 2px solid #ff5937;
    outline-offset: 0;
    border-color: #ff5937;
}

#fastEditModal .fe-qm__field::placeholder,
#botdEditModal .fe-qm__field::placeholder,
#scoreEditModal .fe-qm__field::placeholder,
#fastEditModal1 .fe-qm__field::placeholder {
    color: #9ca3af !important;
    opacity: 1;
}

#fastEditModal select.fe-qm__field,
#botdEditModal select.fe-qm__field,
#scoreEditModal select.fe-qm__field,
#fastEditModal1 select.fe-qm__field {
    padding-right: 1.5rem;
    cursor: pointer;
}

#fastEditModal select.fe-qm__field option,
#botdEditModal select.fe-qm__field option,
#scoreEditModal select.fe-qm__field option,
#fastEditModal1 select.fe-qm__field option {
    background-color: #fff;
    color: #111827;
}

.fe-qm__empty {
    margin: 0;
    padding: 0.85rem 1rem;
    font-size: 0.8125rem;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 0.5rem;
    background-color: #fffbeb;
}

.fe-qm__error {
    color: #b91c1c;
    font-size: 0.8rem;
    margin: 0.65rem 0 0;
    min-height: 1.1rem;
}

.fe-qm__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.fe-qm__btn {
    border: 0;
    border-radius: 0.5rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.25;
}

.fe-qm__btn--primary {
    background: #ff5937 !important;
    color: #fff !important;
}

.fe-qm__btn--primary:hover {
    filter: brightness(0.96);
}

.fe-qm__btn--primary:disabled {
    opacity: 0.65;
    cursor: wait;
}

.fe-qm__btn--muted {
    background: #e5e7eb !important;
    color: #111 !important;
}

.fe-qm__btn--muted:hover {
    background: #d1d5db !important;
}

.fe-qm__score-pair {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
}

.fe-qm__field--score {
    max-width: 5.5rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.fe-qm__score-sep {
    color: #9ca3af;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
}

.fe-qm__link-btn {
    border: 0;
    background: transparent;
    color: #ff5937;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.fe-qm__link-btn:hover {
    color: #111;
}

.fe-qm__win-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.fe-qm__win-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    margin: 0;
    padding: 0.65rem 0.8rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.55rem;
    background: #fafafa;
    cursor: pointer;
    text-align: left;
}

.fe-qm__win-row:hover {
    border-color: #ffb3a3;
    background: #fff7f5;
}

.fe-qm__win-row.is-won {
    border-color: #22c55e;
    background: #f0fdf4;
    box-shadow: 0 0 0 1px #22c55e;
}

.fe-qm__win-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111;
}

.fe-qm__win-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    border: 1.5px solid #d1d5db;
    color: #16a34a;
    background: #fff;
    flex-shrink: 0;
}

.fe-qm__win-row.is-won .fe-qm__win-check {
    border-color: #16a34a;
    background: #dcfce7;
}

/* Admin table: score + prediction chips */
.loy-score-cell {
    display: inline-block;
    font-weight: 700;
    font-size: 0.95rem;
    color: #4ade80;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.loy-score-sep {
    color: #6b7280;
    font-weight: 600;
    margin: 0 0.1rem;
}

.loy-tip-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    max-width: 22rem;
}

.loy-tip-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    background: #ffe8e1;
    color: #c2410c;
    border: 1px solid #ffc4b5;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}

html.dark .loy-tip-chip {
    background: rgba(255, 89, 55, 0.18);
    color: #ffb39f;
    border-color: rgba(255, 89, 55, 0.35);
}

@media (max-width: 720px) {
    .fe-qm__row {
        grid-template-columns: 1fr;
        gap: 0.3rem;
        padding: 0.55rem 0.65rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        background: #fafafa;
    }

    .fe-qm__row-label {
        white-space: normal;
    }
}
