/* Meta Tag Generator — tool-specific styles */

/* Two-column layout */
.mtg-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .mtg-layout {
    grid-template-columns: 1fr;
  }
}

/* Collapsible sections */
.mtg-section {
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  background: var(--surface, #fff);
  overflow: hidden;
}

.mtg-section-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
  background: var(--surface-alt, #f9fafb);
  border-bottom: 1px solid transparent;
}

.mtg-section[open] .mtg-section-summary {
  border-bottom-color: var(--border-color, #d1d5db);
}

.mtg-section-summary::-webkit-details-marker {
  display: none;
}

.mtg-section-summary::after {
  content: '▸';
  font-size: 0.8rem;
  color: var(--text-muted, #6b7280);
  transition: transform 0.15s;
}

.mtg-section[open] .mtg-section-summary::after {
  transform: rotate(90deg);
}

.mtg-section-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Form fields */
.mtg-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.mtg-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary, #111827);
}

.mtg-optional {
  font-weight: 400;
  color: var(--text-muted, #6b7280);
  font-size: 0.8rem;
}

.mtg-input,
.mtg-textarea,
.mtg-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 0.375rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--surface, #fff);
  color: var(--text-primary, #111827);
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.mtg-input:focus,
.mtg-textarea:focus,
.mtg-select:focus {
  outline: 2px solid var(--color-primary, #2563eb);
  outline-offset: -2px;
  border-color: var(--color-primary, #2563eb);
}

.mtg-textarea {
  resize: vertical;
  min-height: 80px;
}

.mtg-select {
  cursor: pointer;
}

/* Character count */
.mtg-char-count {
  font-size: 0.78rem;
  color: var(--text-muted, #6b7280);
  text-align: right;
}

.mtg-char-count.mtg-warn {
  color: #d97706;
  font-weight: 600;
}

.mtg-char-count.mtg-danger {
  color: var(--color-error, #dc2626);
  font-weight: 600;
}

/* Help text */
.mtg-help {
  font-size: 0.78rem;
  color: var(--text-muted, #6b7280);
}

/* Validation messages */
.mtg-validation-msg {
  font-size: 0.78rem;
  color: var(--color-error, #dc2626);
  margin: 0;
}

/* Robots row */
.mtg-robots-row {
  flex-direction: column;
}

.mtg-robots-label-wrap {
  font-size: 0.875rem;
  font-weight: 500;
}

.mtg-robots-selects {
  display: flex;
  gap: 0.5rem;
}

.mtg-robots-selects .mtg-select {
  flex: 1;
}

/* Color picker row */
.mtg-color-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.mtg-color-picker {
  width: 2.5rem;
  height: 2.25rem;
  padding: 0.15rem;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 0.375rem;
  cursor: pointer;
  flex-shrink: 0;
  background: none;
}

.mtg-color-text {
  flex: 1;
}

/* Preview column */
.mtg-preview-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 1rem;
}

@media (max-width: 900px) {
  .mtg-preview-col {
    position: static;
  }
}

/* Preview cards */
.mtg-preview-card {
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--surface, #fff);
}

.mtg-preview-card-title {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #6b7280);
  background: var(--surface-alt, #f9fafb);
  border-bottom: 1px solid var(--border-color, #d1d5db);
}

/* Google Search Preview */
.mtg-google-preview-inner {
  padding: 0.75rem 1rem;
  font-family: Arial, sans-serif;
}

.mtg-google-site-line {
  font-size: 0.78rem;
  color: #4d5156;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mtg-google-title {
  font-size: 1.05rem;
  color: #1a0dab;
  margin-bottom: 0.25rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: normal;
}

.mtg-google-title:hover {
  text-decoration: underline;
}

.mtg-google-desc {
  font-size: 0.82rem;
  color: #4d5156;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Facebook / OG Preview */
.mtg-og-preview-inner {
  background: #f0f2f5;
}

.mtg-og-image-wrap {
  position: relative;
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: #e4e6ea;
}

.mtg-og-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mtg-og-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e4e6ea;
  color: var(--text-muted, #6b7280);
  font-size: 0.82rem;
}

.mtg-og-placeholder-small {
  position: static;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.mtg-og-meta {
  padding: 0.6rem 0.75rem;
  background: #f0f2f5;
  border-top: 1px solid #dddfe2;
}

.mtg-og-domain {
  font-size: 0.72rem;
  color: #65676b;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.mtg-og-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #050505;
  margin-bottom: 0.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mtg-og-desc {
  font-size: 0.78rem;
  color: #65676b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Twitter Preview */
.mtg-twitter-preview-inner {
  padding: 0;
}

/* summary_large_image */
.mtg-twitter-large {
  display: flex;
  flex-direction: column;
}

.mtg-twitter-image-wrap {
  position: relative;
  width: 100%;
  height: 150px;
  overflow: hidden;
}

.mtg-twitter-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mtg-twitter-meta {
  padding: 0.6rem 0.75rem;
  border-top: 1px solid var(--border-color, #d1d5db);
}

.mtg-twitter-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin-bottom: 0.1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mtg-twitter-desc {
  font-size: 0.78rem;
  color: var(--text-muted, #6b7280);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mtg-twitter-domain {
  font-size: 0.72rem;
  color: var(--text-muted, #6b7280);
  margin-top: 0.2rem;
}

/* summary layout */
.mtg-twitter-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
}

.mtg-twitter-summary-img-wrap {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 0.375rem;
  overflow: hidden;
  position: relative;
  background: #e4e6ea;
}

.mtg-twitter-summary-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mtg-twitter-summary-meta {
  flex: 1;
  min-width: 0;
}

/* Output code block */
.mtg-output {
  background: var(--surface-alt, #f9fafb);
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  font-family: 'Fira Mono', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  margin: 0;
  white-space: pre;
}

/* Syntax highlight colors */
.mtg-hl-comment { color: #6b7280; font-style: italic; }
.mtg-hl-tag     { color: #7c3aed; }
.mtg-hl-attr    { color: #2563eb; }
.mtg-hl-value   { color: #16a34a; }
.mtg-hl-text    { color: #111827; }

/* Section heading with inline button */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.button-sm {
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
}

/* Privacy notice */
.mtg-privacy {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted, #6b7280);
  margin: 0.5rem 0 1.5rem;
}
