/**
 * SEO Settings Panel Styles
 * Overlay panel for editing per-page SEO metadata (title, description, robots).
 * Follows the existing Ndovesha agent UI patterns (dark theme, rounded corners).
 * Font: Ubuntu (loaded via Google Fonts)
 */

@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;600;700&display=swap');

/* ── Overlay ──────────────────────────────────────────────────────────────── */
.seo-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: seoFadeIn 0.2s ease;
}

@keyframes seoFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Panel ────────────────────────────────────────────────────────────────── */
.seo-panel {
  background: #1a1a2e;
  color: #e0e0e0;
  border-radius: 16px;
  width: 640px;
  max-width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  font-family: 'Ubuntu', sans-serif;
}

.seo-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.seo-panel-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.seo-type-badge {
  display: inline-block;
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.seo-close-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}

.seo-close-btn:hover {
  color: #fff;
}

/* ── Header Actions (Export + Close) ─────────────────────────────────────── */
.seo-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.seo-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(254, 191, 15, 0.12);
  color: #FEBF0F;
  border: 1px solid rgba(254, 191, 15, 0.25);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Ubuntu', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.seo-export-btn:hover {
  background: rgba(254, 191, 15, 0.22);
  border-color: #FEBF0F;
}

.seo-panel-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.seo-hint {
  font-size: 13px;
  color: #888;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* ── Page Card ────────────────────────────────────────────────────────────── */
.seo-page-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.seo-page-card:last-child {
  margin-bottom: 0;
}

.seo-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.seo-page-label {
  font-weight: 600;
  font-size: 15px;
  color: #fff;
}

.seo-page-slug {
  font-size: 12px;
  color: #666;
  font-family: monospace;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Fields ───────────────────────────────────────────────────────────────── */
.seo-field {
  margin-bottom: 14px;
  position: relative;
}

.seo-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #aaa;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.seo-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  color: #e0e0e0;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  resize: none;
}

.seo-input:focus {
  border-color: #FEBF0F;
}

.seo-input::placeholder {
  color: #555;
}

.seo-char-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 11px;
  color: #555;
}

.seo-field-inline {
  margin-bottom: 16px;
}

.seo-field-inline label {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: normal;
  font-size: 13px;
  color: #ccc;
  cursor: pointer;
}

.seo-field-inline input[type="checkbox"] {
  accent-color: #FEBF0F;
  width: 16px;
  height: 16px;
}

/* ── Google Preview ───────────────────────────────────────────────────────── */
.seo-preview {
  background: #fff;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.seo-preview-title {
  font-size: 18px;
  color: #1a0dab;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seo-preview-url {
  font-size: 13px;
  color: #006621;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seo-preview-desc {
  font-size: 13px;
  color: #545454;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Save Button ──────────────────────────────────────────────────────────── */
.seo-save-btn {
  background: #FEBF0F;
  color: #1a1a2e;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Ubuntu', sans-serif;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  width: 100%;
}

.seo-save-btn:hover:not(:disabled) {
  background: #e5ab00;
}

.seo-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── OG Image (Feature Image) ─────────────────────────────────────────── */
.seo-og-hint {
  font-size: 12px;
  color: #777;
  margin: 0 0 10px;
  line-height: 1.4;
}

.seo-og-image-area {
  margin-top: 4px;
}

.seo-og-preview {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  background: rgba(0, 0, 0, 0.2);
  max-height: 200px;
}

.seo-og-img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.seo-og-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.seo-og-remove:hover {
  background: rgba(200, 0, 0, 0.8);
}

.seo-og-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 10px;
  color: #666;
  font-size: 13px;
}

.seo-og-error {
  display: block;
  text-align: center;
  padding: 20px;
  color: #c00;
  font-size: 13px;
}

.seo-og-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.seo-og-input-row .seo-og-url-input {
  flex: 1;
  font-size: 13px;
}

.seo-og-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(254, 191, 15, 0.12);
  color: #FEBF0F;
  border: 1px solid rgba(254, 191, 15, 0.25);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Ubuntu', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.seo-og-upload-btn:hover {
  background: rgba(254, 191, 15, 0.22);
  border-color: #FEBF0F;
}

.seo-og-uploading {
  font-size: 12px;
  color: #FEBF0F;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .seo-panel {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .seo-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .seo-page-slug {
    max-width: 100%;
  }
}
