/* Copyright 2026 The Chromium Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

/* #css_wrapper_metadata_start
 * #type=style-lit
 * #scheme=relative
 * #css_wrapper_metadata_end */

#container {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: flex-end;
  width: 800px;
  min-height: 240px; /* Prevent height from collapsing when persona is disabled so captions still show */
  position: relative;
}

#mock-buttons-column {
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 4px;
}

#mock-buttons-column[hidden] {
  display: none;
}

#main-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  position: relative;
  z-index: 2;
}

video {
  /* The resources are 4:3 aspect ratio but include extra space on the sides.
   * Use a square and object-fit: cover to clip the empty space. */
  width: 240px;
  height: 240px;
  object-fit: cover;
}

video[hidden],
#initializerState[hidden] {
  display: none;
}

#initializerState {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid var(--color-ref-neutral80);
  box-sizing: border-box;
  transition: transform 200ms ease, background-color 200ms ease,
      border-color 200ms ease;
  background-color: var(--color-ref-neutral50);
}

#initializerState.uninitialized {
  background-color: var(--color-ref-neutral50);
  transform: scale(0.7);
}

#initializerState.connecting {
  background-color: var(--color-ref-primary90);
  transform: scale(0.80);
  animation: connecting-pulse 1.5s infinite ease-in-out;
}

#initializerState.error {
  background-color: var(--color-ref-error50);
}

@keyframes connecting-pulse {
  0% {
    transform: scale(0.80);
  }
  50% {
    transform: scale(0.90);
  }
  100% {
    transform: scale(0.80);
  }
}

#transcription-container {
  position: absolute;
  bottom: 24px;
  left: 16px;
  right: 16px;
  z-index: 1;
  pointer-events: none;
  background: rgba(20, 20, 20, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.15);
  padding: 16px 24px; /* Symmetrical padding by default */
  border-radius: 16px;
  font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  /* Stable width on wide screens, but scales fluidly to 100% on narrow screens */
  width: 640px;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  letter-spacing: -0.01em;

  /* Strictly fixed height for exactly 2 lines of text (54px) plus padding (16px * 2) = 86px */
  height: 86px;
}

#transcription-container.has-persona {
  padding-right: 120px; /* Reduced right padding to clear the avatar when enabled */
}

#transcription-container[hidden] {
  display: none;
}

.caption-bubble {
  width: 100%;
  height: 54px; /* Strictly 2 lines of text (27px * 2) */
  min-height: 54px;
  max-height: 54px;
  white-space: pre-line;
  box-sizing: border-box;
  overflow-y: auto;
  scrollbar-width: none; /* Hide scrollbar for clean premium look */
  transition: color 200ms ease;
}

.caption-bubble::-webkit-scrollbar {
  display: none; /* Hide scrollbar in WebKit */
}

.caption-bubble.input {
  text-align: left;
  color: #90caf9; /* Beautiful, distinct light blue text */
}

.caption-bubble.output {
  text-align: right;
  color: #ffe082; /* Beautiful, distinct light amber text */
}

.caption-bubble[hidden] {
  display: none;
}

.inject-audio {
  cursor: pointer;
  flex-shrink: 0;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: sans-serif;
  font-size: 13px;
  border: none;
}

.inject-audio:hover {
  background-color: rgba(0, 0, 0, 0.9);
}

.inject-audio.sequence {
  background-color: rgba(0, 50, 100, 0.7);
}

.inject-audio.sequence:hover {
  background-color: rgba(0, 70, 140, 0.9);
}

#text-input {
  flex-shrink: 0;
  max-width: 240px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: sans-serif;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-sizing: border-box;
}

#text-input:focus {
  outline: none;
  border-color: white;
  background-color: rgba(0, 0, 0, 0.9);
}

#text-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}
