/* ── Email Signature Builder Styles ── */

:root {
  --sidebar-w: 380px;
  --header-h: 64px;
}

.builder-app {
  background: white;
  min-height: auto;
  display: flex;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.tool-hero {
  background: linear-gradient(160deg, #f0fdf4 0%, #ffffff 100%);
  padding: 120px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 24px;
}

.tool-badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.tool-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--gray-900);
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-gradient-orange {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tool-hero p.subtitle {
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--gray-600);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Features Strip */
.features-strip {
  background: var(--gray-900);
  padding: 40px 0;
}

.features-strip__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.feature-item__icon {
  width: 44px;
  height: 44px;
  background: rgba(34, 197, 94, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4ade80;
  flex-shrink: 0;
}

.feature-item h4 {
  font-size: 15px;
  font-weight: 700;
  color: white;
  margin-bottom: 2px;
}

.feature-item p {
  font-size: 13px;
  color: var(--gray-400);
}

/* Prose Section */
.prose-section {
  padding: 100px 0;
  background: #f8fafc;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 32px;
  text-align: center;
}

.prose-section p {
  font-size: 17px;
  line-height: 1.8;
  color: var(--gray-600);
  margin-bottom: 24px;
}

.how-to-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.how-to-card {
  background: white;
  padding: 32px;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.how-to-card h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.how-to-card p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 0;
}

/* FAQ Section */
.faq-section {
  padding: 100px 0;
  background: white;
}

.section-label {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 12px;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  max-width: 1000px;
  margin: 48px auto 0;
}

.faq-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 12px;
}

.faq-card p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-600);
}

.builder-container {
  display: flex;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

/* ── SIDEBAR ── */
.builder-sidebar {
  width: var(--sidebar-w);
  background: white;
  border-right: 1px solid var(--border);
  height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
  flex-shrink: 0;
}

.builder-sidebar__scroll {
  height: 100%;
  overflow-y: auto;
  padding: 32px 24px;
  scrollbar-width: thin;
}

.sidebar-section {
  margin-bottom: 32px;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-100);
}

/* Template Grid */
.template-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.template-grid::-webkit-scrollbar { width: 4px; }
.template-grid::-webkit-scrollbar-track { background: transparent; }
.template-grid::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.template-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1.5px solid #f1f5f9;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.template-btn span:last-child {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.template-btn:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.template-btn.active {
  border-color: var(--primary);
  background: #eff6ff;
  border-width: 2px;
}

.template-btn.active span:last-child {
  color: var(--primary);
}

.template-thumb {
  width: 100%;
  aspect-ratio: 1;
  background: var(--gray-100);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

/* 8 original template thumbnails */
.template-thumb.apex    { background: white; border: 1px solid #e2e8f0; border-left: 4px solid #1a56db; }
.template-thumb.prism   { background: linear-gradient(160deg, #0f172a 50%, #1a56db 100%); }
.template-thumb.slate   { background: #f8fafc; border: 1px solid #e2e8f0; }
.template-thumb.nova    { background: linear-gradient(90deg, #1a56db, #60a5fa); border-radius: 20px 6px 6px 6px; }
.template-thumb.edge    { background: white; border: 1px solid #e2e8f0; border-right: 8px solid #1a56db; }
.template-thumb.pulse   { background: linear-gradient(180deg, #1a56db 45%, white 45%); }
.template-thumb.thread  { background: white; border: 1px solid #e2e8f0; border-top: 3px solid #1a56db; }
.template-thumb.luxe    { background: #0f172a; }

/* 14 new template thumbnails */
.template-thumb.verona  { background: white; border: 1px solid #e2e8f0; border-top: 3px solid #1a56db; }
.template-thumb.monaco  { background: linear-gradient(90deg, #1a56db 28%, #f8fafc 28%); border: 1px solid #e2e8f0; }
.template-thumb.vienna  { background: white; border: 1px solid #e2e8f0; border-bottom: 2px solid #1a56db; }
.template-thumb.geneva  { background: white; border: 1px solid #e2e8f0; border-bottom: 1px solid #1a56db; }
.template-thumb.oslo    { background: linear-gradient(90deg, #0f172a 38%, #f8fafc 38%); border: 1px solid #e2e8f0; }
.template-thumb.milan   { background: white; border: 1px solid #e2e8f0; border-bottom: 5px solid #1a56db; }
.template-thumb.berlin  { background: #0f172a; border-left: 4px solid #1a56db; }
.template-thumb.paris   { background: linear-gradient(180deg, #f8fafc 40%, white 40%); border: 1px solid #e2e8f0; border-radius: 50% 50% 6px 6px; }
.template-thumb.zurich  { background: #1a56db; }
.template-thumb.tokyo   { background: white; border: 1px solid #e2e8f0; border-left: 3px solid #1a56db; border-right: 3px solid #1a56db; }
.template-thumb.sydney  { background: linear-gradient(180deg, #f1f5f9 55%, white 55%); border: 1px solid #e2e8f0; }
.template-thumb.dubai   { background: #111827; border-top: 2px solid #b8972e; }
.template-thumb.boston  { background: white; border: 1px solid #e2e8f0; border-left: 3px solid #1a56db; }
.template-thumb.chicago { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; }

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.select-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: white;
  color: var(--gray-700);
  outline: none;
  cursor: pointer;
}

.select-input:focus {
  border-color: var(--primary);
}

/* Inputs */
.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.input-group input, .input-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  transition: all 0.2s;
  outline: none;
}

.input-group textarea {
  height: 100px;
  resize: vertical;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-700);
}

.checkbox-wrap input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.color-picker-wrap input[type="color"] {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
}

#color-hex {
  font-family: monospace;
  font-size: 14px;
  color: var(--gray-500);
}

/* Social Inputs */
.social-input-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.social-field {
  display: flex;
  align-items: center;
  background: var(--gray-50);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s;
}

.social-field:focus-within {
  border-color: var(--primary);
  background: white;
}

.social-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  background: var(--gray-100);
  color: var(--gray-500);
  border-right: 1.5px solid var(--border);
}

.social-field input {
  flex: 1;
  border: none;
  background: none;
  padding: 0 12px;
  font-size: 13px;
  height: 36px;
  outline: none;
}

/* ── PREVIEW SECTION ── */
.builder-preview {
  flex: 1;
  padding: 64px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preview-header {
  text-align: center;
  margin-bottom: 40px;
}

.preview-badge {
  display: inline-block;
  background: #f1f5f9;
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}

.preview-hint {
  font-size: 14px;
  color: var(--text-muted);
}

.preview-card {
  width: 100%;
  max-width: 700px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.08);
  padding: 60px 40px;
  margin-bottom: 48px;
  position: relative;
}

/* Desktop screen effect */
.preview-card::before {
  content: '';
  position: absolute;
  top: 15px; left: 50%;
  transform: translateX(-50%);
  width: 60px; height: 6px;
  background: var(--gray-100);
  border-radius: 3px;
}

.preview-window {
  width: 100%;
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  padding: 24px;
  background: white;
  overflow-x: auto;
}

.preview-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  max-width: 700px;
  justify-content: center;
}

.preview-footer .btn {
  flex: 1;
  min-width: 100px;
}

.preview-footer .btn--lg {
  flex: 2;
  min-width: 200px;
}

/* ── MODAL ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.open { display: flex; }

.modal-content {
  background: white;
  width: 100%;
  max-width: 600px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 18px; font-weight: 700; color: var(--gray-900); }

.btn-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--gray-400);
  cursor: pointer;
}

.modal-body { padding: 24px; }

#html-source {
  width: 100%;
  height: 200px;
  background: var(--gray-50);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  font-family: monospace;
  font-size: 12px;
  margin-bottom: 16px;
  resize: none;
}

.modal-hint { font-size: 13px; color: var(--text-muted); }

.modal-footer {
  padding: 20px 24px;
  background: var(--gray-50);
  display: flex;
  justify-content: flex-end;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--gray-900);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 14px;
  z-index: 2000;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* --- Mobile Bottom Navigation Base --- */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: white;
  display: none;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  z-index: 1000;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
}

.mobile-nav-btn.active {
  color: var(--primary);
}

/* ── RESPONSIVE ── */
@media (max-width: 992px) {
  .builder-sidebar { width: 100% !important; height: auto !important; position: static !important; border-right: none !important; }
  .builder-preview { width: 100% !important; padding: 48px 16px 120px !important; display: none; }
  .builder-app { padding-bottom: 64px; flex-direction: column; }
  
  .mobile-bottom-nav { display: grid; }
  .builder-sidebar.hidden-mobile { display: none !important; }
  .builder-preview.visible-mobile { display: flex !important; }
  
  .features-strip__grid { grid-template-columns: repeat(2, 1fr); }
  .how-to-grid { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .preview-footer { flex-direction: column; width: 100%; }
  .preview-footer .btn { width: 100%; }
  .builder-sidebar__scroll { height: auto; overflow: visible; padding: 24px 16px; }
  .preview-card { padding: 30px 12px; margin-bottom: 32px; border-radius: 12px; }
  .preview-window { padding: 12px; border-radius: 6px; }
  
  .template-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

@media (max-width: 480px) {
  .features-strip__grid { grid-template-columns: 1fr; }
  .tool-hero h1 { font-size: 1.8rem; }
  .template-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}
