/* Naver Blog Fetcher - Main Styles */
*, *::before, *::after { box-sizing: border-box; }

.nbf-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Noto Sans KR', sans-serif;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
  color: #1a1a2e;
}

/* ── Header ── */
.nbf-header {
  text-align: center;
  margin-bottom: 32px;
}
.nbf-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #03c75a;
  margin: 0 0 6px;
}
.nbf-header p {
  color: #666;
  margin: 0;
  font-size: 0.95rem;
}

/* ── Search Box ── */
.nbf-search-box {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 14px;
  padding: 28px 32px;
  margin-bottom: 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.nbf-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.nbf-search-row input[type="text"] {
  flex: 1;
  min-width: 200px;
  height: 48px;
  padding: 0 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border-color .2s;
}
.nbf-search-row input[type="text"]:focus {
  border-color: #03c75a;
}
.nbf-btn {
  height: 48px;
  padding: 0 22px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.nbf-btn-primary { background: #03c75a; color: #fff; }
.nbf-btn-primary:hover { background: #02a84b; }
.nbf-btn-outline { background: #fff; color: #03c75a; border: 2px solid #03c75a; }
.nbf-btn-outline:hover { background: #f0fff6; }
.nbf-btn-gray { background: #f5f5f5; color: #444; }
.nbf-btn-gray:hover { background: #eee; }
.nbf-btn-danger { background: #ff4d4f; color: #fff; }
.nbf-btn-danger:hover { background: #d9363e; }
.nbf-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Blog Info Card ── */
.nbf-blog-info {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 16px 20px;
  background: #f9fff9;
  border-radius: 10px;
  border: 1px solid #d4f0e0;
}
.nbf-blog-info img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #03c75a;
}
.nbf-blog-info-text h3 { margin: 0 0 3px; font-size: 1.05rem; }
.nbf-blog-info-text p  { margin: 0; font-size: 0.85rem; color: #666; }
.nbf-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #e8fff1;
  color: #03c75a;
  margin-left: 8px;
}

/* ── Tabs ── */
.nbf-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 24px;
}
.nbf-tab {
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  color: #888;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.nbf-tab.active { color: #03c75a; border-bottom-color: #03c75a; }
.nbf-tab:hover:not(.active) { color: #444; }
.nbf-tab-pane { display: none; }
.nbf-tab-pane.active { display: block; }

/* ── Category Panel ── */
.nbf-category-panel {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}
.nbf-category-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 8px 0;
  max-height: 600px;
  overflow-y: auto;
}
.nbf-category-item {
  padding: 10px 18px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.nbf-category-item:hover { background: #f5f5f5; }
.nbf-category-item.active {
  background: #f0fff6;
  color: #03c75a;
  font-weight: 700;
  border-left-color: #03c75a;
}
.nbf-category-item .cat-count {
  font-size: 0.78rem;
  color: #aaa;
  background: #f0f0f0;
  padding: 1px 7px;
  border-radius: 10px;
}
.nbf-category-item.active .cat-count { background: #d4f0e0; color: #03a850; }
.nbf-category-children { padding-left: 16px; }
.nbf-category-children .nbf-category-item { font-size: 0.85rem; }

.nbf-posts-area { flex: 1; min-width: 0; }

/* ── Post List ── */
.nbf-post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.nbf-post-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.nbf-post-card:hover {
  border-color: #03c75a;
  box-shadow: 0 4px 16px rgba(3,199,90,.15);
  transform: translateY(-2px);
}
.nbf-post-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #f5f5f5;
  display: block;
}
.nbf-post-thumb-placeholder {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 2rem;
}
.nbf-post-body { padding: 14px 16px; }
.nbf-post-category {
  font-size: 0.75rem;
  color: #03c75a;
  font-weight: 600;
  margin-bottom: 5px;
}
.nbf-post-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nbf-post-brief {
  font-size: 0.82rem;
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}
.nbf-post-meta {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  color: #aaa;
}
.nbf-post-meta span::before { margin-right: 3px; }

/* ── Post Viewer ── */
.nbf-post-viewer {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.nbf-post-viewer-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f0;
}
.nbf-post-viewer-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 10px;
  color: #1a1a2e;
  line-height: 1.4;
}
.nbf-post-viewer-meta {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: #888;
  flex-wrap: wrap;
  align-items: center;
}
.nbf-post-viewer-content {
  line-height: 1.8;
  font-size: 1rem;
  color: #333;
  word-break: break-word;
}
.nbf-post-viewer-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
}
.nbf-post-viewer-content p { margin: 0.8em 0; }
.nbf-post-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}

/* ── Progress ── */
.nbf-progress-box {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  text-align: center;
}
.nbf-progress-bar-wrap {
  background: #f0f0f0;
  border-radius: 20px;
  height: 10px;
  margin: 14px 0 8px;
  overflow: hidden;
}
.nbf-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #03c75a, #02a84b);
  border-radius: 20px;
  transition: width .4s;
}
.nbf-progress-text { font-size: 0.88rem; color: #666; }
.nbf-progress-count { font-weight: 700; color: #03c75a; }

/* ── Pagination ── */
.nbf-pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}
.nbf-page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #e0e0e0;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  color: #555;
  transition: all .15s;
}
.nbf-page-btn:hover { border-color: #03c75a; color: #03c75a; }
.nbf-page-btn.active { background: #03c75a; color: #fff; border-color: #03c75a; font-weight: 700; }
.nbf-page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Saved Blogs ── */
.nbf-saved-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.nbf-saved-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.nbf-saved-card-info h4 { margin: 0 0 4px; font-size: 1rem; color: #1a1a2e; }
.nbf-saved-card-info p { margin: 0; font-size: 0.82rem; color: #888; }
.nbf-saved-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Toast ── */
.nbf-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1a1a2e;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  animation: nbf-slide-in .3s ease;
  max-width: 320px;
}
.nbf-toast.success { background: #03c75a; }
.nbf-toast.error   { background: #ff4d4f; }
@keyframes nbf-slide-in {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Loading Spinner ── */
.nbf-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(3,199,90,.3);
  border-radius: 50%;
  border-top-color: #03c75a;
  animation: nbf-spin .7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes nbf-spin { to { transform: rotate(360deg); } }

.nbf-empty {
  text-align: center;
  padding: 48px 20px;
  color: #bbb;
}
.nbf-empty span { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.nbf-empty p { font-size: 0.95rem; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .nbf-category-panel { flex-direction: column; }
  .nbf-category-sidebar { width: 100%; max-height: 200px; }
  .nbf-post-viewer { padding: 20px 16px; }
  .nbf-search-row { flex-direction: column; }
  .nbf-search-row input[type="text"] { min-width: 100%; }
  .nbf-btn { width: 100%; }
}
