/**
 * IdeaBoard Template Picker Styles
 */
body.template-picker-open {
  overflow: hidden;
}

.template-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(10px) saturate(1.02);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.template-picker-overlay.visible { opacity: 1; }

.template-picker {
  width: min(980px, calc(100% - 32px));
  max-height: min(760px, calc(100vh - 32px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.97);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 30px;
  box-shadow: 0 22px 58px rgba(15,23,42,0.12), 0 8px 20px rgba(15,23,42,0.06);
  transform: translateY(8px) scale(0.985);
  transition: transform 0.22s ease;
}
.template-picker-overlay.visible .template-picker { transform: translateY(0) scale(1); }

.template-picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid rgba(15,23,42,0.06);
}

.template-eyebrow {
  margin: 0 0 8px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #7a8598;
  font-weight: 600;
}

.template-picker-header h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.02;
  letter-spacing: -0.05em;
  color: #0f172a;
}

.template-picker-close {
  -webkit-appearance: none;
  appearance: none;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,0.08);
  background: #f7f8fb;
  color: #58667a;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.template-picker-grid {
  padding: 22px 24px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  overflow: auto;
}

.template-card {
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
  border: 1px solid rgba(15,23,42,0.07);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  border-radius: 22px;
  padding: 16px;
  cursor: pointer;
  display: grid;
  gap: 12px;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.template-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15,23,42,0.08);
  border-color: rgba(15,23,42,0.12);
}

.template-card.blank-board {
  border-style: dashed;
}

.template-thumbnail {
  height: 120px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%);
  border: 1px solid rgba(15,23,42,0.06);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.template-thumbnail.blank {
  background: linear-gradient(180deg, #fbfcfe 0%, #f5f7fb 100%);
}

.template-preview {
  display: grid;
  place-items: center;
}

.template-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.template-card-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef3f8;
  border: 1px solid rgba(15,23,42,0.05);
  color: #5c697a;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.template-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #627084;
}

@media (max-width: 680px) {
  .template-picker {
    width: min(100% - 18px, 540px);
    max-height: calc(100vh - 18px);
    border-radius: 24px;
  }
  .template-picker-header {
    padding: 20px 20px 16px;
  }
  .template-picker-header h2 { font-size: 24px; }
  .template-picker-grid {
    padding: 16px;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  .template-card { padding: 14px; border-radius: 18px; }
  .template-thumbnail { height: 104px; }
  .template-card h3 { font-size: 15px; }
  .template-card p { font-size: 12px; }
}
