/*
Theme Name: BizCanvas Signature Generator 7
Theme URI: https://thebizcanvas.com
Author: The Biz Canvas
Description: Email Signature Generator for The Biz Canvas
Version: 1.0.3
*/

/* ===== The Biz Canvas — Email Signature Generator (UI styles only) ===== */
:root {
  --navy: #1B2B6B;
  --mint: #00C896;
  --white: #FFFFFF;
  --bg: #F7F8FA;
  --border: #E2E8F0;
  --text: #475569;
  --ink: #1e293b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: 'Inter', 'IBM Plex Sans Thai', Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* Branded, minimal background — on <html> so it covers the header area too (G1) */
html {
  background-color: #F0F4F8;
  background-image:
    radial-gradient(circle at 95% 5%, rgba(0, 200, 150, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 5% 95%, rgba(27, 43, 107, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 88% 55%, rgba(0, 200, 150, 0.08) 0%, transparent 30%),
    radial-gradient(circle at 12% 40%, rgba(27, 43, 107, 0.07) 0%, transparent 30%);
  background-attachment: fixed;
  min-height: 100%;
}
body {
  background: transparent; /* let the html gradient show through */
  min-height: 100vh;
}

/* Subtle dot-grid texture for depth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(27,43,107,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

/* Keep content above the texture */
.page-header, .app-body { position: relative; z-index: 1; }

/* ---------- Page background per brand ---------- */
html[data-brand] {
  background-image: none;
  background-attachment: scroll;
}
html[data-brand="biz"], html[data-brand="biz"] body { background-color: #1E3A6E; }
html[data-brand="art"], html[data-brand="art"] body { background-color: #d65037; }
html[data-brand] body::before { display: none; }

/* ---------- Page header (branded band) ---------- */
.page-header {
  padding: 100px 0 36px;
  background: transparent;
  border-bottom: none;
  overflow: visible;
  position: relative;
  z-index: 20; /* keep the open dropdown above the preview/app-body */
}
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 48px;
  position: relative;
}
.brand-title {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: clamp(40px, 9vw, 120px);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -2px;
  color: #FBFBFB;
}
.brand-divider {
  height: 5px;
  width: 40%;
  margin: 20px 0 16px;
  border-radius: 4px;
}
html[data-brand="biz"] .brand-divider { background: #00D68F; }
html[data-brand="art"] .brand-divider { background: #54595f; }
.brand-subtitle {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 700;
}
html[data-brand="biz"] .brand-subtitle { color: #FBFBFB; }
html[data-brand="art"] .brand-subtitle { color: #F7F4EF; }

/* ---------- Brand switch dropdown ---------- */
.brand-switch {
  position: absolute;
  /* bottom-align the pill with the title's baseline (title height − pill height ≈ 82px) */
  top: max(0px, calc(min(9vw, 120px) - 100px));
  right: 48px;
  z-index: 30;
}
.brand-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  background-color: #FFFFFF;
  padding: 16px 30px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  box-shadow: 0px 0px 10px 0px rgba(255, 255, 255, 0.5);
  position: relative;
  z-index: 2;
  transition: border-radius 0.15s ease;
}
/* When open, square off the bottom so the pill + menu read as one white surface */
.brand-switch.is-open .brand-toggle {
  border-radius: 28px 28px 0 0;
  box-shadow: none;
}
.brand-toggle__logo {
  height: 50px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}
.brand-toggle__chev {
  color: #54595f;
  font-size: 22px;
  transition: transform 0.2s ease;
}
.brand-switch.is-open .brand-toggle__chev { transform: rotate(180deg); }
.brand-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border-radius: 0 0 28px 28px;
  padding: 4px 14px 16px;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.16);
  z-index: 1;
}
.brand-menu[hidden] { display: none; }
/* thin divider between pill and the option(s) */
.brand-menu::before {
  content: '';
  display: block;
  height: 1px;
  background: #eceff3;
  margin: 0 4px 8px;
}
.brand-menu__item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 18px;
  border: none;
  background: transparent;
  border-radius: 14px;
  cursor: pointer;
}
.brand-menu__item:hover { background: #f4f6f9; }
/* hide the currently-selected brand — only show the other option(s) */
.brand-menu__item.is-active { display: none; }
.brand-menu__item img {
  height: 46px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
}

/* Mobile header: smaller title, dropdown flows below the subtitle, smaller pill */
@media (max-width: 768px) {
  .page-header { padding: 40px 0 12px; }
  .header-inner { padding: 0 16px; }
  .brand-title { font-size: 42px; line-height: 1.05; letter-spacing: -1px; }
  .brand-divider { width: 60%; margin: 14px 0; }
  .brand-subtitle { font-size: 24px; }
  /* in-flow below the subtitle; reset the desktop absolute offsets */
  .brand-switch { position: relative; display: inline-block; margin-top: 22px; top: auto; right: auto; z-index: 40; }
  .brand-toggle { padding: 12px 16px; gap: 10px; }
  .brand-toggle__logo { height: 28px; max-width: 120px; }
  /* chevron points RIGHT — the menu expands sideways, not down (so it never covers the preview) */
  .brand-toggle__chev { font-size: 15px; transform: rotate(-90deg); }
  .brand-switch.is-open .brand-toggle__chev { transform: rotate(90deg); }
  .brand-switch.is-open .brand-toggle { border-radius: 100px 0 0 100px; box-shadow: none; }
  /* option pill sits to the RIGHT of the toggle, forming one horizontal pill */
  .brand-menu {
    top: 0; bottom: auto; left: 100%; right: auto;
    border-radius: 0 100px 100px 0;
    padding: 12px 18px 12px 6px;
    display: flex; align-items: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  }
  .brand-menu::before { display: none; }
  .brand-menu__item { padding: 0 10px; }
  .brand-menu__item img { height: 28px; max-width: 120px; }
}

/* ---------- Layout ---------- */
.app-body {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 48px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
  padding: 32px;
}

.section-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 12px;
}

/* ---------- Template selector ---------- */
.tpl { margin-bottom: 20px; }
.tpl__grid {
  display: grid;
  grid-template-columns: repeat(var(--tpl-cols, 2), 1fr);
  gap: 10px;
}
.tpl-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 6px 4px;
  background: var(--white);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.tpl-card:hover { border-color: #cbd5e1; transform: translateY(-1px); }
.tpl-card.is-active {
  border-color: var(--navy);
  background: rgba(27, 43, 107, 0.04);
}
.tpl-card__thumb {
  width: 100%;
  height: 52px;
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tpl-card__name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tpl-card.is-active .tpl-card__name { color: var(--navy); }

/* ---------- Tabs (hidden — no tabs in v1.0.2) ---------- */
.tabs { display: none; }
.tabpane { display: block; } /* all content always visible */

/* ---------- Form fields ---------- */
.tabpane { display: none; }
.tabpane.is-active { display: block; animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.field { margin-bottom: 14px; }
.field > label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}
.req { color: #ef4444; }
.opt { color: #94a3b8; font-weight: 400; font-size: 11px; }

input, textarea, select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'Inter', 'IBM Plex Sans Thai', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
  appearance: none;
  -webkit-appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
  resize: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.12);
  outline: none;
}
input.is-error, textarea.is-error, select.is-error { border-color: #ef4444; }

/* ---------- Social fields ---------- */
.social-input { display: flex; align-items: stretch; gap: 8px; }
.social-badge {
  flex: 0 0 38px;
  border-radius: 10px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* ---------- Upload ---------- */
.upload {
  position: relative;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg);
}
.upload:hover, .upload.is-drag { border-color: var(--mint); background: rgba(0,200,150,0.04); }
.upload__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  font-size: 12px;
}
.upload__inner i { font-size: 20px; color: #cbd5e1; }
.upload__preview {
  max-width: 100%;
  max-height: 90px;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}
.upload__clear {
  position: absolute;
  top: 8px; right: 8px;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 0;
  background: rgba(15,23,42,0.7);
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.upload__clear:hover { background: #ef4444; }
.upload__clear[hidden] { display: none; }

/* ---------- Preview panel ---------- */
.preview__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.preview__bar .section-label { margin: 0; }
.preview__actions { display: flex; gap: 10px; }

.btn {
  border-radius: 10px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
  border: 1.5px solid transparent;
}
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: #16245a; transform: translateY(-1px); }
.btn--outline { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn--outline:hover { background: rgba(27,43,107,0.05); }

/* ---------- The Art of Biz accent overrides ---------- */
html[data-brand="art"] .tpl-card.is-active { border-color: #d65037; background: rgba(214, 80, 55, 0.05); }
html[data-brand="art"] .tpl-card.is-active .tpl-card__name { color: #d65037; }
html[data-brand="art"] .btn--primary { background: #d65037; }
html[data-brand="art"] .btn--primary:hover { background: #b8412c; }
html[data-brand="art"] .btn--outline { color: #d65037; border-color: #d65037; }
html[data-brand="art"] .btn--outline:hover { background: rgba(214, 80, 55, 0.06); }

/* ---------- Mail mockup ---------- */
.mail {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.mail__chrome {
  background: #f1f5f9;
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot--r { background: #ff5f57; }
.dot--y { background: #febc2e; }
.dot--g { background: #28c840; }

.mail__head {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}
.mail__row { padding: 3px 0; }
.mail__lbl { color: #94a3b8; font-weight: 600; display: inline-block; min-width: 60px; }

.mail__body { padding: 22px; color: #334155; font-size: 14px; line-height: 1.7; }
.mail__body p { margin: 0 0 12px; }
.mail__sig { margin-top: 18px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--navy);
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(27,43,107,0.3);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 999;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.is-error { background: #ef4444; box-shadow: 0 12px 30px rgba(239,68,68,0.3); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .app-body { grid-template-columns: 1fr 1fr; gap: 16px; padding: 24px; }
}

/* Phone/tablet (<=768px): form & preview stack. Template selector stays 50:50. */
@media (max-width: 768px) {
  .app-body { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 16px; }
  .panel-card { min-width: 0; max-width: 100%; padding: 18px; }
  .preview-panel { order: -1; }
  .preview-header { flex-wrap: wrap; gap: 10px; }
  .device-switcher { display: none; }
  .preview-header-right { width: 100%; }
  .preview-header-right .btn { flex: 1; justify-content: center; }
  .mail__body { padding: 16px; }
  .tpl__grid { grid-template-columns: repeat(2, 1fr); } /* 4 templates wrap to 2x2 on phones */
}

/* ---------- Mobile: fit the fixed-width 560px email signature into the preview ----------
   The signature is a table-based EMAIL layout (email clients ignore responsive CSS, so it
   can't reflow). On phones we scale the PREVIEW down with `zoom`. Display-only: the
   "Copy for Email" / "Copy HTML" output is still full-size 560px. No effect on desktop. */
@media (max-width: 768px) {
  .mail__sig { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media (max-width: 700px) { .mail__sig { zoom: 0.80; } }
@media (max-width: 560px) { .mail__sig { zoom: 0.60; } }
@media (max-width: 440px) { .mail__sig { zoom: 0.48; } }
@media (max-width: 375px) { .mail__sig { zoom: 0.38; } }
@media (max-width: 340px) { .mail__sig { zoom: 0.32; } }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             