/* ================================
   Meta Preview Tool – Option B Theme
   ================================ */

:root {
  --primary: #2563eb;          /* royal blue */
  --primary-soft: #dbeafe;
  --teal: #0d9488;
  --indigo: #4f46e5;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-500: #64748b;
  --bg-deep: radial-gradient(circle at 0 0, #0f172a 0, #020617 40%), #020617;
}

/* Global */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: #0b1020;
  min-height: 100vh;
  position: relative;
  margin: 0;
}

/* Background */

.app-bg {
  background:
    radial-gradient(circle at 0 0, rgba(37, 99, 235, 0.35) 0, transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(14, 165, 233, 0.32) 0, transparent 45%),
    linear-gradient(135deg, #020617 0%, #020617 40%, #02091f 100%);
}

.overlay-gradient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 0, rgba(56, 189, 248, 0.18), transparent 60%),
    radial-gradient(circle at 80% 100%, rgba(37, 99, 235, 0.18), transparent 60%);
}

/* Header */

.meta-header {
  padding: 14px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.86),
    rgba(15, 23, 42, 0.7)
  );
  color: #e5e7eb;
}

.meta-logo-circle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 0 0, #22c55e, #0f766e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ecfdf5;
  font-size: 0.9rem;
}

.meta-logo-title {
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 0.98rem;
}

.meta-logo-subtitle {
  font-size: 0.78rem;
  color: rgba(226, 232, 240, 0.82);
}

.meta-badge-link {
  border-radius: 999px;
  border-color: rgba(148, 163, 184, 0.4) !important;
  font-size: 0.78rem;
}

/* Layout */

.meta-main {
  color: #e5e7eb;
}

.input-card,
.serp-card {
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.93);
  color: #e5e7eb;
}

.shadow-soft {
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.45);
}

.shadow-strong {
  box-shadow: 0 24px 65px rgba(15, 23, 42, 0.7);
}

.card .form-label {
  color: #e5e7eb;
}

.card .form-control,
.card textarea {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: #e5e7eb;
}

  /* Placeholder visibility: ensure good contrast on both dark and light card backgrounds */
  .card .form-control::placeholder,
  .card textarea::placeholder {
    color: rgba(226, 232, 240, 0.64); /* light placeholder for dark cards */
  }

  /* For typical (light) Bootstrap .card panels, use a darker placeholder so it remains readable */
  .card:not(.input-card):not(.serp-card) .form-control::placeholder,
  .card:not(.input-card):not(.serp-card) textarea::placeholder {
    color: #6b7280; /* slate-500 */
  }

.card .form-control:focus,
.card textarea:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6);
  background-color: #020617;
  color: #f9fafb;
}

.text-muted {
  color: rgba(148, 163, 184, 0.94) !important;
}

/* SERP preview */

.serp-preview {
  border-radius: 16px;
  padding: 14px 16px 16px;
  background: #020617;
  border: 1px solid rgba(55, 65, 81, 0.8);
}

.serp-desktop {
  max-width: 640px;
}

.serp-mobile {
  max-width: 360px;
}

.serp-url {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 3px;
}

.serp-breadcrumb::before {
  content: "🔍 ";
}

.serp-title {
  font-size: 1.16rem;
  font-weight: 500;
  margin: 1px 0 3px;
  line-height: 1.3;
  color: #1d4ed8;
}

.serp-title:hover {
  text-decoration: underline;
}

.serp-desc {
  font-size: 0.86rem;
  color: #e5e7eb;
  line-height: 1.5;
}

.serp-desc mark {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
  padding: 0 1px;
  border-radius: 2px;
}

/* Metrics */

.metric-chip {
  border-radius: 14px;
  padding: 10px 12px;
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.26), transparent 55%),
    rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.metric-label {
  font-size: 0.78rem;
  color: rgba(209, 213, 219, 0.88);
}

.metric-value {
  font-weight: 700;
  font-size: 1.05rem;
}

.meta-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
}

/* Meta code block */

.meta-code-block {
  background: #020617;
  border-radius: 14px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  padding: 10px 12px;
  font-size: 0.78rem;
  color: #e5e7eb;
  overflow-x: auto;
  line-height: 1.6;
}

/* Table */

.meta-table thead {
  background: rgba(15, 23, 42, 0.96);
  color: #e5e7eb;
}

.meta-table th,
.meta-table td {
  border-color: rgba(30, 64, 175, 0.5) !important;
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.94);
}

.meta-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.85);
}

/* If a table is inside a light card (default Bootstrap .card), use darker text
   so table content is readable on white backgrounds. This preserves the
   existing light colors for dark-themed cards like .input-card and .serp-card. */
.card .meta-table th,
.card .meta-table td {
  color: #374151 !important; /* slate-700: good contrast on white */
  border-color: rgba(148, 163, 184, 0.14) !important;
}

/* Footer */

.meta-footer {
  border-top: 1px solid rgba(30, 64, 175, 0.6);
  background: rgba(15, 23, 42, 0.96);
  color: rgba(148, 163, 184, 0.95);
}

/* Buttons */

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  border-color: #1d4ed8;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.45);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #0284c7);
  border-color: #1d4ed8;
}

.btn-outline-secondary {
  border-radius: 999px;
}

.btn-outline-primary {
  border-radius: 999px;
  border-color: rgba(129, 140, 248, 0.7);
  color: #c7d2fe;
}

.btn-outline-primary.active {
  background: rgba(79, 70, 229, 0.28);
  color: #e0f2fe;
}

/* Responsive */

@media (max-width: 768px) {
  .meta-header {
    padding-inline: 12px;
  }

  .meta-main {
    padding-inline: 16px;
  }

  .serp-desktop,
  .serp-mobile {
    max-width: 100%;
  }
}

/* Mobile improvements: ensure preview text is readable and doesn't overflow */
@media (max-width: 480px) {
  .serp-preview {
    padding: 16px;
  }

  .serp-title {
    font-size: 1.05rem;
    line-height: 1.25;
    word-break: break-word;
    hyphens: auto;
  }

  .serp-desc {
    font-size: 0.9rem;
  }

  /* Ensure metrics and labels are bright on mobile */
  .metric-label,
  .metric-value {
    color: #e5e7eb;
  }

  /* Avoid horizontal overflow for code and cards */
  .meta-code-block,
  .input-card,
  .serp-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Small accessibility contrast fixes */
.serp-url { color: rgba(203,213,225,0.9); }
.serp-title { text-wrap: balance; }
