/* =========================================================================
   Live Manual Draft Helper
   - Uses the seven-token show-aware system from master.cshtml.
   - --brand-accessible is the AA-compliant brand color for the active show.
   ========================================================================= */

.dh-shell {
    max-width: 1280px;
    margin: 24px auto 96px;
    padding: 0 24px;
    color: #1f2933;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ===== Header ===== */
.dh-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.dh-header-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 16px;
}

.dh-title {
    margin: 0;
    font-size: 1.75rem;
    color: var(--brand-accessible, #2E7D32);
}

.dh-subtitle {
    margin: 8px 0 0;
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.45;
}

.dh-loaded-league {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ecfdf5;
    border: 1px solid var(--brand-accessible, #2E7D32);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.9rem;
}

.dh-loaded-label {
    color: #065f46;
    font-weight: 600;
}

.dh-loaded-name {
    color: #1f2933;
}

/* ===== Toolbar ===== */
.dh-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px 24px;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 16px;
}

.dh-toolbar-group {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.dh-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
}

.dh-field-label {
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.7rem;
}

.dh-select,
.dh-input {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 0.95rem;
    min-width: 80px;
}

.dh-input[type="number"] {
    width: 80px;
}

/* Greyed-out state when the four configurator controls lock to the loaded
   league's config. Browser-default disabled is too subtle on hover-less
   screen-shares, so we layer extra dimming + a not-allowed cursor. */
.dh-select:disabled,
.dh-input:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: not-allowed;
    opacity: 0.75;
}
/* Dim the label sitting above a disabled control too. */
.dh-field:has(.dh-select:disabled) .dh-field-label,
.dh-field:has(.dh-input:disabled) .dh-field-label {
    color: #9ca3af;
}

/* Small in-toolbar caption shown only when the configurator is locked.
   Tells the user the way out — they can unload the league to edit. */
.dh-locked-hint {
    flex-basis: 100%;
    margin-top: -4px;
    font-size: 0.8rem;
    color: #6b7280;
    font-style: italic;
}
.dh-locked-hint strong {
    color: #374151;
    font-style: normal;
    font-weight: 600;
}

.dh-btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, background 0.15s;
}

.dh-btn:hover { opacity: 0.9; }
.dh-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.dh-btn-primary {
    background: var(--brand-accessible, #2E7D32);
    color: #fff;
}

.dh-btn-ghost {
    background: #fff;
    border-color: #d1d5db;
    color: #374151;
}
.dh-btn-ghost[aria-pressed="true"] {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0c4a6e;
}

.dh-btn-danger {
    background: #fff;
    border-color: #dc2626;
    color: #dc2626;
}
.dh-btn-danger:hover { background: #fef2f2; }

.dh-link-btn {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    font-weight: 600;
}
.dh-link-btn:hover { text-decoration: underline; }

/* "Restore league config" appears next to Load League only when the
   configurator structure has diverged from the loaded league's snapshot. */
.dh-restore-link {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #78350f;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.dh-restore-link:hover { background: #fde68a; }

/* Display mode toggle */
.dh-toggle {
    display: inline-flex;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}
.dh-toggle-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.dh-toggle-btn.is-active {
    background: var(--brand-accessible, #2E7D32);
    color: #fff;
}

/* ===== MVP Status panel ===== */
.dh-mvp-status {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.dh-mvp-banner {
    color: #78350f;
    font-size: 0.95rem;
    margin-bottom: 12px;
    line-height: 1.45;
}

.dh-mvp-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}

.dh-mvp-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.dh-mvp-row.is-locked { border-color: var(--brand-accessible, #2E7D32); }
.dh-mvp-row.is-unlocked { border-color: #f59e0b; }

.dh-mvp-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
}
.dh-mvp-row.is-locked .dh-mvp-icon { background: var(--brand-accessible, #2E7D32); }
.dh-mvp-row.is-unlocked .dh-mvp-icon { background: #f59e0b; }

.dh-mvp-name { flex: 1; font-weight: 600; }
.dh-mvp-count { color: #6b7280; font-size: 0.85rem; }

/* ===== Now Picking hero ===== */
.dh-now-picking {
    background: linear-gradient(135deg, var(--brand-accessible, #2E7D32) 0%, #1f5f25 100%);
    color: #fff;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
}

.dh-np-label {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8rem;
    opacity: 0.85;
    margin-bottom: 4px;
}

.dh-np-coach {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 4px 0;
}

.dh-np-meta {
    font-size: 1rem;
    opacity: 0.9;
}

.dh-now-picking.is-done {
    background: linear-gradient(135deg, #1f2933 0%, #4b5563 100%);
}

/* ===== Section ===== */
.dh-section {
    margin-bottom: 32px;
}

.dh-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
}

.dh-section-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #1f2933;
}

.dh-section-meta {
    font-size: 0.85rem;
    color: #6b7280;
}

/* ===== Castaway Pool ===== */
.dh-pool {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.dh-pool.display-name {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.dh-pool-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    text-align: center;
    transition: opacity 0.15s, transform 0.15s;
}

.dh-pool-tile.is-empty {
    opacity: 0.35;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
}

.dh-pool-tile.display-name {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    padding: 10px 12px;
}

.dh-pool-pfp {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--brand-accessible, #2E7D32);
    background: #f3f4f6;
}

.dh-pool-tile.is-empty .dh-pool-pfp {
    filter: grayscale(1);
    border-color: #9ca3af;
}

.dh-pool-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2933;
    line-height: 1.2;
    word-break: break-word;
}

.dh-pool-copies {
    display: inline-flex;
    gap: 3px;
    flex-wrap: wrap;
    justify-content: center;
}

.dh-pool-pip {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand-accessible, #2E7D32);
}
.dh-pool-pip.is-used { background: #d1d5db; }

/* ===== Snake Draft Order ===== */
.dh-snake-scroll {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.dh-snake {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.9rem;
}

.dh-snake th,
.dh-snake td {
    padding: 8px;
    border: 1px solid #e5e7eb;
    text-align: center;
    vertical-align: middle;
    min-width: 80px;
}

.dh-snake thead th {
    background: #f3f4f6;
    color: #374151;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dh-snake th.dh-snake-exiled { color: #7c2d12; }

.dh-snake .dh-snake-coach {
    text-align: left;
    background: #f9fafb;
    font-weight: 600;
    position: sticky;
    left: 0;
    z-index: 1;
}

.dh-snake-coach-name {
    background: transparent;
    border: 1px dashed transparent;
    font-weight: 600;
    color: #1f2933;
    width: 140px;
    padding: 4px 6px;
    font-size: 0.95rem;
    border-radius: 4px;
}
.dh-snake-coach-name:hover { border-color: #d1d5db; }
.dh-snake-coach-name:focus { border-color: #2563eb; outline: none; background: #fff; }

.dh-snake-cell {
    cursor: pointer;
    background: #fff;
    transition: background 0.15s;
}
.dh-snake-cell:hover { background: #eff6ff; }

.dh-snake-cell.is-current {
    background: #fef3c7;
    box-shadow: inset 0 0 0 2px #f59e0b;
}

.dh-snake-cell.is-filled {
    background: #ecfdf5;
    color: #065f46;
    font-weight: 600;
}
.dh-snake-cell.is-filled.is-exiled {
    background: #fef2f2;
    color: #7c2d12;
}

.dh-snake-cell .dh-pick-num {
    display: block;
    font-size: 0.7rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}
.dh-snake-cell.is-filled .dh-pick-num { color: #047857; }

/* ===== Tribes panel ===== */
.dh-tribes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.dh-tribe-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    padding: 14px;
}

.dh-tribe-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2933;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.dh-tribe-slots {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dh-slot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border-radius: 8px;
    background: #f9fafb;
    font-size: 0.9rem;
}
.dh-slot.is-mvp {
    background: #fffbeb;
    border: 1px dashed #f59e0b;
    color: #78350f;
    font-style: italic;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.dh-slot.is-mvp:hover {
    background: #fef3c7;
    border-style: solid;
}
.dh-slot.is-mvp.is-mvp-filled {
    background: #fff7ed;
    border-style: solid;
    border-color: #f59e0b;
    color: #1f2933;
    font-style: normal;
}
.dh-slot.is-exiled { opacity: 0.7; }

.dh-slot-pfp {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--brand-accessible, #2E7D32);
    background: #f3f4f6;
}

.dh-slot.is-exiled .dh-slot-pfp {
    filter: grayscale(1);
    border-color: #9ca3af;
}

.dh-slot-text {
    flex: 1;
    font-weight: 600;
    color: #1f2933;
}
.dh-slot-meta {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dh-slot-empty {
    color: #9ca3af;
    font-style: italic;
    font-weight: 500;
}

/* ===== Hosting Tips drawer ===== */
/* Offset by --header-h (set in master.cshtml at 72px desktop / 62px small) so
   the drawer sits below the fixed nav rather than under it. */
.dh-tips {
    position: fixed;
    top: var(--header-h, 72px);
    right: 0;
    width: 360px;
    max-width: 90vw;
    height: calc(100vh - var(--header-h, 72px));
    background: #fff;
    border-left: 1px solid #e5e7eb;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.08);
    z-index: 50;
    padding: 16px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.dh-tips.is-open {
    transform: translateX(0);
}

.dh-tips-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.dh-tips-header h3 {
    margin: 0;
    color: var(--brand-accessible, #2E7D32);
    font-size: 1.1rem;
}

.dh-tips-list {
    margin: 0;
    padding-left: 20px;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #374151;
}
.dh-tips-list li {
    margin-bottom: 12px;
}

/* ===== Handoff footer ===== */
.dh-handoff {
    margin-top: 32px;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.dh-handoff-text {
    flex: 1;
    margin: 0;
    color: #4b5563;
    font-size: 0.95rem;
    min-width: 240px;
}

.dh-handoff-status {
    color: var(--brand-accessible, #2E7D32);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== Modals ===== */
.dh-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.dh-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.dh-modal-panel {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.dh-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb;
}
.dh-modal-header h3 { margin: 0; font-size: 1.05rem; }

.dh-modal-body {
    padding: 18px;
    overflow-y: auto;
}

.dh-modal-footer {
    padding: 12px 18px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.dh-pick-context {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 12px;
}
.dh-pick-context strong { color: #1f2933; }

.dh-pick-input { width: 100%; }

.dh-pick-suggestions {
    margin-top: 12px;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.dh-pick-sugg-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}
.dh-pick-sugg-row:last-child { border-bottom: none; }
.dh-pick-sugg-row:hover,
.dh-pick-sugg-row.is-active { background: #eff6ff; }

.dh-pick-sugg-pfp {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--brand-accessible, #2E7D32);
    object-fit: cover;
}

.dh-pick-sugg-name {
    flex: 1;
    font-weight: 600;
    color: #1f2933;
    font-size: 0.95rem;
}

.dh-pick-sugg-meta {
    font-size: 0.8rem;
    color: #6b7280;
}

.dh-pick-sugg-row.is-out {
    opacity: 0.4;
    cursor: not-allowed;
}

/* League picker list */
.dh-league-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dh-league-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
}
.dh-league-meta {
    color: #6b7280;
    font-size: 0.85rem;
}

/* ===== Layout shifts when tips drawer is open on wide screens ===== */
@media (min-width: 1100px) {
    body.dh-tips-open .dh-shell {
        margin-right: 360px;
    }
}

/* ===== Compact / mobile ===== */
@media (max-width: 720px) {
    .dh-shell { padding: 0 12px; margin: 16px auto 80px; }
    .dh-np-coach { font-size: 1.6rem; }
    .dh-tips { width: 100%; max-width: 100%; }
}
