/* info-contrib.css — public contribution overlay styling */

/* Pending nodes look different from real ones so the contributor can tell
   their additions apart from the published tree. Pending = dashed border +
   warning pill color. */
.tree-node[data-key^="__pending_"] {
    border-style: dashed !important;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
    opacity: 0.95;
}
.tree-node[data-key^="__pending_"]::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    pointer-events: none;
    border: 1px dashed rgba(245, 158, 11, 0.55);
    opacity: 0.6;
}

/* ───────────── toast ───────────── */
.contrib-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 40px);
    background: #1f2937;
    color: #f9fafb;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 14px;
    max-width: 92vw;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 10000;
}
.contrib-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}
.contrib-toast[data-kind="success"] { background: #15803d; }
.contrib-toast[data-kind="warn"]    { background: #b45309; }

/* ───────────── modal ───────────── */
.contrib-modal-wrap {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: contribFadeIn 0.15s ease;
}
@keyframes contribFadeIn { from { opacity: 0; } to { opacity: 1; } }
.contrib-modal {
    background: #ffffff;
    color: #111827;
    width: min(520px, 92vw);
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    direction: rtl;
    font-family: 'Cairo', system-ui, sans-serif;
}
.contrib-modal h3 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 800;
}
.contrib-modal .muted { color: #6b7280; font-size: 13px; margin: 0 0 14px; }
.contrib-modal label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 12px 0 4px;
    color: #374151;
}
.contrib-modal input[type="text"],
.contrib-modal textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
    background: #f9fafb;
}
.contrib-modal input[type="text"]:focus,
.contrib-modal textarea:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
}
.contrib-modal textarea { resize: vertical; min-height: 90px; }

/* Hidden honeypot */
.contrib-modal .contrib-hp {
    position: absolute !important;
    left: -10000px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ───────────── color palette ───────────── */
.contrib-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}
.contrib-palette .sw {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.contrib-palette .sw.selected {
    border-color: #111827;
    transform: scale(1.12);
}

/* ───────────── actions ───────────── */
.contrib-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 18px;
}
.contrib-actions button {
    padding: 10px 18px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-family: inherit;
}
.contrib-actions .btn-ghost {
    background: #e5e7eb;
    color: #374151;
}
.contrib-actions .btn-ghost:hover { background: #d1d5db; }
.contrib-actions .btn-primary {
    background: #2563eb;
    color: #ffffff;
}
.contrib-actions .btn-primary:hover { background: #1d4ed8; }

/* Dark theme honors */
body[data-theme="dark"] .contrib-modal {
    background: #1f2937;
    color: #f3f4f6;
}
body[data-theme="dark"] .contrib-modal .muted { color: #9ca3af; }
body[data-theme="dark"] .contrib-modal label { color: #e5e7eb; }
body[data-theme="dark"] .contrib-modal input[type="text"],
body[data-theme="dark"] .contrib-modal textarea {
    background: #111827;
    border-color: #374151;
    color: #f3f4f6;
}
body[data-theme="dark"] .contrib-actions .btn-ghost {
    background: #374151;
    color: #e5e7eb;
}
