/*
    TNT | NarniaSaga2026
    File:    styles/narniaSPARKChatlogStyles.css
    Created: 2026-10-11 | Moved: 2026-10-11
    Author:  klp + GitHub Copilot (Claude Sonnet 4.6)

    Styles for narniaSPARKChatlog.html.
    Moved from NarniaSPARKStg7/styles/ to NarniaSaga2026/styles/
    because the chatlog spans all stages, not just Stage 7.

    The hero background url() is relative to THIS file's location:
      ../images/narniaWallpaper.jpg  →  NarniaSaga2026/images/narniaWallpaper.jpg  ✓

    Color palette:
      --narnia-gold  #c4760a   Aslan's mane — primary accent
      --narnia-ice   #4ab8c4   White Witch's castle — secondary accent
      --narnia-dark  #0d1b2a   Narnia night sky — dark backgrounds
      --narnia-deep  #060f18   Deepest background
*/

:root {
    --narnia-gold:   #c4760a;
    --narnia-ice:    #4ab8c4;
    --narnia-dark:   #0d1b2a;
    --narnia-deep:   #060f18;
    --narnia-frost:  #e8f4f8;
}

/* ════════════════════════════════════════════════════════
   HERO
════════════════════════════════════════════════════════ */
#hero {
    background:
        linear-gradient(135deg, rgba(6,15,24,0.48) 0%, rgba(13,27,42,0.35) 100%),
        url('../images/narniaWallpaper.jpg') center 25% / cover no-repeat;
    background-color: var(--narnia-deep);
    min-height: 210px;
    padding: 3rem 1rem 2.5rem;
}

.hero-title    { font-size: clamp(1.9rem, 5vw, 3.2rem); margin-bottom: 0.5rem; }
.hero-subtitle { font-size: clamp(0.88rem, 1.8vw, 1.05rem); }

/* ════════════════════════════════════════════════════════
   BACK BAR
════════════════════════════════════════════════════════ */
.back-bar {
    background: var(--narnia-deep);
    border-bottom: 2px solid var(--narnia-gold);
    padding: 0.55rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.88rem;
}

.back-bar a {
    color: var(--narnia-gold);
    font-weight: 700;
    text-decoration: none;
}
.back-bar a:hover { text-decoration: underline; }
.back-bar span { color: rgba(232,244,248,0.38); font-size: 0.78rem; }

/* ════════════════════════════════════════════════════════
   LOG CONTAINER
════════════════════════════════════════════════════════ */
.log-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
}

/* ════════════════════════════════════════════════════════
   SPARK PHASE BANNERS
   Each letter of S.P.A.R.K. gets its own color band.
════════════════════════════════════════════════════════ */
.spark-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 0.9rem 1.1rem;
    border-radius: 10px;
    margin: 1.6rem 0 0.6rem;
    font-size: 0.9rem;
    line-height: 1.55;
}

.spark-banner .spark-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    line-height: 1.2;
}

.spark-banner strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

/* S — Set Goal (blue) */
.spark-s { background: #e8f4fd; border-left: 5px solid #3498DB; }

/* P — Prompt (green) */
.spark-p { background: #eafaf1; border-left: 5px solid #27AE60; }

/* A — Analyze (yellow) */
.spark-a { background: #fef9e7; border-left: 5px solid #F1C40F; }

/* R — Refine (purple) */
.spark-r { background: #fdf2fb; border-left: 5px solid #8E44AD; }

/* K — Know / Keep (gold — matches Narnia theme) */
.spark-k { background: #fef5ec; border-left: 5px solid var(--narnia-gold); }

/* ════════════════════════════════════════════════════════
   CHAT BUBBLES
   User bubbles: right-aligned blue
   Copilot bubbles: left-aligned green
════════════════════════════════════════════════════════ */
.chat-turn { margin: 0.5rem 0 1.2rem; }

.chat-speaker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.chat-speaker.user    { color: #1a5276; text-align: right; }
.chat-speaker.copilot { color: #145A32; }

.chat-bubble {
    display: inline-block;
    max-width: 90%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.92rem;
    line-height: 1.6;
}

.chat-bubble p:last-child,
.chat-bubble ul:last-child,
.chat-bubble ol:last-child { margin-bottom: 0; }

.bubble-user {
    background: #d6eaf8;
    border: 1px solid #aed6f1;
    color: #1a2a3a;
    border-bottom-right-radius: 3px;
    float: right;
    clear: both;
    text-align: left;
}

.bubble-copilot {
    background: #eafaf1;
    border: 1px solid #a9dfbf;
    color: #1a2a1a;
    border-bottom-left-radius: 3px;
    float: left;
    clear: both;
}

.bubble-user-wrap { text-align: right; }
.bubble-user-wrap .chat-bubble { text-align: left; }

/* clearfix after each turn */
.chat-turn::after { content: ""; display: table; clear: both; }

/* inline code inside bubbles */
.chat-bubble code {
    background: rgba(0,0,0,0.08);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: "Noto Sans Mono", "Consolas", monospace;
    font-size: 0.85em;
    /* Override Bootstrap 5's default  code { color: #d63384 }  (bright pink).
       Without this, any <code> element inside a bubble inherits Bootstrap's
       pink — visible as jarring red fragments wherever surrounding text is
       light-colored.  #0d6673 is a readable dark teal on both bubble
       backgrounds: ~6.7:1 on the green copilot bubble, ~5.8:1 on the blue
       user bubble. */
    color: #0d6673;
}

/* ════════════════════════════════════════════════════════
   CALLOUT BOXES
════════════════════════════════════════════════════════ */

/* Amber critique box — prompt evaluation */
.critique-box {
    background: #fffbf2;
    border: 2px solid var(--narnia-gold);
    border-radius: 8px;
    padding: 0.9rem 1.1rem;
    margin: 1rem 0;
    font-size: 0.88rem;
    line-height: 1.6;
}

.critique-box .critique-label {
    font-weight: 700;
    font-size: 0.70rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #8c5400;
    margin-bottom: 0.3rem;
}

/* Teal decision box — design choices made */
.decision-box {
    background: #eaf4f4;
    border-left: 5px solid var(--narnia-ice);
    border-radius: 0 8px 8px 0;
    padding: 0.9rem 1.1rem;
    margin: 1rem 0;
    font-size: 0.88rem;
    line-height: 1.6;
}

.decision-box .decision-label {
    font-weight: 700;
    font-size: 0.70rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--narnia-ice);
    margin-bottom: 0.3rem;
}

/* Gray aside / student note box */
.aside-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.9rem 1.1rem;
    margin: 1rem 0;
    font-size: 0.88rem;
    line-height: 1.6;
}

.aside-box .aside-label {
    font-weight: 700;
    font-size: 0.70rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #c0392b;
    margin-bottom: 0.3rem;
}

/* OOP teaching callout — ice blue */
.oop-box {
    background: #edf7fb;
    border-left: 5px solid var(--narnia-ice);
    border-radius: 0 8px 8px 0;
    padding: 0.9rem 1.1rem;
    margin: 1rem 0;
    font-size: 0.88rem;
    line-height: 1.6;
}

.oop-box .oop-label {
    font-weight: 700;
    font-size: 0.70rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #0e6d7a;
    margin-bottom: 0.3rem;
}

/* ════════════════════════════════════════════════════════
   CODE BLOCKS  (pre + code)

   WHY THIS FIX IS NEEDED:
   All <pre> blocks in the chatlog use an inline style:
     background: rgba(0,0,0,0.4)

   'rgba(0,0,0,0.4)' is semi-transparent.  It BLENDS with
   whatever container the <pre> sits inside:
     - .bubble-copilot  (#eafaf1, light green) → blends to ~#8c9691
     - .oop-box         (#edf7fb, light blue)  → blends to ~#8e9497
     - .critique-box    (#fffbf2, near-white)  → blends to ~#999690

   The resulting medium-gray background gives ice-blue text
   (#4ab8c4) only ~1.3:1 contrast — nearly indistinguishable.

   SOLUTION: override with a solid dark background.
   --narnia-dark (#0d1b2a) is opaque — it looks the same in
   every container.  Contrast of #4ab8c4 on #0d1b2a ≈ 8:1
   (WCAG AAA).  The orange bug-highlight (#fa7108) also
   benefits: ~6.4:1 contrast on the same dark background.
════════════════════════════════════════════════════════ */
pre {
    background: var(--narnia-dark) !important; /* solid — no alpha blending */
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.83rem;
    overflow-x: auto;
    line-height: 1.5;
    margin-top: 0.5rem;
}

/* Prevent .chat-bubble code { background: rgba(0,0,0,0.08) }
   from re-darkening the <code> element inside a <pre>.
   !important ensures pre's inline color:#4ab8c4 (or #fa7108) wins
   over any box-level code color rule below. */
pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    color: inherit !important;
}

/* ════════════════════════════════════════════════════════
   INLINE CODE COLOR — all box types
   Bootstrap 5 sets  code { color: #d63384 }  globally.
   This is overridden for chat bubbles above, and here for
   every other light-background callout box.  Without this,
   any <code> inside a box whose surrounding paragraph uses
   a near-white rgba color appears as an isolated pink/red
   fragment — the only visible thing in the paragraph.
════════════════════════════════════════════════════════ */
.oop-box code,
.decision-box code,
.critique-box code,
.aside-box code {
    color: #0d6673; /* dark teal — readable on all light box backgrounds */
}

/* ════════════════════════════════════════════════════════
   LOG DIVIDER
════════════════════════════════════════════════════════ */
.log-divider {
    text-align: center;
    margin: 2.2rem 0 0.5rem;
    color: #aaa;
    font-size: 0.78rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.log-divider::before,
.log-divider::after {
    content: "";
    display: inline-block;
    width: 60px;
    height: 1px;
    background: #ddd;
    vertical-align: middle;
    margin: 0 0.7rem;
}

/* ════════════════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════════════════ */
footer { background: var(--narnia-deep) !important; }
