/* 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
 * #import=//resources/cr_elements/cr_shared_vars.css.js
 * #css_wrapper_metadata_end */

:host {
  display: flex;
  flex-direction: column;
  height: 100%;
}

h1 {
  font-family: 'Google Sans', sans-serif;
  font-weight: 600;
  font-size: 28px;
  color: var(--cr-primary-text-color);
  margin: 0;
}

h2 {
  font-family: 'Google Sans', sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 24px;
  color: var(--cr-primary-text-color);
  margin-top: 24px;
  margin-bottom: 16px;
}

cr-tabs {
  --cr-tabs-flex: none;
  --cr-tabs-font-size: 14px;
  --cr-tabs-height: 38px;
  --cr-tabs-icon-margin-end: 12px;
  --cr-tabs-icon-size: 24px;
  --cr-tabs-selection-bar-radius: 3px;
  --cr-tabs-selection-bar-width: 3px;
  --cr-tabs-tab-inline-padding: 0;
  border-bottom: 1px solid var(--cr-separator-color);
  gap: 32px;
  margin-bottom: 24px;
  margin-top: 32px;
}

/* Card Grid */
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.card {
  background: var(--cr-card-background-color);
  border: 1px solid var(--cr-separator-color);
  border-radius: var(--cr-card-border-radius);
  box-shadow: var(--cr-card-shadow);
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 200px;
  overflow: hidden;
  position: relative;
  text-decoration: none; /* remove link underline */
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  width: 243px;
}

.card:hover {
  box-shadow: var(--cr-elevation-4);
  transform: translateY(-2px);
}

/* Card Body (Top part) */
.card-body {
  background: var(--cr-card-background-color);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 133px;
  justify-content: center;
  overflow: hidden;
  padding-block: 16px;
  padding-inline: 16px;
}

.card-body.tab-type {
  align-items: center;
  background: var(--cr-fallback-color-surface5);
  justify-content: center;
}

.card-body.tab-type cr-icon {
  --cr-icon-size: 36px;
  color: var(--cr-link-color);
}

.text-preview {
  color: var(--cr-primary-text-color);
  font-family: 'Google Sans Text', sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  margin: 0;
  margin-inline-end: 16px;
  max-height: 54px; /* up to 3 lines */
  overflow: hidden;
}

.card-footer {
  align-items: center;
  background: var(--cr-card-background-color);
  border-top: var(--cr-separator-line);
  box-sizing: border-box;
  display: flex;
  gap: 10px;
  height: 67px;
  padding-block: 8px;
  padding-inline: 16px;
}

.favicon {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border-radius: 2px;
  flex-shrink: 0;
  height: 16px;
  width: 16px;
}

.meta-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0; /* allows text truncation */
}

.card-title {
  color: var(--cr-primary-text-color);
  font-family: 'Google Sans Flex', sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-date {
  color: var(--cr-secondary-text-color);
  font-family: 'Google Sans Flex', sans-serif;
  font-size: 10px;
  font-weight: 500;
  line-height: 14px;
  margin-top: 2px;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  position: relative;
  height: 56px;
}

/* Selection State */
.card.selected {
  border-color: var(--cr-link-color);
  box-shadow: 0 0 0 1px var(--cr-link-color), var(--cr-elevation-1);
}

.card-checkbox {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  right: 10px;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.card:hover .card-checkbox,
.card.selected .card-checkbox {
  opacity: 1;
  pointer-events: auto;
}

.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--cr-fallback-color-surface1);
  border-radius: var(--cr-card-border-radius);
  margin-bottom: 24px;
  border: 1px solid var(--cr-fallback-color-surface5);
}

.action-buttons {
  display: flex;
  gap: 8px;
}

#search-field {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 680px;
  max-width: 100%;
  height: 36px;
  background: var(--cr-card-background-color);
  border-radius: 100px;
  border: 1px solid var(--cr-separator-color);
  box-sizing: border-box;
  padding: 4px 10px;

  --cr-search-field-input-border-bottom: none;
  --cr-search-field-input-min-height: auto;
  --cr-search-field-input-padding-top: 6px;
  --cr-search-field-input-padding-bottom: 6px;
  --cr-search-field-search-icon-display: none;
  --cr-search-field-search-icon-inline-display: block;
  --cr-search-field-search-icon-fill: var(--cr-secondary-text-color);
  --cr-search-field-clear-icon-fill: var(--cr-secondary-text-color);
  --cr-search-field-input-width: 100%;
  --cr-search-field-placeholder-color: var(--cr-secondary-text-color);
}

.gemini-panel {
  background: var(--cr-fallback-color-surface1);
  border-radius: var(--cr-card-border-radius);
  padding: 16px;
  margin-bottom: 24px;
  border: 1px solid var(--cr-link-color);
}

.gemini-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.gemini-panel-header h3 {
  font-family: 'Google Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  color: var(--cr-primary-text-color);
}

.quick-options {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.quick-options cr-button.chip {
  border-radius: 16px;
  font-size: 12px;
}

.gemini-response {
  margin-top: 16px;
  padding: 12px;
  background: var(--cr-card-background-color);
  border-radius: 8px;
  border: 1px solid var(--cr-separator-color);
}

.gemini-response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.gemini-response-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gemini-response-actions cr-icon-button {
  --cr-icon-button-margin-start: 0;
  --cr-icon-button-margin-end: 0;
}

.gemini-response p {
  white-space: pre-wrap;
  margin: 8px 0 0 0;
  font-family: 'Google Sans Text', sans-serif;
  font-size: 13px;
  color: var(--cr-primary-text-color);
}

