/* ==========================================================================
   Equalza — Meta Tag Generator CSS
   ========================================================================== */

:root{
  --bg:#f5f6f8;--surface:#fff;--border:#e2e5ea;--border2:#c8cdd6;
  --accent:#2563eb;--accent-h:#1d4ed8;--accent-light:#eff6ff;--accent-mid:#bfdbfe;
  --text:#111827;--text2:#4b5563;--text3:#9ca3af;
  --green:#059669;--green-bg:#ecfdf5;
  --red:#dc2626;--red-bg:#fef2f2;
  --yellow:#d97706;--yellow-bg:#fffbeb;
  --sh:0 1px 3px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.05);
  --r:8px;--rl:12px;--rxl:16px;
}

/* ---------- Tool Card ---------- */
.tool-card.mtg{background:var(--surface);border:1px solid var(--border);border-radius:var(--rxl);box-shadow:var(--sh);overflow:hidden}

/* ---------- Form ---------- */
.mtg-form{padding:24px 24px 8px}

.mtg-section{margin-bottom:20px}
.mtg-section-label{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--accent);margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid var(--border)}

.mtg-field{margin-bottom:14px}
.mtg-field label{display:block;font-size:12px;font-weight:600;color:var(--text2);margin-bottom:4px}
.mtg-field input,.mtg-field textarea,.mtg-field select{width:100%;padding:9px 12px;border:1px solid var(--border2);border-radius:var(--r);font-size:13px;font-family:inherit;color:var(--text);background:var(--surface);transition:border-color .15s;box-sizing:border-box}
.mtg-field input:focus,.mtg-field textarea:focus,.mtg-field select:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(37,99,235,.1)}
.mtg-field textarea{resize:vertical;min-height:60px}
.mtg-field select{appearance:auto}

.mtg-row-2{display:grid;grid-template-columns:1fr 1fr;gap:12px}

/* ---------- Character Meter ---------- */
.mtg-meter{height:4px;background:var(--bg);border-radius:2px;margin-top:4px;overflow:hidden}
.mtg-meter-bar{height:100%;border-radius:2px;transition:width .2s,background .2s;width:0}
.mtg-meter-bar.good{background:var(--green)}
.mtg-meter-bar.warn{background:var(--yellow)}
.mtg-meter-bar.bad{background:var(--red)}

/* ---------- Hints ---------- */
.mtg-hint{font-size:11px;margin-top:3px;min-height:16px;transition:color .2s}
.mtg-hint.good{color:var(--green)}
.mtg-hint.warn{color:var(--yellow)}
.mtg-hint.bad{color:var(--red)}
.mtg-hint-tip{color:var(--text3)}

/* ---------- Preview Section ---------- */
.mtg-preview-wrap{border-top:1px solid var(--border);border-bottom:1px solid var(--border)}
.mtg-preview-header{display:flex;align-items:center;gap:12px;padding:12px 24px;background:var(--bg);border-bottom:1px solid var(--border);flex-wrap:wrap}
.mtg-preview-title{font-size:13px;font-weight:700;color:var(--text);white-space:nowrap}
.mtg-tabs{display:flex;gap:4px;flex-wrap:wrap}
.mtg-tab{padding:5px 14px;border-radius:var(--r);border:1px solid var(--border2);background:var(--surface);color:var(--text2);font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;transition:all .15s;white-space:nowrap}
.mtg-tab:hover{border-color:var(--accent);color:var(--accent)}
.mtg-tab.active{background:var(--accent);color:#fff;border-color:var(--accent)}

.mtg-panel{display:none;padding:24px}
.mtg-panel.active{display:block}

/* ---------- Google SERP Preview ---------- */
.serp-preview{max-width:600px;font-family:Arial,sans-serif}
.serp-breadcrumb{font-size:12px;color:#202124;margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.serp-breadcrumb::before{content:'';display:inline-block;width:18px;height:18px;background:#f1f3f4;border-radius:50%;vertical-align:middle;margin-right:8px;margin-inline-end:8px}
.serp-title{font-size:20px;color:#1a0dab;line-height:1.3;margin-bottom:4px;cursor:pointer;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.serp-title:hover{text-decoration:underline}
.serp-desc{font-size:14px;color:#4d5156;line-height:1.58;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}

/* ---------- Facebook Preview ---------- */
.fb-preview{max-width:500px;border:1px solid #dddfe2;border-radius:3px;overflow:hidden;background:#fff;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif}
.fb-image{background:#f0f2f5;aspect-ratio:1200/630;display:flex;align-items:center;justify-content:center;overflow:hidden}
.fb-image img{width:100%;height:100%;object-fit:cover}
.fb-image-placeholder{display:flex;flex-direction:column;align-items:center;gap:6px;color:#8a8d91}
.fb-image-placeholder svg{width:40px;height:40px;stroke:currentColor;fill:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.fb-image-placeholder span{font-size:11px}
.fb-body{padding:10px 12px}
.fb-domain{font-size:12px;color:#606770;text-transform:uppercase;letter-spacing:.03em}
.fb-title{font-size:16px;font-weight:600;color:#1d2129;line-height:1.35;margin:3px 0;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.fb-desc{font-size:14px;color:#606770;line-height:1.4;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}

/* ---------- Twitter / X Preview ---------- */
.tw-preview{max-width:500px;border:1px solid #cfd9de;border-radius:16px;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif}
.tw-preview.tw-large .tw-image{aspect-ratio:2/1;display:flex;align-items:center;justify-content:center;background:#f7f9f9;overflow:hidden}
.tw-preview.tw-summary{display:grid;grid-template-columns:130px 1fr}
.tw-preview.tw-summary .tw-image{aspect-ratio:1/1;display:flex;align-items:center;justify-content:center;background:#f7f9f9;overflow:hidden}
.tw-image img{width:100%;height:100%;object-fit:cover}
.tw-image-placeholder{display:flex;flex-direction:column;align-items:center;gap:4px;color:#8899a6}
.tw-image-placeholder svg{width:36px;height:36px;stroke:currentColor;fill:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.tw-image-placeholder span{font-size:11px}
.tw-body{padding:12px}
.tw-title{font-size:15px;font-weight:700;color:#0f1419;line-height:1.3;margin-bottom:2px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.tw-desc{font-size:14px;color:#536471;line-height:1.35;margin-bottom:4px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.tw-domain{font-size:13px;color:#536471;display:flex;align-items:center;gap:4px}
.tw-domain::before{content:'';display:inline-block;width:14px;height:14px;border:1.5px solid #536471;border-radius:50%}

/* ---------- LinkedIn Preview ---------- */
.li-preview{max-width:500px;border:1px solid #e0e0e0;border-radius:2px;overflow:hidden;background:#fff;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif}
.li-image{background:#f3f2ef;aspect-ratio:1200/627;display:flex;align-items:center;justify-content:center;overflow:hidden}
.li-image img{width:100%;height:100%;object-fit:cover}
.li-image-placeholder{display:flex;flex-direction:column;align-items:center;gap:6px;color:#666}
.li-image-placeholder svg{width:40px;height:40px;stroke:currentColor;fill:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.li-image-placeholder span{font-size:11px}
.li-body{padding:10px 12px}
.li-title{font-size:14px;font-weight:600;color:#000;line-height:1.3;margin-bottom:2px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.li-domain{font-size:12px;color:#666}

/* ---------- WhatsApp Preview ---------- */
.wa-preview{max-width:360px;padding:8px}
.wa-bubble{background:#dcf8c6;border-radius:8px;padding:4px;position:relative;max-width:340px}
.wa-link-card{border-radius:6px;overflow:hidden;background:#fff;border:1px solid #e0e0e0}
.wa-image{background:#f0f0f0;aspect-ratio:16/9;display:flex;align-items:center;justify-content:center;overflow:hidden}
.wa-image img{width:100%;height:100%;object-fit:cover}
.wa-image-placeholder{color:#999}
.wa-image-placeholder svg{width:32px;height:32px;stroke:currentColor;fill:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.wa-body{padding:8px 10px}
.wa-domain{font-size:11px;color:#8696a0;text-transform:uppercase;letter-spacing:.03em;margin-bottom:2px}
.wa-title{font-size:13px;font-weight:600;color:#111b21;line-height:1.3;margin-bottom:2px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.wa-desc{font-size:12px;color:#667781;line-height:1.3;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.wa-url{padding:6px 8px;font-size:12px;color:#027eb5;word-break:break-all}

/* ---------- SEO Tips ---------- */
.mtg-seo-tips{padding:0 24px 16px;display:flex;flex-direction:column;gap:4px}
.mtg-tip{display:flex;align-items:center;gap:8px;padding:6px 10px;border-radius:var(--r);font-size:12px;font-weight:500}
.mtg-tip.good{background:var(--green-bg);color:var(--green)}
.mtg-tip.warn{background:var(--yellow-bg);color:var(--yellow)}
.mtg-tip.bad{background:var(--red-bg);color:var(--red)}
.mtg-tip svg{width:14px;height:14px;flex-shrink:0;stroke:currentColor;fill:none;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}

/* ---------- Code Block ---------- */
.mtg-code-wrap{padding:0}
.mtg-code-header{display:flex;align-items:center;justify-content:space-between;padding:12px 24px;background:var(--bg);border-top:1px solid var(--border);flex-wrap:wrap;gap:8px}
.mtg-code-title{font-size:13px;font-weight:700;color:var(--text)}
.mtg-code-actions{display:flex;gap:8px}
.mtg-code-block{background:#1e293b;color:#e2e8f0;padding:20px 24px;font-family:'Fira Code','SF Mono','Consolas','Monaco',monospace;font-size:12px;line-height:1.7;overflow-x:auto;white-space:pre-wrap;word-break:break-all;max-height:400px;overflow-y:auto}
.mtg-code-block .tag-name{color:#7dd3fc}
.mtg-code-block .attr-name{color:#fbbf24}
.mtg-code-block .attr-val{color:#86efac}
.mtg-code-block .comment{color:#64748b}

/* ---------- Buttons ---------- */
.btn-primary{display:inline-flex;align-items:center;gap:7px;background:var(--green);color:#fff;font-weight:600;font-size:13px;font-family:inherit;padding:8px 18px;border-radius:var(--r);border:none;cursor:pointer;transition:all .15s}
.btn-primary:hover{opacity:.88}
.btn-primary svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.btn-ghost{display:inline-flex;align-items:center;gap:7px;background:var(--bg);color:var(--text2);font-weight:600;font-size:13px;font-family:inherit;padding:8px 18px;border-radius:var(--r);border:1px solid var(--border2);cursor:pointer;transition:all .15s}
.btn-ghost:hover{border-color:var(--accent);color:var(--accent);background:var(--surface)}

/* ---------- Privacy ---------- */
.mtg-privacy{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 20px;background:var(--green-bg);border-top:1px solid #bbf7d0;font-size:12px;color:var(--green);font-weight:600}
.mtg-privacy svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* ---------- Copied Toast ---------- */
.mtg-toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#1e293b;color:#fff;padding:8px 20px;border-radius:var(--r);font-size:13px;font-weight:600;z-index:9999;opacity:0;transition:opacity .3s;pointer-events:none}
.mtg-toast.show{opacity:1}

/* ---------- Responsive ---------- */
@media(max-width:680px){
  .mtg-form{padding:16px 16px 4px}
  .mtg-row-2{grid-template-columns:1fr}
  .mtg-preview-header{padding:10px 16px}
  .mtg-panel{padding:16px}
  .mtg-tabs{gap:3px}
  .mtg-tab{padding:4px 10px;font-size:11px}
  .mtg-code-header{padding:10px 16px}
  .mtg-code-block{padding:14px 16px;font-size:11px}
  .serp-preview,.fb-preview,.tw-preview,.li-preview{max-width:100%}
}
