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

/* --- TOP BAR & MODALS --- */
#ufriend-audit-top-bar {
  position: fixed;
  top: 0; left: 0; right: 0; height: 60px;
  background-color: rgba(255, 255, 255, 0.85); color: #0f172a;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  z-index: 999999; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; font-family: 'Kanit', sans-serif; font-size: 14px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05); border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
#ufriend-audit-top-bar .audit-left { display: flex; align-items: center; gap: 15px; }
#ufriend-audit-top-bar .audit-right { display: flex; align-items: center; gap: 10px; }
#ufriend-audit-top-bar .brand-badge {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%); color: #ffffff; padding: 6px 14px; border-radius: 8px; font-weight: 600; font-size: 15px; border: 1px solid rgba(255,255,255,0.2); display: flex; align-items: center; gap: 8px; box-shadow: 0 2px 10px rgba(59,130,246,0.3); letter-spacing: 0.5px; text-transform: uppercase;
}
#ufriend-audit-top-bar button {
  background: rgba(0, 0, 0, 0.05); color: #0f172a; border: 1px solid rgba(0, 0, 0, 0.1); padding: 8px 16px; border-radius: 6px; font-weight: 500; cursor: pointer; font-family: 'Kanit', sans-serif; transition: all 0.2s ease;
}
#ufriend-audit-top-bar button:hover { background: rgba(0, 0, 0, 0.1); border-color: rgba(0, 0, 0, 0.2); }
.audit-btn-content { display: flex; align-items: center; gap: 6px; }

/* Modals Overlay */
.ufriend-modal-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.6); z-index: 9999999; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(8px);
}
/* SEO Mockup Card (Modal) */
#ufriend-seo-audit-card {
  background: #ffffff; border: 1px solid #e2e8f0; padding: 30px; border-radius: 12px; width: 100%; max-width: 600px; font-family: 'Kanit', sans-serif; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); position: relative;
}
.ufriend-modal-close {
  position: absolute; top: 20px; right: 20px; background: transparent !important; color: #64748b !important; border: none !important; font-size: 24px; cursor: pointer; padding: 0 !important; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.ufriend-modal-close:hover { color: #0f172a !important; }
#ufriend-seo-audit-card h3 {
  margin-top: 0; color: #0f172a; display: flex; align-items: center; gap: 10px; font-size: 20px; border-bottom: 1px solid #e2e8f0; padding-bottom: 15px; margin-bottom: 20px; font-weight: 600;
}
.seo-field { margin-bottom: 20px; }
.seo-field label { font-weight: 500; color: #4b5563; display: block; margin-bottom: 8px; font-size: 14px; text-transform: uppercase; font-family: 'Kanit', sans-serif; }
.seo-field .seo-value { background: rgba(255, 255, 255, 0.7); padding: 12px 16px; border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 8px; color: #1f2937; font-size: 14px; word-break: break-all; }
#sidebar-seo-title, #sidebar-seo-desc { font-family: 'Sarabun', sans-serif; font-size: 15px; }
#sidebar-seo-canonical { max-height: 80px; overflow-y: auto; font-family: monospace; font-size: 12px; }


/* Schema Modal */
#ufriend-schema-modal-content {
  background: #ffffff; color: #1e293b; width: 90%; max-width: 1200px; max-height: 80vh; border-radius: 12px; display: flex; flex-direction: column; font-family: 'Courier New', Courier, monospace; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); border: 1px solid #e2e8f0;
}
#schema-modal-header {
  display: flex; justify-content: space-between; align-items: center; padding: 15px 24px; border-bottom: 1px solid #e2e8f0; font-family: 'Kanit', sans-serif; font-weight: 600; font-size: 18px; background: #f8fafc; border-radius: 12px 12px 0 0; color: #0f172a;
}
#schema-modal-body { padding: 24px; overflow-y: auto; white-space: pre-wrap; font-size: 18px; line-height: 1.8; color: #334155; }

/* Fix for top bar overlapping */
body { padding-top: 60px !important; }
header, .uf-header { pointer-events: none !important; z-index: 99998 !important; background-color: #0051ba !important; }
footer { pointer-events: none !important; }
@media (min-width: 1280px) { header, .uf-header { top: 84px !important; } }

/* --- SIDEBAR --- */
:root {
  --uf-sidebar-bg: rgba(255, 255, 255, 0.85);
  --uf-sidebar-surface: rgba(255, 255, 255, 0.6);
  --uf-sidebar-border: rgba(0, 0, 0, 0.1);
  --uf-sidebar-text: #1f2937;
  --uf-sidebar-text-muted: #4b5563;
  --uf-sidebar-primary: #3b82f6;
}
#uf-seo-sidebar {
  position: fixed; top: 0; right: 0; width: 550px; height: 100vh; background: var(--uf-sidebar-bg); color: var(--uf-sidebar-text); z-index: 1000000; box-shadow: -4px 0 25px rgba(0,0,0,0.15); transition: transform 0.3s ease, width 0.1s; display: flex; flex-direction: column; font-family: 'Kanit', sans-serif; border-left: 1px solid rgba(255, 255, 255, 0.5); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transform: translateX(100%);
}
#uf-seo-sidebar.open { transform: translateX(0); }
#uf-seo-sidebar-resizer {
  position: absolute; top: 0; left: 0; width: 6px; height: 100%; cursor: ew-resize; background: transparent; z-index: 10; transition: background 0.2s;
}
#uf-seo-sidebar-resizer:hover, #uf-seo-sidebar-resizer.resizing {
  background: rgba(59, 130, 246, 0.5);
}
.uf-sidebar-header { padding: 20px; border-bottom: 1px solid var(--uf-sidebar-border); display: flex; justify-content: space-between; align-items: center; background: var(--uf-sidebar-surface); }
.uf-sidebar-header h3 { margin: 0; font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.uf-sidebar-close { background: none; border: none; color: var(--uf-sidebar-text-muted); cursor: pointer; padding: 4px; transition: color 0.2s; }
.uf-sidebar-close:hover { color: #000; }
.uf-sidebar-content { padding: 20px; overflow-y: auto; flex: 1; }
.uf-sidebar-section { margin-bottom: 24px; }
.uf-sidebar-section h4 { margin: 0 0 12px 0; font-size: 14px; text-transform: uppercase; color: var(--uf-sidebar-text-muted); letter-spacing: 0.5px; border-bottom: 1px solid var(--uf-sidebar-border); padding-bottom: 8px; }
.uf-field { margin-bottom: 12px; }
.uf-field label { display: block; font-size: 12px; color: var(--uf-sidebar-text-muted); margin-bottom: 4px; }
.uf-field-val { background: var(--uf-sidebar-surface); padding: 10px 12px; border-radius: 6px; font-size: 14px; border: 1px solid var(--uf-sidebar-border); word-break: break-word; line-height: 1.5; }
.uf-rule-card { background: var(--uf-sidebar-surface); border: 1px solid var(--uf-sidebar-border); border-radius: 8px; padding: 16px; margin-bottom: 16px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.uf-rule-target { font-weight: 600; color: #2563eb; margin-bottom: 10px; font-size: 16px; font-family: 'Kanit', sans-serif; }
.uf-rule-note { font-size: 17px; color: #374151; white-space: pre-wrap; line-height: 1.6; font-family: 'Sarabun', sans-serif; letter-spacing: 0.2px; }

.uf-checklist { display: flex; flex-direction: column; gap: 10px; background: var(--uf-sidebar-surface); padding: 16px; border-radius: 8px; border: 1px solid var(--uf-sidebar-border); }
.uf-check-item { display: flex; align-items: flex-start; gap: 10px; font-size: 16px; cursor: pointer; color: var(--uf-sidebar-text); line-height: 1.5; transition: opacity 0.2s; font-family: 'Sarabun', sans-serif; }
.uf-check-item:hover { opacity: 0.8; }
.uf-check-item input[type="checkbox"] { width: 18px; height: 18px; margin-top: 3px; cursor: pointer; accent-color: var(--uf-sidebar-primary); flex-shrink: 0; }

