/* =========================================
   HOOKLINE — style.css
   Copy Builder Tool
   Design system: white cards, #061d33 text,
   #ff9901 accent — DM Sans + IBM Plex Mono
   ========================================= */

:root {
  --primary:        #ff9901;
  --primary-hover:  #e68a00;
  --primary-light:  #fff7e6;
  --dark:           #061d33;
  --mid:            #4a5568;
  --muted:          #9ca3af;
  --border:         #e2e8f0;
  --bg:             #f7f8fa;
  --white:          #ffffff;
  --radius:         10px;
  --radius-sm:      6px;
  --shadow:         0 4px 10px rgba(0,0,0,0.08);
  --shadow-md:      0 8px 24px rgba(0,0,0,0.12);
  --font-body:      'DM Sans', sans-serif;
  --font-mono:      'IBM Plex Mono', monospace;
}

.hookline-app { width: 100%; margin-bottom: 40px; }

.hookline-app .app-container.hookline-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: visible;
}

/* ---- STEP INDICATORS ---- */
.hl-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 6px 0 4px;
}

.hl-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  cursor: default;
}

.hl-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.hl-step-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s;
}

.hl-step.active .hl-step-num {
  background: var(--primary);
  color: var(--white);
}

.hl-step.active .hl-step-label { color: white; }

.hl-step.done .hl-step-num {
  background: #10b981;
  color: var(--white);
}

.hl-step.done .hl-step-label { color: var(--mid); }

.hl-step-line {
  width: 32px;
  height: 2px;
  background: var(--border);
  flex-shrink: 0;
}

/* ---- PANELS ---- */
.hl-panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hl-panel-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.hl-panel-icon { font-size: 16px; }

.hl-panel-header h2 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}

.hl-panel-hint {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

/* ---- HOOK EMPTY ---- */
.hl-hook-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  text-align: center;
}

.hl-hook-empty p {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
}

.hl-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.15s;
}

.hl-action-btn:hover { background: var(--primary-hover); }

.hl-hook-actions { display: flex; gap: 8px; }

.hl-add-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--mid);
  background: transparent;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 10px;
}

.hl-add-more-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* ---- HOOK CHAIN ---- */
.hl-chain { display: flex; flex-direction: column; gap: 8px; }

.hl-chain-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
}

.hl-hook-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: hl-slideIn 0.2s ease;
}

@keyframes hl-slideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hl-hook-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hl-hook-item-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hl-hook-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: all 0.12s;
}

.hl-hook-remove:hover { color: #ef4444; background: #fef2f2; }

.hl-hook-preview {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dark);
  line-height: 1.5;
}

.hl-hook-preview .hl-filled {
  color: var(--primary);
  font-weight: 700;
  border-bottom: 2px solid var(--primary);
}

.hl-hook-preview .hl-unfilled {
  background: var(--primary-light);
  border: 1px dashed var(--primary);
  border-radius: 3px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--primary);
}

/* ---- SHARED FIELD STYLES ---- */
.hl-blank-fields { display: flex; flex-direction: column; gap: 8px; }

.hl-blank-field { display: flex; flex-direction: column; gap: 4px; }

.hl-blank-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--mid);
}

.hl-blank-select {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dark);
  background: var(--white);
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-sm);
  padding: 8px 30px 8px 11px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2212%22 height=%2212%22 viewBox=%220 0 12 12%22%3E%3Cpath fill=%22%239ca3af%22 d=%22M2 4l4 4 4-4z%22/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hl-blank-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,153,1,0.15);
}

.hl-blank-custom {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dark);
  background: var(--white);
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hl-blank-custom:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,153,1,0.15);
}

.hl-blank-custom::placeholder { color: var(--muted); }

/* Textarea variant for body sections */
.hl-blank-textarea {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dark);
  background: var(--white);
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  outline: none;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hl-blank-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,153,1,0.15);
}

.hl-blank-textarea::placeholder { color: var(--muted); }

/* ---- FRAMEWORK SELECTOR ---- */
.hl-fw-selector {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hl-fw-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hl-fw-select {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dark);
  background: var(--white);
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-sm);
  padding: 9px 30px 9px 11px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2212%22 height=%2212%22 viewBox=%220 0 12 12%22%3E%3Cpath fill=%22%239ca3af%22 d=%22M2 4l4 4 4-4z%22/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hl-fw-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,153,1,0.15);
}

.hl-fw-desc {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  font-style: italic;
}

/* Framework body sections */
.hl-fw-sections { display: flex; flex-direction: column; gap: 10px; }

.hl-fw-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hl-fw-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hl-fw-section-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hl-fw-section-name {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
}

.hl-fw-section-hint {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

/* ---- CTA BUILDER ---- */
.hl-cta-builder {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---- MODAL ---- */
.hl-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 29, 51, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.hl-modal-overlay.open { opacity: 1; pointer-events: all; }

.hl-modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(12px);
  transition: transform 0.2s;
  overflow: hidden;
}

.hl-modal-overlay.open .hl-modal { transform: translateY(0); }

.hl-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.hl-modal-title {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}

.hl-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.hl-modal-close:hover { color: var(--dark); }

.hl-modal-cats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 14px 22px 0;
  flex-shrink: 0;
}

.hl-cat {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--mid);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hl-cat:hover { border-color: var(--primary); color: var(--dark); }
.hl-cat.active { background: var(--primary); color: var(--white); border-color: var(--primary); }
.hl-cat-emoji { font-size: 12px; }

.hl-modal-cat-desc {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  padding: 0 0 6px;
}

.hl-modal-body {
  padding: 14px 22px 18px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hl-template-grid { display: flex; flex-direction: column; gap: 5px; }

.hl-tpl {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  transition: all 0.12s;
  text-align: left;
  width: 100%;
}

.hl-tpl:hover { border-color: var(--primary); background: var(--primary-light); }

.hl-tpl-text {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--dark);
  line-height: 1.4;
  flex: 1;
}

.hl-tpl-blank {
  background: var(--bg);
  border: 1px dashed var(--muted);
  border-radius: 3px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--primary);
}

.hl-tpl-add {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all 0.12s;
}

.hl-tpl:hover .hl-tpl-add { background: var(--primary); border-color: var(--primary); color: var(--white); }

/* ---- OUTPUT ---- */
.hl-output-text {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  color: var(--dark);
  line-height: 1.7;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 80px;
  white-space: pre-wrap;
}

.hl-output-actions { display: flex; gap: 8px; }

.hl-copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  cursor: pointer;
  transition: background 0.15s;
}

.hl-copy-btn:hover { background: var(--primary-hover); }

.hl-clear-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: var(--mid);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.hl-clear-btn:hover { border-color: var(--dark); color: var(--dark); }

/* ---- TOAST ---- */
.of-toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--dark); color: var(--white);
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  padding: 10px 20px; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  opacity: 0; transition: opacity 0.2s, transform 0.2s;
  pointer-events: none; z-index: 4000; white-space: nowrap;
}

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

/* ---- RESPONSIVE ---- */
@media (max-width: 560px) {
  .hl-steps { gap: 0; }
  .hl-step { padding: 6px 8px; }
  .hl-step-line { width: 16px; }
  .hl-modal-cats { gap: 4px; }
  .hl-cat { font-size: 10px; padding: 5px 9px; }
  .hl-output-text { font-size: 14px; }
  .hl-panel-hint { display: none; }
}