/*
 * AjiraChat: job single "apply" sidebar styles.
 * Loaded by templates/jobs/single/apply.php override.
 */

/* Helper utilities used by Interested / Share boxes */
.ztz-apply-spacer { clear: both; }
.ztz-apply-adwrap { margin-top: 10px; }
.ztz-apply-expired { color: #cc0000; font-weight: bold; }

.ztz-apply-center { justify-content: center; }
.ztz-apply-center .info-apply,
.ztz-apply-center .info-apply h4,
.ztz-apply-center .info-apply .days,
.ztz-apply-center .info-apply .button-wrap { text-align: center; }

.ztz-apply-center .info-apply .days .accent {
    color: var(--civi-color-accent);
}

.ztz-apply-center .button-wrap { margin-top: 15px; }
.ztz-apply-center .info-apply .civi-button { display: inline-block; }

/* ===========================================
 * AjiraChat — mini chat (mobile-first)
 *
 * Every colour derives from the brand accent
 * (--civi-color-accent) via color-mix, so the
 * widget always matches the active theme. The
 * var() fallback only applies if the theme var
 * is missing. The green presence dot is a status
 * indicator, not brand colour.
 * =========================================== */

.ztz-jobchat-chat {
    --ac: var(--civi-color-accent, #4d4ed4);
    --jcc-line:  color-mix(in srgb, var(--ac) 11%, transparent);
    --jcc-muted: color-mix(in srgb, currentColor 55%, transparent);

    /* Match the site body font (Inter). Child elements keep their own compact
     * sizes; this only sets the base family/weight for the widget. */
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: inherit;

    margin-top: 18px;
    background: #fff;
    border: 1px solid var(--jcc-line);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px -20px color-mix(in srgb, var(--ac) 60%, transparent);
    -webkit-tap-highlight-color: transparent;
}

/* ── Header ───────────────────────────────── */
.ztz-jcc-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--jcc-line);
}

.ztz-jcc-avatar {
    position: relative;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--ac), color-mix(in srgb, var(--ac) 68%, #8f7be6));
}

.ztz-jcc-avatar svg { width: 17px; height: 17px; fill: currentColor; }

/* Logo image fills the circle. border-radius on the image (not overflow:hidden
 * on the avatar) so the presence dot, which sits just outside, isn't clipped. */
.ztz-jcc-avatar-img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.ztz-jcc-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
}

.ztz-jcc-identity { flex: 1 1 auto; min-width: 0; line-height: 1.2; }
.ztz-jcc-name   { display: block; font-size: 15px; font-weight: 700; color: inherit; }
.ztz-jcc-status { display: block; font-size: 12.5px; color: var(--jcc-muted); }

/* ── Conversation body ────────────────────── */
.ztz-jcc-body {
    padding: 14px;
    background: color-mix(in srgb, var(--ac) 3%, #fff);
}

.ztz-jcc-greeting {
    max-width: 90%;
    background: #fff;
    border: 1px solid var(--jcc-line);
    border-radius: 4px 14px 14px 14px;
    padding: 11px 14px;
    font-size: 16px;
    line-height: 1.5;
    color: inherit;
    margin-bottom: 12px;
}

.ztz-jcc-replies {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.ztz-jcc-reply-item { margin: 0; max-width: 92%; }

.ztz-jcc-reply {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    border-radius: 14px 14px 4px 14px;
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--ac) 26%, transparent);
    color: var(--ac);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background .16s ease, border-color .16s ease,
        transform .12s ease, box-shadow .16s ease;
}

.ztz-jcc-reply svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* The first reply is the primary action (filled) */
.ztz-jcc-reply-item:first-child .ztz-jcc-reply {
    background: var(--ac);
    border-color: var(--ac);
    color: #fff;
}

.ztz-jcc-reply:active { transform: scale(.97); }

@media (hover: hover) {
    .ztz-jcc-reply:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--ac) 60%, transparent);
    }
    .ztz-jcc-reply-item:not(:first-child) .ztz-jcc-reply:hover {
        background: color-mix(in srgb, var(--ac) 8%, #fff);
        border-color: var(--ac);
    }
}

.ztz-jcc-reply:focus-visible {
    outline: 2px solid var(--ac);
    outline-offset: 2px;
}

/* ── Free-text question bar ───────────────── */
.ztz-jcc-inputbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--jcc-line);
}

.ztz-jcc-input {
    flex: 1 1 auto;
    min-width: 0;
    font: inherit;
    font-size: 16px;
    color: inherit;
    background: color-mix(in srgb, var(--ac) 5%, #fff);
    border: 1px solid var(--jcc-line);
    border-radius: 999px;
    padding: 9px 14px;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.ztz-jcc-input::placeholder { color: color-mix(in srgb, currentColor 45%, transparent); }

.ztz-jcc-input:focus {
    border-color: color-mix(in srgb, var(--ac) 45%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ac) 12%, transparent);
}

.ztz-jcc-send {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border: 0;
    cursor: pointer;
    border-radius: 50%;
    background: var(--ac);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .16s ease;
}

.ztz-jcc-send svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ztz-jcc-send:active { transform: scale(.92); }

@media (hover: hover) {
    .ztz-jcc-send:hover {
        box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--ac) 70%, transparent);
    }
}

.ztz-jcc-send:focus-visible {
    outline: 2px solid var(--ac);
    outline-offset: 2px;
}

/* ── Footer ───────────────────────────────── */
.ztz-jcc-foot {
    margin: 0;
    padding: 10px 14px 12px;
    font-size: 12px;
    text-align: center;
    color: var(--jcc-muted);
    border-top: 1px solid var(--jcc-line);
}

.ztz-jcc-powered { color: var(--ac); font-weight: 700; }

/* ── Wider sidebars / desktop ── */
@media (min-width: 768px) {
    .ztz-jcc-body { padding: 16px; }
}

/* ── Respect reduced-motion preferences ── */
@media (prefers-reduced-motion: reduce) {
    .ztz-jcc-reply,
    .ztz-jcc-send,
    .ztz-jcc-input { transition: none; }
    .ztz-jcc-reply:active,
    .ztz-jcc-send:active { transform: none; }
}
