/* ========================================
   Click-to-post demo: a vector recreation of the
   ThinkReview panel posting one comment to a merge request.
   Laid out on a fixed 720x450 stage; scripts/post-demo.js
   scales the stage and drives the camera, cursor and states.
   ======================================== */

.pd {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #0b0d13;
    font-family: -apple-system, 'Segoe UI', 'Noto Sans', Inter, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    user-select: none;
    pointer-events: none;
    contain: strict;
}

.pd-cam {
    position: absolute;
    left: 0;
    top: 0;
    width: 720px;
    height: 450px;
    transform-origin: 0 0;
    color: #e6e8ef;
}

/* ---------- Merge request page ---------- */

.pd-gl {
    position: absolute;
    left: 0;
    top: 0;
    width: 460px;
    height: 450px;
    overflow: hidden;
    background: #0b0d13;
}

.pd-gl-top {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 3;
    height: 30px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px;
    background: #0b0d13;
    border-bottom: 1px solid #1b2030;
    font-size: 8px;
}

.pd-open {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 9px;
    border-radius: 99px;
    background: #d93f3a;
    color: #fff;
    font-weight: 600;
    font-size: 7.5px;
}

.pd-gl-top b {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #f2f3f7;
}

.pd-gl-top i {
    flex: none;
    font-style: normal;
    color: #7d8497;
}

.pd-gl-scroll {
    position: absolute;
    left: 34px;
    right: 22px;
    top: 38px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pd-card {
    background: #0f121a;
    border: 1px solid #1f2535;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 8px;
    line-height: 1.55;
    color: #cdd1dd;
}

.pd-card h4 {
    margin: 0 0 3px;
    font-size: 9px;
    font-weight: 700;
    color: #f4f5f9;
}

.pd-card ul {
    margin: 0 0 4px;
    padding-left: 11px;
}

.pd-muted {
    color: #7d8497;
}

.pd-tools {
    margin-top: -4px;
}

.pd-activity {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 4px;
    font-size: 7.5px;
    color: #7d8497;
}

.pd-activity .pd-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #3a4156;
}

.pd-activity .pd-ico {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: #1b2030;
    margin-left: -20px;
}

.pd-activity b {
    color: #cdd1dd;
    font-weight: 600;
}

/* the comment that lands in the thread */
.pd-slot {
    position: relative;
    max-height: 0;
    overflow: hidden;
    margin: -4px 0;
    transition: max-height 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), margin 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.pd.is-posted .pd-slot {
    max-height: 160px;
    margin: 0;
}

.pd-comment {
    position: relative;
    margin-left: 0;
    padding: 0;
    border: 1px solid #1f2535;
    border-radius: 6px;
    background: #0f121a;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.5s ease 0.15s, transform 0.5s ease 0.15s, border-color 1.6s ease 0.6s, box-shadow 1.6s ease 0.6s;
}

.pd.is-posted .pd-comment {
    opacity: 1;
    transform: none;
    border-color: #2f6fe0;
    box-shadow: 0 0 0 1px rgba(47, 111, 224, 0.45), 0 0 16px rgba(47, 111, 224, 0.28);
}

.pd.is-settled .pd-comment {
    border-color: #1f2535;
    box-shadow: none;
}

.pd-comment-av {
    position: absolute;
    left: -26px;
    top: 0;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 38%, #f3d6c8 0 22%, #c33 23% 100%);
    border: 1px solid #2a3042;
}

.pd-comment-h {
    padding: 5px 12px;
    border-bottom: 1px solid #1b2030;
    background: #121623;
    font-size: 8px;
    color: #7d8497;
    border-radius: 6px 6px 0 0;
}

.pd-comment-h b {
    color: #f0f1f6;
    font-weight: 600;
    margin-right: 3px;
}

.pd-comment-b {
    padding: 8px 12px 9px;
    font-size: 8px;
    line-height: 1.55;
    color: #d6d9e3;
}

.pd-comment-b p {
    margin: 0 0 5px;
}

.pd-comment-b code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 7.4px;
    color: #aab2c8;
}

.pd-checks {
    padding: 0;
    overflow: hidden;
}

.pd-checks-h {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
}

.pd-ring {
    flex: none;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 3px solid #2b6fd6;
    border-top-color: #e3a02c;
    border-left-color: #e3a02c;
}

.pd-checks-h h4 {
    margin: 0;
}

.pd-checks-h span {
    display: block;
    font-size: 7.5px;
    color: #7d8497;
}

.pd-jobs {
    background: #000;
    padding: 4px 0 2px;
    font-size: 7.5px;
}

.pd-job {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-top: 1px solid #14171f;
    white-space: nowrap;
    overflow: hidden;
}

.pd-job i {
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e3a02c;
}

.pd-job i.is-fail {
    width: 8px;
    height: 8px;
    background: #d93f3a;
}

.pd-job b {
    font-weight: 600;
    color: #e8eaf1;
}

.pd-job span {
    color: #7d8497;
}

.pd-add {
    position: relative;
    padding: 0 0 0 0;
}

.pd-add-h {
    position: relative;
    font-size: 9px;
    font-weight: 700;
    color: #f4f5f9;
    margin: 4px 0 5px;
}

.pd-add-h::before {
    content: '';
    position: absolute;
    left: -26px;
    top: -2px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 38%, #f3d6c8 0 22%, #c33 23% 100%);
    border: 1px solid #2a3042;
}

.pd-editor {
    height: 60px;
    border: 1px solid #1f2535;
    border-radius: 6px;
    background: #0f121a;
    font-size: 7.5px;
    color: #7d8497;
}

.pd-editor div {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    border-bottom: 1px solid #1b2030;
}

.pd-editor b {
    color: #f0f1f6;
}

/* ---------- ThinkReview panel ---------- */

.pd-tr {
    position: absolute;
    left: 460px;
    top: 0;
    width: 260px;
    height: 450px;
    overflow: hidden;
    background: #1d1d20;
    box-shadow: -10px 0 24px rgba(0, 0, 0, 0.45);
}

.pd-tr-h {
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    background: linear-gradient(180deg, #7650d1, #6a45c4);
    color: #fff;
}

.pd-tr-logo {
    flex: none;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.92);
    color: #6a45c4;
    font-size: 7px;
    font-weight: 800;
    line-height: 14px;
    text-align: center;
}

.pd-tr-h b {
    display: block;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.1;
}

.pd-tr-h small {
    display: block;
    font-size: 6px;
    opacity: 0.8;
}

.pd-tr-h .pd-sp {
    flex: 1;
}

.pd-tr-btn {
    flex: none;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.16);
}

.pd-tr-sel {
    flex: none;
    padding: 2px 6px;
    border-radius: 3px;
    background: #fff;
    color: #333;
    font-size: 6.5px;
}

.pd-tr-sign {
    flex: none;
    padding: 2px 5px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    font-size: 6px;
}

.pd-tabs {
    display: flex;
    gap: 14px;
    height: 24px;
    padding: 0 12px;
    align-items: center;
    background: #1d1d20;
    border-bottom: 1px solid #2a2a2e;
    font-size: 7.5px;
    color: #8c8c96;
}

.pd-tabs span:first-child {
    position: relative;
    color: #f2f2f5;
    font-weight: 600;
}

.pd-tabs span:first-child::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -7px;
    height: 2px;
    background: #8f6df0;
}

.pd-tr-body {
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    bottom: 46px;
    padding: 8px 9px;
    overflow: hidden;
}

.pd-sev {
    border-radius: 6px;
    background: #26262a;
    padding: 8px 9px 9px;
    margin-bottom: 8px;
    border-left: 3px solid #d6403f;
}

.pd-sev.is-high {
    border-left-color: #e0952a;
}

.pd-sev h5 {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-size: 8.5px;
    font-weight: 700;
    color: #f4f4f7;
}

.pd-sev h5::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.pd-none {
    margin: 9px 0 3px;
    text-align: center;
    font-size: 7px;
    color: #77777f;
}

.pd-find {
    position: relative;
    margin-top: 7px;
    padding: 7px 8px 8px 14px;
    border-radius: 5px;
    background: #2b2b2f;
    transition: background 0.35s ease, box-shadow 0.35s ease;
}

.pd-find::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 11px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #aaa;
}

.pd-find.is-active {
    background: #332c52;
    box-shadow: inset 0 0 0 1px rgba(143, 109, 240, 0.35);
}

.pd-find h6 {
    margin: 0 38px 4px 0;
    font-size: 8px;
    font-weight: 700;
    line-height: 1.3;
    color: #f6f6f9;
}

.pd-path {
    display: inline-block;
    max-width: 100%;
    margin-bottom: 5px;
    padding: 1px 5px;
    border-radius: 3px;
    background: #1d1d20;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 6.4px;
    color: #9d9da8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pd-find p {
    margin: 0;
    font-size: 7.2px;
    line-height: 1.5;
    color: #d3d3d9;
}

.pd-acts {
    position: absolute;
    right: 6px;
    top: 6px;
    display: flex;
    gap: 5px;
}

.pd-act {
    position: relative;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    color: #8f8f99;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.pd-act svg {
    width: 8px;
    height: 8px;
}

.pd-act .pd-ok {
    display: none;
}

.pd-find.is-active .pd-post {
    color: #fff;
}

.pd.is-hover .pd-post {
    background: rgba(143, 109, 240, 0.35);
    color: #fff;
}

.pd.is-click .pd-post {
    background: #3b9cff;
    color: #fff;
    transform: scale(0.86);
}

.pd.is-posted .pd-post {
    background: #2e9d62;
    color: #fff;
    transform: none;
}

.pd.is-posted .pd-post .pd-send {
    display: none;
}

.pd.is-posted .pd-post .pd-ok {
    display: block;
}

.pd-ripple {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: rgba(59, 156, 255, 0.55);
    opacity: 0;
}

.pd.is-click .pd-ripple {
    animation: pd-ripple 0.9s ease-out 1;
}

@keyframes pd-ripple {
    0% {
        transform: scale(0.4);
        opacity: 0.9;
    }
    100% {
        transform: scale(3.2);
        opacity: 0;
    }
}

.pd-tip {
    position: absolute;
    right: -2px;
    bottom: 100%;
    margin-bottom: 4px;
    padding: 2px 5px;
    border-radius: 3px;
    background: #0d0d10;
    border: 1px solid #3a3a42;
    font-size: 6.4px;
    white-space: nowrap;
    color: #e8e8ee;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.pd.is-hover:not(.is-posted) .pd-tip {
    opacity: 1;
    transform: none;
}

.pd-tr-in {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 46px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 9px;
    background: #18181b;
    border-top: 1px solid #2c2c31;
}

.pd-tr-field {
    flex: 1;
    height: 26px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 9px;
    border: 1px solid #34343b;
    background: #1d1d20;
    font-size: 7.5px;
    color: #7c7c86;
}

.pd-tr-send {
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #7c58dd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.pd-tr-send svg {
    width: 11px;
    height: 11px;
}

.pd-toast {
    position: absolute;
    left: 50%;
    bottom: 54px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 8px;
    border-radius: 99px;
    background: #101013;
    border: 1px solid #44444d;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
    font-size: 7.6px;
    font-weight: 600;
    color: #f1f1f5;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, 6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.pd.is-posting .pd-toast {
    opacity: 1;
    transform: translate(-50%, 0);
}

.pd-spin {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid #5d5d68;
    border-top-color: #b79cff;
    animation: pd-spin 0.7s linear infinite;
}

@keyframes pd-spin {
    to {
        transform: rotate(360deg);
    }
}

.pd-cursor {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 9;
    width: 13px;
    height: 17px;
    margin: 0;
    opacity: 0;
    filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.6));
}

@media (prefers-reduced-motion: reduce) {
    .pd-slot,
    .pd-comment,
    .pd-find,
    .pd-toast {
        transition: none;
    }

    .pd-spin {
        animation: none;
    }
}
