/* =========================================================================
   PV-COPILOT — light-gray editorial / agent-chat layout
   Append this block to your existing assets/style.css

   Fonts: Arial (sans body/UI) and Times New Roman (serif accents).
   No web fonts loaded — both are system fonts on every OS.
   ========================================================================= */

/* All rules scoped under .pvcopilot-root so the rest of pvtools is unaffected */

.pvcopilot-root {
    font-family: Arial, sans-serif;
    color: #0f172a;
    background: #f8fafc;
    font-size: 15px;   /* base body size — bumped from default */
    line-height: 1.55;
}

.pvcopilot-root ::-webkit-scrollbar { width: 8px; height: 8px; }
.pvcopilot-root ::-webkit-scrollbar-track  { background: transparent; }
.pvcopilot-root ::-webkit-scrollbar-thumb  { background: #cbd5e1; border-radius: 4px; }
.pvcopilot-root ::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Slide-in animation (separate keyframe so it doesn't collide with pvtools' existing slideInUp) */
@keyframes pvcopilot-slide-in-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pvcopilot-root .agent-msg {
    animation: pvcopilot-slide-in-up 0.5s ease-out both;
}

/* Buttons inside the copilot get a subtle hover lift */
.pvcopilot-root button {
    transition: all 0.15s ease;
}
.pvcopilot-root button:hover:not(:disabled) {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.pvcopilot-root button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

/* Stepper row hover — subtle hover so it's obvious they're clickable */
.pvcopilot-root div[id*='step-row'] {
    cursor: pointer;
}
.pvcopilot-root div[id*='step-row']:hover {
    background: rgba(255, 255, 255, 0.7) !important;
}

/* Chat — typing animation */
@keyframes pvcopilot-blink {
    0%, 50%   { opacity: 1; }
    51%, 100% { opacity: 0; }
}
.pvcopilot-root .chat-typing-caret {
    display: inline-block;
    margin-left: 1px;
    color: #0064AB;
    animation: pvcopilot-blink 0.9s steps(2, end) infinite;
    font-weight: 400;
}

/* Chat — thinking dots (pre-first-character pulse) */
@keyframes pvcopilot-dots-pulse {
    0%, 100% { opacity: 0.45; }
    50%      { opacity: 1; }
}
.pvcopilot-root .chat-thinking-dots {
    animation: pvcopilot-dots-pulse 1.2s ease-in-out infinite;
}

/* Chat — bubble fade-in on mount */
@keyframes pvcopilot-bubble-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.pvcopilot-root #chat-history > div {
    animation: pvcopilot-bubble-in 0.25s ease-out both;
}

/* Chat — example chip hover */
.pvcopilot-root button[id*='chat-example']:hover {
    background: #f8fafc !important;
    border-color: #0064AB !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 100, 171, 0.12);
}

/* Radio labels — keep inherited color (avoid Bootstrap link-blue bleed) */
.pvcopilot-root .metric-radio-label,
.pvcopilot-root .metric-radio-label:hover,
.pvcopilot-root .metric-radio-label * {
    color: inherit !important;
    text-decoration: none !important;
}

/* <details>/<summary> caret styling */
.pvcopilot-root details > summary {
    list-style: none;
    font-size: 14px;
}
.pvcopilot-root details > summary::-webkit-details-marker {
    display: none;
}
.pvcopilot-root details > summary::before {
    content: "▸ ";
    transition: transform 0.2s;
    display: inline-block;
    color: #64748b;
}
.pvcopilot-root details[open] > summary::before {
    content: "▾ ";
}

/* Recolor dash-bootstrap checkboxes to ink */
.pvcopilot-root .form-check-input:checked {
    background-color: #0f172a !important;
    border-color:     #0f172a !important;
}

/* Hide the legacy page-title only inside the copilot */
.pvcopilot-root .page-title {
    display: none;
}

/* Inputs and number fields — readable size */
.pvcopilot-root input[type="text"],
.pvcopilot-root input[type="number"] {
    font-size: 14px !important;
    font-family: Arial, sans-serif;
}

/* Plotly default override */
.pvcopilot-root .js-plotly-plot {
    font-size: 13px;
}

/* Responsive: collapse the two-column shell on narrow screens */
@media (max-width: 820px) {
    .pvcopilot-root .pvcopilot-shell {
        flex-direction: column !important;
    }
    .pvcopilot-root .pvcopilot-shell > div:first-child {
        width: 100% !important;
        max-height: none !important;
        position: relative !important;
        top: auto !important;
        border-right: none !important;
        border-bottom: 1px solid #e2e8f0 !important;
    }
}