/* always available utility */
.hidden { display: none !important; }

/* base overlay — no dim background */
.font-picker-overlay {
  position: fixed;
  inset: 0;
  background: transparent;  /* removed dark dim */
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

/* modal card */
.font-picker-modal {
  background: #fff;
  width: min(720px, 95vw);
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #2b2b2b;
  line-height: 1.4;
  font-size: 14px;
}

/* header */
.font-picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #ddd;
  background: #fafafa;
}

.font-picker-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
}

.font-picker-sub {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.15rem;
}

.font-picker-close-btn {
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 500;
  color: #555;
  cursor: pointer;
}
.font-picker-close-btn:hover {
  color: #000;
}

/* preview panel */
.font-preview-panel {
  border-bottom: 1px solid #eee;
  padding: 0.75rem 1rem;
  background: #fff;
}

.font-preview-toprow {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 0.4rem;
}

.font-preview-meta {
  font-size: 0.9rem;
  font-weight: 500;
  color: #222;
}
.font-preview-meta strong {
  font-weight: 600;
}

.font-preview-hint {
  color: #888;
  font-size: 0.75rem;
  align-self: flex-end;
}

.font-preview-box {
  min-height: 64px;
  padding: 0.75rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 2rem;
  line-height: 1.35;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
}

/* filters */
.font-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 140px;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #444;
}

.filter-select {
  padding: 0.4rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.8rem;
  background: #fff;
  cursor: pointer;
}

.filter-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #444;
}

.font-search-input {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 0.85rem;
  box-sizing: border-box;
}

/* scroll area for the font list */
.font-list-section {
  flex: 1 1 auto;
  min-height: 0; /* lets flexbox shrink this area */
  background: #fff;
  display: flex;
  flex-direction: column;
}

.list-wrapper {
  flex: 1 1 auto;
  min-height: 200px;
  max-height: 240px;
  overflow-y: auto;
  border-top: 1px solid #f5f5f5;
  border-bottom: 1px solid #eee;
}

.font-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* each font row */
.font-option {
  border-bottom: 1px solid #f0f0f0;
  padding: 0 1rem;
  cursor: pointer;
  background: #fff;
}
.font-option.active {
  background: #fdf8e8;
  box-shadow: inset 0 0 0 2px #f4d062;
}

.font-row-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.font-option__name {
  font-size: 2rem;
  font-weight: 400;
  color: #222;
}

.font-option__bold-sample {
  font-size: 0.9rem;
  font-weight: 700;
  color: #222;
}

.font-option__meta {
  width: 100%;
  font-size: 0.7rem;
  color: #777;
}

/* weight chooser */
.weight-chooser {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #444;
}

.weight-chooser-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.weight-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: #666;
}

.weight-btn {
  border: 1px solid #bbb;
  background: #fff;
  border-radius: 4px;
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}
.weight-btn:hover {
  background: #f5f5f5;
}
.weight-btn.is-current {
  border-color: #000;
  background: #000;
  color: #fff;
}

/* footer */
.font-picker-footer {
  flex-shrink: 0;
  padding: 0.5rem 1rem 0.75rem;
  font-size: 0.7rem;
  color: #666;
  background: #fafafa;
  border-top: 1px solid #ddd;
}

/* little trigger button in the toolbar */
.text-add-trigger {
  border: 1px solid #bbb;
  background: #fff;
  border-radius: 4px;
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}
.text-add-trigger:hover {
  background: #f5f5f5;
}

.text-tools-row {
  display: flex;
  flex-wrap: wrap;
  row-gap: 3px;
  column-gap: 6px;
}

.text-tools-row > button {
  flex: 1 1 calc(50% - 3px);
  box-sizing: border-box;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .text-tools-row > button {
    flex: 1 1 100%;
  }
}

/* new "Select Font" button */
.font-select-btn {
  border: 1px solid #333;
  background: #fff;
  color: #333;
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
  margin-left: auto;
  align-self: center;
}
.font-select-btn:hover {
  background: #333;
  color: #fff;
}

/* Mood / Theme: upgraded chip-style group list */
.group-list-wrapper {
  padding: 0.4rem 0.5rem 0.35rem;
  margin: 0;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #eee;
  max-height: none;       /* let it breathe */
  overflow: visible;      /* no scroll box; chips wrap instead */
}

.group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.group-list-item {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1.1;
  color: #333;
  background: #ffffff;
  border-radius: 999px;
  border: 1px solid #e3e3e3;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: all 0.16s ease;
  white-space: nowrap;
}

.group-list-item:hover,
.group-list-item:focus {
  background: #f5f5f5;
  border-color: #d0d0d0;
  outline: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.group-list-item.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  font-weight: 600;
}

/* Optional: subtle visual hints for special moods */
.group-list-item[data-group-name="Halloween"]::after {
  content: " 🎃";
}
.group-list-item[data-group-name="Christmas"]::after {
  content: " 🎄";
}
.group-list-item[data-group-name="Valentines"]::after,
.group-list-item[data-group-name="Valentine's"]::after {
  content: " ❤️";
}
