/* ═══════════ META TAG GENERATOR ═══════════ */

.mt-wrap { display: flex; flex-direction: column; gap: var(--space-5); }
.mt-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: var(--space-5); }

.mt-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.mt-breadcrumb { font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: 6px; }
.mt-breadcrumb span { margin: 0 6px; }
.mt-title { font-size: var(--fs-2xl); font-weight: var(--fw-bold); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mt-ai-badge { font-size: 0.65rem; font-weight: var(--fw-semibold); color: #a78bfa; background: rgba(139,92,246,0.14); border: 1px solid rgba(139,92,246,0.3); padding: 3px 10px; border-radius: var(--radius-full); }
.mt-subtitle { color: var(--text-secondary); font-size: var(--fs-base); margin-top: 6px; max-width: 900px; }
.mt-header-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

/* Stats */
.mt-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.mt-stat { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: var(--space-5); }
.mt-stat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.mt-stat-label { font-size: var(--fs-xs); color: var(--text-secondary); }
.mt-stat-val { font-size: 1.9rem; font-weight: var(--fw-bold); color: var(--text-primary); margin-top: 4px; }
.mt-stat-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.mt-stat-delta { font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.mt-stat-delta.pos { color: var(--success); }
.mt-stat-delta.neg { color: var(--error); }
.mt-link-inline { color: var(--primary); cursor: pointer; text-decoration: none; }
.mt-link-inline:hover { text-decoration: underline; }

/* Main grid: 3 cols */
.mt-main-grid { display: grid; grid-template-columns: 380px 1fr 340px; gap: var(--space-5); align-items: start; }
.mt-left, .mt-middle, .mt-right { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }

/* Sections */
.mt-section-h { font-size: var(--fs-sm); color: var(--primary); font-weight: var(--fw-semibold); margin-bottom: var(--space-3); }
.mt-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.mt-card-head h3 { font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--text-primary); }
.mt-card-head .mt-link { color: var(--primary); font-size: var(--fs-xs); text-decoration: none; }
.mt-ai-btn-sm { background: rgba(139,92,246,0.14); border: 1px solid rgba(139,92,246,0.3); color: #a78bfa; padding: 5px 12px; border-radius: var(--radius-full); font-size: var(--fs-xs); font-weight: var(--fw-semibold); cursor: pointer; }
.mt-ai-btn-sm:hover { background: rgba(139,92,246,0.2); }

.mt-label { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-secondary); display: block; margin-bottom: 4px; }
.mt-optional { color: var(--text-muted); font-weight: var(--fw-normal); font-size: var(--fs-2xs); }
.mt-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mt-form-group { display: flex; flex-direction: column; }
.mt-form-group .form-input, .mt-form-group .form-select { padding: 8px 10px; font-size: var(--fs-sm); }
.mt-muted { color: var(--text-muted); }

.mt-ai-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: var(--space-3); }
.mt-range { width: 100%; accent-color: var(--primary); }
.mt-range-val { font-size: var(--fs-xs); color: var(--text-muted); text-align: right; margin-top: 2px; }

/* Toggles */
.mt-toggle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; padding: 12px 0; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); margin-bottom: var(--space-4); }
.mt-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-xs); color: var(--text-secondary); }
.mt-toggle input { display: none; }
.mt-toggle-track { width: 34px; height: 18px; background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: 999px; position: relative; transition: background 0.2s; flex-shrink: 0; }
.mt-toggle-track::before { content: ''; position: absolute; width: 12px; height: 12px; background: var(--text-muted); border-radius: 50%; top: 2px; left: 2px; transition: transform 0.2s, background 0.2s; }
.mt-toggle input:checked + .mt-toggle-track { background: rgba(139,92,246,0.3); border-color: rgba(139,92,246,0.5); }
.mt-toggle input:checked + .mt-toggle-track::before { transform: translateX(16px); background: #a78bfa; }
.mt-toggle-label { flex: 1; }

.mt-gen-btn { width: 100%; padding: 12px; background: linear-gradient(135deg, #a78bfa, #8b5cf6); border: none; color: white; font-weight: var(--fw-semibold); }

/* Checklist */
.mt-checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.mt-check-row { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); }
.mt-check-icon { width: 18px; height: 18px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; font-size: 0.7rem; }
.mt-check-icon.ok { background: rgba(34,197,94,0.14); color: var(--success); }
.mt-check-icon.bad { background: rgba(239,68,68,0.14); color: var(--error); }
.mt-check-label { flex: 1; color: var(--text-primary); }
.mt-check-status { font-size: var(--fs-2xs); font-weight: var(--fw-medium); }
.mt-check-status.ok { color: var(--success); }
.mt-check-status.bad { color: var(--error); }

/* History table */
.mt-hist-table { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); }
.mt-hist-table th { text-align: left; padding: 6px 4px; font-size: var(--fs-2xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; border-bottom: 1px solid var(--border-color); font-weight: var(--fw-semibold); }
.mt-hist-table td { padding: 8px 4px; border-bottom: 1px solid var(--border-color); }
.mt-hist-score { padding: 2px 8px; border-radius: 4px; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); }
.mt-hist-score.ok { background: rgba(34,197,94,0.14); color: var(--success); }
.mt-hist-score.warn { background: rgba(245,158,11,0.14); color: var(--warning); }
.mt-hist-score.bad { background: rgba(239,68,68,0.14); color: var(--error); }
.mt-hist-actions { white-space: nowrap; }
.mt-hist-action { background: none; border: 1px solid var(--border-color); color: var(--text-secondary); border-radius: 4px; width: 24px; height: 24px; font-size: 0.75rem; cursor: pointer; margin-left: 2px; }
.mt-hist-action:hover { border-color: var(--border-color-hover); color: var(--text-primary); }

/* Output card */
.mt-output-card { padding: 0; overflow: hidden; }
.mt-output-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border-color); flex-wrap: wrap; gap: 8px; }
.mt-output-head h3 { font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.mt-output-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mt-tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--border-color); overflow-x: auto; }
.mt-tab { background: none; border: none; color: var(--text-secondary); padding: 10px 12px; font-size: var(--fs-xs); font-weight: var(--fw-medium); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.mt-tab:hover { color: var(--text-primary); }
.mt-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.mt-code { background: #0b1020; margin: 0; padding: 14px 0; font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.55; color: #d4d7e0; max-height: 520px; overflow: auto; }
.mt-line { display: flex; padding: 0 12px; }
.mt-line:hover { background: rgba(255,255,255,0.02); }
.mt-lineno { color: #4b5473; padding-right: 14px; user-select: none; min-width: 28px; text-align: right; }
.mt-linetext { white-space: pre-wrap; word-break: break-word; }
.mt-tag { color: #82aaff; }
.mt-attr { color: #ffcb6b; }
.mt-str { color: #c3e88d; }
.mt-comment { color: #6a7180; font-style: italic; }

.mt-code-footer { padding: 8px 16px; border-top: 1px solid var(--border-color); text-align: right; }
.mt-valid-badge { display: inline-block; padding: 3px 10px; background: rgba(34,197,94,0.14); color: var(--success); border-radius: var(--radius-full); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); }

/* Analysis */
.mt-analysis-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
.mt-anz-row { margin-bottom: 12px; }
.mt-anz-label { font-size: var(--fs-xs); color: var(--text-secondary); margin-bottom: 6px; }
.mt-anz-bar-wrap { height: 6px; background: var(--bg-elevated); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.mt-anz-bar { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
.mt-anz-pct { font-size: var(--fs-xs); color: var(--text-primary); font-weight: var(--fw-medium); }
.mt-anz-related { margin-top: 14px; }
.mt-related-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mt-chip { background: var(--primary-muted); color: var(--primary); padding: 3px 10px; border-radius: var(--radius-full); font-size: var(--fs-2xs); }
.mt-chip-more { background: var(--bg-elevated); color: var(--text-muted); }

.mt-intent-card, .mt-ctr-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 12px; margin-bottom: 10px; text-align: center; }
.mt-intent-label, .mt-ctr-label { font-size: var(--fs-xs); color: var(--text-secondary); margin-bottom: 4px; }
.mt-intent-val { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--text-primary); }
.mt-intent-conf { font-size: var(--fs-2xs); color: var(--text-muted); margin-top: 2px; }
.mt-ctr-val { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.mt-ctr-val.high { color: var(--success); }
.mt-ctr-val.med { color: var(--warning); }
.mt-ctr-val.low { color: var(--error); }
.mt-ctr-sub { font-size: var(--fs-2xs); color: var(--text-muted); margin-top: 2px; }

/* Google preview */
.mt-preview-toggle { display: flex; gap: 4px; }
.mt-pt-btn { background: var(--bg-elevated); border: 1px solid var(--border-color); color: var(--text-secondary); width: 28px; height: 24px; border-radius: 4px; cursor: pointer; font-size: 0.75rem; }
.mt-pt-btn.active { background: var(--primary-muted); border-color: rgba(14,165,233,0.4); color: var(--primary); }
.mt-google-preview { padding: 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-secondary); }
.mt-goog-url { font-size: var(--fs-xs); color: var(--success); margin-bottom: 4px; word-break: break-all; }
.mt-goog-url .mt-muted { color: var(--text-muted); }
.mt-goog-title { font-size: 1.1rem; color: #8ab4f8; font-weight: var(--fw-medium); margin-bottom: 4px; line-height: 1.3; }
.mt-goog-desc { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; }
.mt-goog-meta { font-size: var(--fs-2xs); color: var(--text-muted); }
.mt-goog-meta > div { margin-bottom: 3px; }
.mt-goog-bar { height: 4px; background: var(--bg-elevated); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.mt-goog-bar-fill { height: 100%; transition: width 0.3s; }
.mt-ok { color: var(--success); font-weight: var(--fw-semibold); }
.mt-bad { color: var(--error); font-weight: var(--fw-semibold); }

/* Social preview */
.mt-social-head { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; margin-bottom: 8px; }
.mt-social-head h3 { font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.mt-social-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-color); margin-bottom: 10px; overflow-x: auto; }
.mt-social-tab { background: none; border: none; color: var(--text-secondary); padding: 6px 10px; font-size: var(--fs-xs); font-weight: var(--fw-medium); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.mt-social-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.mt-soc-card { border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; }
.mt-soc-img { height: 110px; background: linear-gradient(135deg, #0369a1, #075985); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.mt-soc-img img { width: 100%; height: 100%; object-fit: cover; }
.mt-soc-img-ph { color: rgba(255,255,255,0.5); font-family: var(--font-mono); font-size: var(--fs-xs); }
.mt-soc-body { padding: 10px 12px; background: var(--bg-secondary); }
.mt-soc-title { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-primary); line-height: 1.35; margin-bottom: 4px; }
.mt-soc-desc { font-size: var(--fs-xs); color: var(--text-secondary); line-height: 1.4; margin-bottom: 4px; }
.mt-soc-domain { font-size: var(--fs-2xs); color: var(--text-muted); text-transform: uppercase; }

/* SEO Analysis score */
.mt-score-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.mt-score-ring { position: relative; width: 120px; height: 120px; }
.mt-score-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mt-score-val { font-size: 1.8rem; font-weight: var(--fw-bold); line-height: 1; color: var(--text-primary); }
.mt-score-max { font-size: var(--fs-2xs); color: var(--text-muted); }
.mt-score-label { font-size: var(--fs-xs); color: var(--success); font-weight: var(--fw-semibold); margin-top: 2px; }
.mt-score-list { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.mt-score-row { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); }
.mt-check-icon-sm { width: 16px; height: 16px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; font-size: 0.65rem; }
.mt-check-icon-sm.ok { background: rgba(34,197,94,0.14); color: var(--success); }
.mt-check-icon-sm.bad { background: rgba(239,68,68,0.14); color: var(--error); }
.mt-score-label-txt { flex: 1; color: var(--text-primary); }
.mt-score-val-txt { font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.mt-score-val-txt.ok { color: var(--success); }
.mt-score-val-txt.bad { color: var(--error); }

/* AI recommendations */
.mt-recs-list { display: flex; flex-direction: column; gap: 10px; }
.mt-rec-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-secondary); }
.mt-rec-text { flex: 1; font-size: var(--fs-xs); color: var(--text-primary); line-height: 1.45; }
.mt-rec-btn { background: rgba(139,92,246,0.14); border: 1px solid rgba(139,92,246,0.3); color: #a78bfa; padding: 4px 12px; border-radius: 6px; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); cursor: pointer; white-space: nowrap; }
.mt-rec-btn:hover { background: rgba(139,92,246,0.24); }
.mt-full-btn { width: 100%; margin-top: 12px; background: linear-gradient(135deg, #a78bfa, #8b5cf6); border: none; }
.mt-sparkle { display: inline-block; margin-right: 4px; }
.mt-empty-sub { font-size: var(--fs-xs); color: var(--text-muted); padding: 10px 0; }
.mt-link-btn { background: none; border: none; color: var(--primary); font-size: var(--fs-xs); cursor: pointer; text-decoration: underline; padding: 0; }
.mt-preview-box { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 10px; font-size: var(--fs-sm); color: var(--text-primary); margin-top: 4px; }

/* Templates modal */
.mt-tpl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.mt-tpl-row:last-child { border-bottom: none; }
.mt-tpl-name { font-size: var(--fs-sm); color: var(--text-primary); font-weight: var(--fw-medium); }
.mt-tpl-date { font-size: var(--fs-2xs); margin-top: 2px; }

/* Responsive */
@media (max-width: 1400px) {
  .mt-main-grid { grid-template-columns: 1fr 1fr; }
  .mt-right { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 1024px) {
  .mt-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .mt-main-grid { grid-template-columns: 1fr; }
  .mt-right { grid-template-columns: 1fr; }
  .mt-analysis-grid { grid-template-columns: 1fr; }
  .mt-form-grid, .mt-ai-grid, .mt-toggle-grid, .mt-checklist { grid-template-columns: 1fr; }
}
