/* =========================================================
   SERP-PREVIEW.HTML — SERP preview-specific styles
   (shared tool-widget styles live in css/app-shared.css,
   design tokens live in css/style.css)
========================================================= */

/* ===== Google SERP Snippet ===== */
.google-snippet {
  width: 100%;
  max-width: 600px;
  font-family: var(--font-body);
  padding: 12px 0;
}

.google-snippet__url {
  font-size: 0.82rem;
  color: #006621;
  margin-bottom: 2px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.google-snippet__domain {
  font-weight: 400;
}

.google-snippet__path {
  color: #006621;
}

.google-snippet__title {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 400;
  color: #1a0dab;
  margin: 0 0 3px;
  text-decoration: none;
  line-height: 1.3;
  cursor: pointer;
}

.google-snippet__title:hover {
  text-decoration: underline;
}

.google-snippet__description {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #4d5156;
  margin: 0 0 4px;
}

.google-snippet__date {
  font-size: 0.78rem;
  color: #4d5156;
  margin: 0 0 2px;
}

.google-snippet__breadcrumb {
  font-size: 0.78rem;
  color: #4d5156;
  margin: 0;
}

/* ===== Mobile View ===== */
.google-snippet.is-mobile {
  max-width: 400px;
  padding: 8px 0;
}

.google-snippet.is-mobile .google-snippet__title {
  font-size: 1rem;
}

.google-snippet.is-mobile .google-snippet__description {
  font-size: 0.82rem;
}

.google-snippet.is-mobile .google-snippet__url {
  font-size: 0.75rem;
}

/* ===== Validation Results ===== */
.preview-section,
.validation-section,
.stats-section {
  margin-bottom: 20px;
}

.section-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 10px;
  text-transform: lowercase;
}

#previewContainer {
  min-height: 100px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8px 0;
}

#validationList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.validation-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

.validation-item .validation-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 1px;
}

.validation-item--success .validation-icon {
  background: var(--green);
  color: #fff;
}

.validation-item--warning .validation-icon {
  background: var(--amber);
  color: #fff;
}

.validation-item--error .validation-icon {
  background: var(--red);
  color: #fff;
}

.validation-item strong {
  font-weight: 600;
  color: var(--ink);
  display: block;
}

.validation-item .validation-detail {
  color: var(--muted);
  font-size: 0.82rem;
  display: block;
}

/* Dark mode validation items */
.app-preview__stage.is-dark .validation-item {
  background: #1A1A1A;
  border-color: #2A2A2A;
}

.app-preview__stage.is-dark .validation-item strong {
  color: #E7E9EA;
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.stat-card__label {
  font-size: 0.68rem;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.stat-card__value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  display: block;
  margin-bottom: 6px;
}

.stat-card__bar {
  height: 4px;
  border-radius: 2px;
  display: block;
  transition: width 0.3s ease, background 0.3s ease;
}

.app-preview__stage.is-dark .stat-card {
  background: #1A1A1A;
  border-color: #2A2A2A;
}

.app-preview__stage.is-dark .stat-card__value {
  color: #E7E9EA;
}

/* ===== URL Input ===== */
.url-input-wrap {
  display: flex;
  gap: 10px;
}

.url-input-wrap input[type="url"] {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.92rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease;
}

.url-input-wrap input[type="url"]:focus {
  border-color: var(--blue);
}

.url-input-wrap .btn {
  flex-shrink: 0;
}

/* ===== Character Rings ===== */
.textarea-wrap {
  position: relative;
}

.field input[type="text"] {
  padding-right: 44px;
}

.char-ring {
  position: absolute;
  bottom: 10px;
  right: 8px;
  transform: rotate(-90deg);
}

.char-ring__bg {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 3;
}

.char-ring__fg {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 94.2;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.15s ease, stroke 0.15s ease;
}

.char-count {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0;
}

.char-count.is-warn {
  color: var(--amber);
}

.char-count.is-over {
  color: var(--red);
  font-weight: 600;
}

.char-count.is-optimal {
  color: var(--green);
}

/* ===== Responsive ===== */
@media (max-width: 520px) {
  .url-input-wrap {
    flex-direction: column;
  }

  .url-input-wrap .btn {
    width: 100%;
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .google-snippet {
    max-width: 100%;
  }
}

/* ===== Shared app styles (reused from other tools) ===== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.breadcrumb a {
  text-decoration: none;
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--blue-ink);
}

.breadcrumb span[aria-current] {
  color: var(--ink);
  font-weight: 600;
}

.app-hero {
  padding: 56px 0 40px;
}

.app-hero__title {
  font-size: clamp(2rem, 4vw, 3rem);
  max-width: 720px;
}

.app-hero__subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin-bottom: 8px;
}

.btn--sm {
  padding: 9px 16px;
  font-size: 0.85rem;
}

.btn--text {
  background: none;
  border: none;
  color: var(--muted);
  padding: 9px 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn--text:hover {
  color: var(--ink);
}

.app-tool {
  padding-top: 24px;
}

.app-tool__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 960px) {
  .app-tool__grid {
    grid-template-columns: 1fr;
  }
}

.app-form__body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 520px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 0.72rem;
  color: var(--muted);
}

.field input[type="text"],
.field input[type="number"],
.field input[type="url"] {
  font-family: var(--font-body);
  font-size: 0.92rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease;
}

.field input[type="text"]:focus,
.field input[type="number"]:focus,
.field input[type="url"]:focus {
  border-color: var(--blue);
}

.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 44px 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease;
}

.field textarea:focus {
  border-color: var(--blue);
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
  background: var(--bg);
}

.segmented__btn {
  border: none;
  background: none;
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.segmented__btn.is-active {
  background: var(--ink);
  color: #fff;
}

.app-form__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.form-note {
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0;
}

.app-preview {
  position: sticky;
  top: 96px;
}

.app-preview__stage {
  padding: 26px 20px;
  background: var(--bg);
  transition: background 0.2s ease;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.app-preview__stage.is-dark {
  background: #000;
}

.safe-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}

@media (max-width: 860px) {
  .safe-grid {
    grid-template-columns: 1fr;
  }
}

.safe-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
}

.safe-card h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.safe-card p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 32px;
}

@media (max-width: 960px) {
  .tips-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .tips-grid {
    grid-template-columns: 1fr;
  }
}

.tips-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
}

.tips-card__mark {
  color: var(--blue-ink);
  font-size: 0.78rem;
  display: block;
  margin-bottom: 10px;
}

.tips-card h3 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.tips-card p {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 32px;
}

@media (max-width: 760px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.related-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.related-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.related-card .platform-mark {
  width: 34px;
  height: 34px;
  font-size: 0.85rem;
  border-radius: 8px;
}
