/* styles.css — flyout with variant previews (16px text + smoothing) */

html, body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: Arial, sans-serif;
  background: #f9f9fb;
  color: #333;
  margin: 0;
  padding: 40px;
}

h2 { margin-bottom: 15px; }

.dropdown { position: relative; }

/* Button */
.dropdown-btn {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* List */
.dropdown-list {
  position: relative;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  max-height: 360px;
  overflow-y: auto;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  display: none;
  z-index: 1000;
}

/* Row */
.dropdown-list .item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  cursor: pointer;
  position: relative;
}

.dropdown-list .item:hover { background: #f0f0f5; }

/* Font family name */
.dropdown-list .item .family {
  font-size: 16px;
  line-height: 1.3;
}

/* Count */
.dropdown-list .item .count {
  font-family: Arial, sans-serif;
  font-size: 12px;
  color: #666;
  margin-left: 4px;
}

/* Arrow */
.dropdown-list .item .arrow {
  margin-left: auto;
  color: #999;
  font-size: 13px;
}

/* Flyout */
.font-flyout {
  position: fixed;
  left: 0; top: 0;
  min-width: 280px;
  max-width: 420px;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  z-index: 5000;
  display: none;
}

/* Variant row with preview */
.flyout-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  white-space: nowrap;
  cursor: pointer;
}
.flyout-item:hover { background: #f3f3f8; }

.v-label {
  font-size: 16px;
  color: #666;
  min-width: 90px;
}

.v-preview {
  font-size: 16px;
  line-height: 1.3;
}

/* Search header & clear */
.dropdown-list > div:first-child { position: relative; padding: 0; }
.dropdown-list input[type="text"] {
  width: 100%;
  padding: 8px 30px 8px 12px;
  box-sizing: border-box;
  margin-bottom: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
}
.dropdown-list > div:first-child > span {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  color: #999;
  user-select: none;
}

/* Recent header */
.dropdown-list > div + div {
  font-weight: bold;
  font-size: 13px;
  color: #666;
  padding: 8px 14px;
}

/* Remove recents button */
.remove-btn {
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid #e0e0e6;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  color: #999;
}
.remove-btn:hover { background: #f2f2f7; }

/* Preview + controls */
#preview {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  font-size: 22px;
  text-align: center;
}
#preview[contenteditable="true"] { outline: none; cursor: text; }

.controls {
  margin-top: 15px;
  display: flex;
  gap: 15px;
}
.controls label { font-size: 14px; color: #555; }

select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
}
