/* ===========================================================================
   shared/sidekick-agent.css — Phase 2 minimal styling for the agent runner.

   Two UI primitives:
     .sk-agent-highlight — fixed-positioned ring drawn around the target
                           element the AI wants the teacher to look at.
     .sk-agent-narration — small card pinned next to the highlight with one
                           short sentence + (mode-dependent) buttons.

   Phase 3 will polish the look + add the narration card's tail/pointer to
   visually connect it to the highlighted element. For Phase 2 we want
   functional + obviously-readable, not pretty.
   ========================================================================= */

/* --- Highlight ring -------------------------------------------------------*/

.sk-agent-highlight {
    border-radius: 10px;
    box-shadow:
        0 0 0 3px rgba(46, 165, 109, 0.95),
        0 0 0 8px rgba(46, 165, 109, 0.25),
        0 0 24px 8px rgba(46, 165, 109, 0.35);
    background: rgba(46, 165, 109, 0.06);
    animation: sk-agent-pulse 1.8s ease-in-out infinite;
    transition: left 0.18s ease, top 0.18s ease,
                width 0.18s ease, height 0.18s ease;
}

@keyframes sk-agent-pulse {
    0%, 100% {
        box-shadow:
            0 0 0 3px rgba(46, 165, 109, 0.95),
            0 0 0 8px rgba(46, 165, 109, 0.25),
            0 0 24px 8px rgba(46, 165, 109, 0.35);
    }
    50% {
        box-shadow:
            0 0 0 3px rgba(46, 165, 109, 1),
            0 0 0 14px rgba(46, 165, 109, 0.18),
            0 0 36px 14px rgba(46, 165, 109, 0.45);
    }
}

/* --- Narration card -------------------------------------------------------*/

.sk-agent-narration {
    background: #fff;
    color: #1f2937;
    border-radius: 12px;
    box-shadow:
        0 12px 32px rgba(15, 23, 42, 0.22),
        0 4px 10px rgba(15, 23, 42, 0.10);
    border: 1px solid rgba(15, 23, 42, 0.08);
    padding: 12px 14px 14px;
    width: 280px;
    max-width: calc(100vw - 32px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    transition: top 0.18s ease, left 0.18s ease, opacity 0.18s ease;
    animation: sk-agent-narration-in 0.22s ease-out;
}

@keyframes sk-agent-narration-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sk-narr-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #2ea56d;
    margin-bottom: 6px;
}

.sk-narr-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ea56d;
    box-shadow: 0 0 0 3px rgba(46, 165, 109, 0.22);
}

.sk-narr-body {
    color: #1f2937;
    font-weight: 400;
    margin-bottom: 10px;
}

.sk-narr-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.sk-narr-btn {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sk-narr-primary {
    background: #2ea56d;
    color: #ffffff;
}

.sk-narr-primary:hover {
    background: #258a5b;
}

.sk-narr-secondary {
    background: #f3f4f6;
    color: #374151;
    border-color: rgba(15, 23, 42, 0.08);
}

.sk-narr-secondary:hover {
    background: #e5e7eb;
}

/* --- Teach / Auto mode toggle in the panel header status line ------------
   The status text doubles as a clickable toggle (Phase 3). Add a subtle
   pointer + hover affordance so teachers discover they can switch modes
   without buried account-settings or console commands.                   */
.ai-panel-mode-toggle {
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s ease;
}
.ai-panel-mode-toggle:hover {
    opacity: 0.78;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- Don't dim our own UI when a modal is open ----------------------------
   ai-assistant.css's body.tc-modal-open rule dims .ai-panel via opacity +
   pointer-events:none. The highlight + narration card are mounted at body
   level too, so without an override they'd also dim while a modal is open —
   which would defeat the entire point. Keep them at full opacity + fully
   interactive when teaching through a modal flow. */
body.tc-modal-open .sk-agent-highlight,
body.tc-modal-open .sk-agent-narration {
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto !important;
}
