/* Native Ad Tool - Complete Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f3f4f6;
  --text: #111827;
  --muted: #6b7280;
  --muted-light: #9ca3af;
  --card-bg: #ffffff;
  --accent: #111827;
  --accent-soft: #e5f2ff;
  --accent-strong: #1d4ed8;
  --border: #e5e7eb;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  min-height: 100vh;
}

.ad-banner-top {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 15px;
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#ad-top-banner {
  width: 728px;
  height: 90px;
}

.ad-placeholder {
  background: #f9fafb;
  border: 2px dashed #d1d5db;
  color: #9ca3af;
  font-size: 0.9rem;
  padding: 12px 20px;
  border-radius: 999px;
}

.container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 16px 48px;
  flex: 1;
}

.nav {
  margin-bottom: 24px;
}

.nav a {
  color: #6b7280;
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.nav a:hover {
  color: #111827;
}

.header {
  text-align: center;
  margin-bottom: 32px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.logo-wordmark {
  font-weight: 700;
  letter-spacing: -0.06em;
}

h1 {
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 6px;
}

.subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 560px;
  margin: 0 auto;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: 24px;
}

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

.card {
  background: var(--card-bg);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
  padding: 20px 20px 18px;
}

.card h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 14px;
}

/* Upload areas */
.upload-stack {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.upload-area {
  border: 1px dashed #cbd5f5;
  border-radius: 14px;
  padding: 14px;
  background: #f9fafb;
  text-align: center;
}

.upload-area input[type="file"] {
  display: none;
}

.upload-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #f9fafb;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  transition: all 0.16s ease;
}

.upload-label:hover {
  background: #1f2937;
  transform: translateY(-1px);
}

.upload-helper {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.preview-row {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.original-preview {
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 420px;
  width: 100%;
}

.original-preview img {
  max-width: 100%;
  max-height: 260px;
  display: block;
}

.logo-preview-wrapper {
  border-radius: 12px;
  overflow: hidden;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  max-width: 420px;
  width: 100%;
}

.logo-preview-wrapper img {
  max-width: 80%;
  max-height: 80px;
  border-radius: 8px;
}

.preview-placeholder {
  color: var(--muted-light);
  font-size: 0.8rem;
}

/* Text fields */
.field-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

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

.field label {
  font-size: 0.8rem;
  color: #374151;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.field small {
  color: var(--muted-light);
  font-size: 0.7rem;
}

.field input,
.field textarea {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 8px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
}

.field textarea {
  border-radius: 10px;
  resize: vertical;
  min-height: 60px;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.char-counter {
  font-size: 0.7rem;
  color: var(--muted-light);
}

/* Sliders */
.sliders {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-row label {
  flex: 0 0 100px;
  font-size: 0.8rem;
  color: #4b5563;
}

.slider-row input[type="range"] {
  flex: 1;
}

.helper-note {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 6px;
}

/* Native Ad Preview Card */
.native-preview-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.native-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.native-logo-container {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.native-logo-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.native-logo-placeholder {
  color: #9ca3af;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.native-meta {
  flex: 1;
  min-width: 0;
}

.native-sponsor {
  font-size: 0.88rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 2px;
}

.native-domain {
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.native-main-image {
  width: 100%;
  aspect-ratio: 1.91 / 1;
  object-fit: cover;
  display: block;
  background: #e5e7eb;
}

.native-body {
  padding: 12px 14px 14px;
}

.native-title {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 6px;
  line-height: 1.3;
}

.native-desc {
  font-size: 0.85rem;
  color: #4b5563;
  line-height: 1.5;
  margin-bottom: 10px;
}

.native-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.native-url {
  font-size: 0.75rem;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.native-cta {
  background: #111827;
  color: #f9fafb;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  border: none;
  cursor: default;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Download Section */
.download-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #111827;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 12px;
}

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

.download-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.download-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #111827;
}

.download-spec {
  font-size: 0.72rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.download-card canvas {
  display: none;
}

.download-btn {
  margin-top: 4px;
  font-size: 0.8rem;
  padding: 7px 10px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: #111827;
  color: #f9fafb;
  align-self: flex-start;
  transition: all 0.16s ease;
}

.download-btn:hover:not(:disabled) {
  background: #1f2937;
  transform: translateY(-1px);
}

.download-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.footer-note {
  margin-top: 12px;
  font-size: 0.8rem;
  color: #9ca3af;
  text-align: right;
}

.ad-banner-bottom {
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  padding: 20px;
  text-align: center;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 32px;
}

.footer {
  margin-top: 16px;
  text-align: center;
  font-size: 0.8rem;
  color: #9ca3af;
}