/* Full opaque takeover on both orientations - no dimmed landing page peeking through around the
   edges. On landscape the selection screen fills this same area (just wider, 2-column), and the
   chat window sits centered inside it. Visual polish (borders, radii, per-Rojo chrome) is a later
   pass - see workspace/boards/tasks.page "Landing Page: Interactive Text Guide". */
guide-overlay
{
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: hsl( 226, 21%, 8% );
  opacity: 0;
  pointer-events: none;
  overflow-y: auto;
  transition: opacity 150ms ease;
}

guide-overlay.guide-visible
{
  opacity: 1;
  pointer-events: auto;
}

guide-close-button
{
  display: block;
  position: fixed;
  top: 4vw;
  right: 4vw;
  width: 8vw;
  height: 8vw;
  z-index: 1;
  cursor: pointer;
  color: hsl( 0, 0%, 100% );
  font-size: 6vw;
  font-weight: 800;
  line-height: 8vw;
  text-align: center;
  border-radius: 50%;
  background-color: hsla( 0, 0%, 100%, 0.08 );
  transition: background-color 150ms ease;
}

guide-close-button::before
{
  content: "\2715";
}

guide-close-button:hover
{
  background-color: hsla( 0, 0%, 100%, 0.18 );
}

/* ============== SELECTION SCREEN ===================================   */

guide-selection
{
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 100%;
  padding: 20vw 6vw 10vw 6vw;
  text-align: center;
}

guide-selection[hidden]
{
  display: none;
}

guide-selection-title
{
  display: block;
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  font-size: 8vw;
  color: hsl( 0, 0%, 100% );
}

guide-selection-subtitle
{
  display: block;
  color: hsl( 219.1, 24%, 74.9% );
  font-size: 3.6vw;
  margin-top: 2vw;
  margin-bottom: 8vw;
}

guide-rojo-grid
{
  display: grid;
  grid-template-columns: 1fr;
  gap: 5vw;
  max-width: 480px;
  margin: 0 auto;
}

guide-rojo-card
{
  display: flex;
  align-items: center;
  gap: 4vw;
  text-align: left;
  padding: 4vw;
  border-radius: 3vw;
  cursor: pointer;
  background: color-mix( in srgb, var( --rojo-color, #666 ) 20%, hsl( 226, 21%, 14% ) );
  border: 1px solid color-mix( in srgb, var( --rojo-color, #666 ) 45%, transparent );
  transition: transform 150ms ease, background 150ms ease;
}

guide-rojo-card:hover,
guide-rojo-card:active
{
  transform: scale( 1.02 );
  background: color-mix( in srgb, var( --rojo-color, #666 ) 32%, hsl( 226, 21%, 14% ) );
}

guide-rojo-info
{
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

guide-rojo-avatar
{
  display: block;
  flex: 0 0 auto;
  width: 16vw;
  height: 16vw;
  max-width: 84px;
  max-height: 84px;
  border-radius: 15%;
  overflow: hidden;
  background: var( --rojo-color, #444 );
}

guide-rojo-avatar svg
{
  display: block;
  width: 100%;
  height: 100%;
}

guide-rojo-name
{
  display: block;
  font-weight: 800;
  font-style: italic;
  color: hsl( 0, 0%, 100% );
  font-size: 4.2vw;
}

guide-rojo-topic
{
  display: block;
  color: hsl( 219.1, 24%, 74.9% );
  font-size: 3.2vw;
  margin-top: 0.4em;
}

/* ============== CHAT SCREEN ===================================   */
/* Header is auto-height, history fills whatever's left (flex:1, min-height:0 so it can actually
   scroll instead of growing), composer is a fixed height set from JS and dragged via
   guide-chat-resize-handle - same shape as rojo-chat-panel's own history/rcp-resize-handle/input-area. */

guide-chat
{
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  background: hsl( 226, 21%, 13% );
}

guide-chat[hidden]
{
  display: none;
}

guide-chat-toolbar
{
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3vw;
  padding: 4vw 16vw 4vw 4vw;
  background: color-mix( in srgb, var( --rojo-color, #1a5fd4 ) 20%, hsl( 226, 21%, 12% ) );
  border-bottom: 1px solid color-mix( in srgb, var( --rojo-color, #1a5fd4 ) 30%, hsl( 226, 21%, 12% ) );
}

guide-chat-avatar
{
  display: block;
  flex: 0 0 auto;
  width: 10vw;
  height: 10vw;
  max-width: 48px;
  max-height: 48px;
  border-radius: 15%;
  overflow: hidden;
  background: var( --rojo-color, #444 );
}

guide-chat-avatar svg
{
  display: block;
  width: 100%;
  height: 100%;
}

guide-chat-info
{
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

guide-chat-name
{
  display: block;
  font-weight: 800;
  font-style: italic;
  color: hsl( 0, 0%, 100% );
  font-size: 3.6vw;
}

guide-chat-id
{
  display: block;
  margin-top: 0.2em;
  color: hsl( 219.1, 15%, 45% );
  font-size: 2.6vw;
  font-family: monospace;
  letter-spacing: 0.03em;
}

/* Styled like the editor's shared <panel-button> (icon on top, label below) - see
   source/components/editor-shell/panel-button.css - reproduced here instead of importing it since
   the landing page stays deliberately independent of the editor bundle. */
guide-new-chat-button
{
  display: block;
  flex: 0 0 auto;
  cursor: pointer;
  text-align: center;
  padding: 0.5em 0.8em;
  background: hsla( 0, 0%, 100%, 0.08 );
  border: 1px solid transparent;
  border-radius: 0.6em;
  color: hsla( 0, 0%, 100%, 0.7 );
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

guide-new-chat-button:hover
{
  background: hsla( 0, 0%, 0%, 0.15 );
  border-color: hsla( 0, 0%, 100%, 0.15 );
  color: hsl( 0, 0%, 100% );
}

guide-new-chat-button img
{
  display: block;
  width: 5vw;
  height: 5vw;
  max-width: 22px;
  max-height: 22px;
  margin: 0 auto 0.3em auto;
  opacity: 0.7;
}

guide-new-chat-button:hover img
{
  opacity: 1;
}

guide-new-chat-button panel-label
{
  display: block;
  font-weight: 700;
  font-size: 2.4vw;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

guide-chat-history
{
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 3vw;
  overflow-y: auto;
  color: hsl( 219.1, 24%, 74.9% );
  font-size: 3.4vw;
  padding: 4vw;
}

/* Sits between guide-chat-history and guide-chat-composer - dragging it resizes the composer
   directly (history is flex:1 and just fills whatever's left), same approach as rojo-chat-panel's
   own rcp-resize-handle. */
guide-chat-resize-handle
{
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  height: 1.2em;
  cursor: row-resize;
  touch-action: none;
}

guide-chat-resize-handle::before
{
  content: "";
  display: block;
  width: 8vw;
  max-width: 40px;
  height: 3px;
  border-radius: 999px;
  background: hsla( 0, 0%, 100%, 0.18 );
}

guide-chat-resize-handle:hover::before
{
  background: hsla( 0, 0%, 100%, 0.32 );
}

guide-msg-user,
guide-msg-assistant
{
  display: block;
  max-width: 82%;
  padding: 0.8em 1em;
  border-radius: 1em;
  line-height: 1.4;
}

guide-msg-user
{
  align-self: flex-end;
  background: color-mix( in srgb, var( --rojo-color, #1a5fd4 ) 55%, hsl( 226, 21%, 20% ) );
  color: hsl( 0, 0%, 100% );
  border-bottom-right-radius: 0.2em;
}

guide-msg-assistant
{
  align-self: flex-start;
  background: hsl( 226, 21%, 18% );
  border-bottom-left-radius: 0.2em;
}

guide-msg-assistant h4
{
  margin: 0 0 0.3em 0;
  font-size: 1em;
  font-style: italic;
  color: var( --rojo-color, hsl( 195, 100%, 46% ) );
}

guide-msg-assistant p
{
  margin: 0 0 0.6em 0;
}

guide-msg-assistant p:last-child
{
  margin-bottom: 0;
}

guide-msg-assistant code
{
  background-color: hsla( 0, 0%, 100%, 0.1 );
  padding: 0.1em 0.4em;
  border-radius: 0.3em;
}

guide-tool-activity
{
  display: block;
  align-self: flex-start;
  max-width: 82%;
  padding: 0.6em 1em;
  border-radius: 0.8em;
  background: hsla( 0, 0%, 100%, 0.05 );
  color: hsl( 219.1, 24%, 64.9% );
  font-size: 0.85em;
  font-family: monospace;
}

guide-tool-activity.pending
{
  opacity: 0.7;
}

guide-tool-call-line,
guide-tool-result-line
{
  display: block;
}

guide-tool-result-line
{
  margin-top: 0.3em;
  color: hsl( 140, 40%, 65% );
}

guide-chat-composer
{
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 2vw;
  padding: 3vw;
  overflow-y: auto;
  border-top: 1px solid hsla( 0, 0%, 100%, 0.08 );
  transition: opacity 150ms ease;
}

guide-chat-composer.guide-composer-busy
{
  opacity: 0.5;
  pointer-events: none;
}

guide-question-button
{
  display: inline-block;
  cursor: pointer;
  padding: 0.6em 1em;
  border-radius: 999px;
  font-size: 3vw;
  line-height: 1.3;
  color: hsl( 0, 0%, 100% );
  background: color-mix( in srgb, var( --rojo-color, #666 ) 25%, hsl( 226, 21%, 16% ) );
  border: 1px solid color-mix( in srgb, var( --rojo-color, #666 ) 45%, transparent );
  transition: background 150ms ease;
}

guide-question-button:hover
{
  background: color-mix( in srgb, var( --rojo-color, #666 ) 38%, hsl( 226, 21%, 16% ) );
}

guide-question-button.guide-question-answered
{
  cursor: default;
  color: hsl( 219.1, 24%, 64.9% );
  background: hsl( 226, 21%, 14% );
  border-color: hsla( 0, 0%, 100%, 0.08 );
}

@media ( orientation: landscape )
{
  guide-overlay
  {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  guide-selection
  {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 24px;
    overflow-y: auto;
  }

  guide-selection-title
  {
    font-size: 20px;
  }

  guide-selection-subtitle
  {
    font-size: 20px;
    margin-bottom: 64px;
  }

  guide-rojo-grid
  {
    grid-template-columns: repeat( 2, 1fr );
    gap: 6px;
    max-width: 1100px;
  }
	
  guide-msg-user
  {
    font-style: italic;    
  }
  
  guide-msg-assistant
  {
    line-height: 1.5;
  }
  
  guide-rojo-card
  {
    gap: 16px;
    padding: 60px;
    margin: 6px;
  	border-radius: 10px;
  }

  guide-rojo-avatar
  {
    width: 4vw;
    height: 4vw;
  }

  guide-rojo-name
  {
    font-size: 20px;
  }

  guide-rojo-topic
  {
    font-size: 16px;
  }

  guide-close-button
  {
    top: 1.5vw;
    right: 1.5vw;
    width: 2.5vw;
    height: 2.5vw;
    font-size: 16px;
    line-height: 2.5vw;
  }

  /* The chat window keeps the real panel's proportions (785:976) instead of stretching edge to
     edge - it sits centered over the same full-bleed opaque overlay, with its own background/
     shadow (see the base guide-chat rule + this block) so it reads as a distinct floating panel
     instead of blending into the surrounding unicolored background. */
  guide-chat
  {
    width: auto;
    height: min( 90vh, 976px );
    aspect-ratio: 785 / 976;
    max-width: 92vw;
    min-height: 0;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px hsla( 0, 0%, 0%, 0.45 );
  	border: 5px solid color-mix(in srgb, var(--rojo-color), hsl(0, 0%, 0%) 50% );
  }

  guide-chat-toolbar
  {
    gap: 6px;
    padding: 12px;
  }

  guide-chat-avatar
  {
    width: 2.6vw;
    height: 2.6vw;
  }

  guide-chat-name
  {
    font-size: 20px;
  }

  guide-chat-id
  {
    font-size: 12px;
  }

  guide-new-chat-button img
  {
    width: 1.4vw;
    height: 1.4vw;
  }

  guide-new-chat-button panel-label
  {
    font-size: 12px;
  }

  guide-chat-history
  {
    font-size: 18px;
    gap: 6px;
    padding: 12px;
  }

  guide-tool-activity
  {
    font-size: 13px;
  }

  guide-chat-composer
  {
    gap: 6px;
    padding: 12px;
  }

  guide-question-button
  {
    font-size: 16px;
    font-style: italic;
    border-radius: 13px;
  }
}
