/* === KJH Nexus Dashboard Styles === */

/* Page background */
.nx-main { background: #F5F8FC; }

/* Auth loading state */
body.auth-loading .nx-main,
body.auth-loading .cc-nav-right { visibility: hidden; }

/* === Compact Hero === */
.nx-hero-compact {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  padding: 18px 24px;
}
.nx-hero-compact h1 {
  font-size: 24px; font-weight: 900;
  color: white; letter-spacing: -0.02em;
  text-align: center;
}
.nx-hero-link {
  display: inline-block;
  margin-left: 16px;
  padding: 4px 14px;
  font-size: 12px; font-weight: 600;
  color: white; text-decoration: none;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 100px;
  letter-spacing: 0;
  vertical-align: middle;
  transition: all 0.2s ease;
}
.nx-hero-link:hover {
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.5);
  transform: translateY(-1px);
}

/* === Nav Menus === */
.nx-nav-menus {
  display: flex; gap: 8px; align-items: center;
}
.nx-nav-dropdown {
  position: relative;
}
.nx-nav-pill {
  padding: 7px 18px; border-radius: 100px;
  font-size: 13px; font-weight: 700;
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1.5px solid transparent;
  cursor: pointer; transition: all 0.2s;
  white-space: nowrap; font-family: inherit;
}
.nx-nav-pill:hover { background: var(--gray-200); color: var(--gray-700); }

/* 고객시연 메뉴 — 노란색 강조 */
a.nx-nav-pill-demo,
.nx-nav-pill-demo {
  background: #FEF08A !important;
  color: #713F12 !important;
  border-color: #FACC15 !important;
  text-decoration: none;
  display: inline-flex; align-items: center;
  box-shadow: 0 1px 4px rgba(250, 204, 21, 0.25);
}
a.nx-nav-pill-demo:hover,
.nx-nav-pill-demo:hover {
  background: #FDE047 !important;
  color: #422006 !important;
  box-shadow: 0 2px 8px rgba(250, 204, 21, 0.4);
  transform: translateY(-1px);
}
.nx-nav-dropdown-menu {
  display: none; position: absolute;
  top: 100%; left: 50%; transform: translateX(-50%);
  min-width: 240px; max-height: 80vh; overflow-y: auto;
  padding-top: 8px; z-index: 300;
}
.nx-nav-dropdown:hover .nx-nav-dropdown-menu { display: block; }
.nx-nav-dropdown-menu-inner {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: 6px 0;
  overflow: hidden;
}
.nx-nav-dropdown-item {
  display: block; padding: 10px 18px;
  font-size: 13px; font-weight: 600;
  color: var(--gray-700);
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.nx-nav-dropdown-item:hover {
  background: #FFF9C4; color: var(--black);
}
.nx-nav-dropdown-right {
  left: auto; right: 0; transform: none;
}
.nx-nav-dropdown-label {
  padding: 8px 18px 4px;
  font-size: 11px; font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.nx-nav-dropdown-label:not(:first-child) {
  border-top: 1px solid var(--gray-100);
  margin-top: 4px; padding-top: 10px;
}

/* === Tools Section === */
.nx-tools-section {
  max-width: var(--max-w); margin: 0 auto;
  padding: 8px 24px 24px;
}

/* Reduce section padding on dashboard */
.nx-main .cc-section {
  padding-top: 32px;
  padding-bottom: 24px;
}

/* === Group Header === */
.nx-group-header {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 28px; margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gray-200);
}
.nx-group-header h3 {
  font-size: 1.1rem; font-weight: 800;
  color: var(--black);
  display: flex; align-items: center; gap: 10px;
}
.nx-group-count {
  font-size: 0.75rem; font-weight: 600;
  color: var(--gray-400);
  background: var(--gray-100);
  border-radius: 10px; padding: 2px 10px;
}

/* === App Card === */
.nx-app-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none; color: inherit;
  display: flex; align-items: center; gap: 12px;
}
.nx-app-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-color: #D32F2F;
  background: #FFF9C4;
}
.nx-app-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.nx-app-info { flex: 1; min-width: 0; }
.nx-app-name {
  font-size: 0.875rem; font-weight: 700;
  color: var(--black); letter-spacing: -0.01em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nx-app-desc {
  margin-top: 3px; font-size: 0.75rem;
  color: var(--gray-500); line-height: 1.4;
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}

/* Icon background - uniform */
.nx-app-icon { background: #EBF5FF; }

/* === Category Sections (KJH_tools) === */
.nx-cat-section { border-radius: 12px; margin-bottom: 16px; overflow: hidden; border: 1px solid var(--gray-200); grid-column: 1 / -1; }
.nx-cat-header { padding: 12px 18px; font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.nx-cat-header .nx-group-count { font-weight: 400; font-size: 12px; color: var(--gray-400); margin-left: 4px; }

/* AI 도구 — 파란/보라 */
.nx-cat-ai-tool { border-color: #c7d2fe; }
.nx-cat-ai-tool .nx-cat-header { background: linear-gradient(135deg, #eef2ff, #e0e7ff); color: #3730a3; }
.nx-cat-ai-tool .nx-app-card { border-left: 3px solid #6366f1; }
.nx-cat-ai-tool .nx-app-icon { background: #e0e7ff; }

/* 마케팅/광고 — 초록/빨강 */
.nx-cat-marketing { border-color: #bbf7d0; }
.nx-cat-marketing .nx-cat-header { background: linear-gradient(135deg, #ecfdf5, #f0fdf4); color: #065f46; }
.nx-cat-marketing .nx-app-card { border-left: 3px solid #10b981; }
.nx-cat-marketing .nx-app-icon { background: #d1fae5; }

/* 교육 관리 — 노랑/주황 */
.nx-cat-edu-mgmt { border-color: #fde68a; }
.nx-cat-edu-mgmt .nx-cat-header { background: linear-gradient(135deg, #fffbeb, #fef3c7); color: #92400e; }
.nx-cat-edu-mgmt .nx-app-card { border-left: 3px solid #f59e0b; }
.nx-cat-edu-mgmt .nx-app-icon { background: #fef3c7; }

/* 업무 도구 — 네이비/회색 */
.nx-cat-biz-tool { border-color: #cbd5e1; }
.nx-cat-biz-tool .nx-cat-header { background: linear-gradient(135deg, #f1f5f9, #e2e8f0); color: #334155; }
.nx-cat-biz-tool .nx-app-card { border-left: 3px solid #64748b; }
.nx-cat-biz-tool .nx-app-icon { background: #e2e8f0; }

/* 시연용 섹션 */
.nx-cat-fav { border-color: #ef4444; background: linear-gradient(135deg, #fef2f2, #fee2e2); }
.nx-cat-fav .nx-cat-header { background: linear-gradient(135deg, #fecaca, #fca5a5); color: #7f1d1d; font-size: 16px; }
.nx-fav-card { border: 2px solid #ef4444 !important; box-shadow: 0 2px 12px rgba(239,68,68,.12); border-left: 3px solid #ef4444 !important; }
.nx-fav-card:hover { border-color: #dc2626 !important; box-shadow: 0 4px 16px rgba(239,68,68,.2); }

/* Group header icon */
.nx-group-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

/* === Link Card === */
.nx-link-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  text-decoration: none; color: inherit;
  transition: all 0.2s;
  cursor: pointer;
}
.nx-link-card:hover {
  background: var(--gray-50);
  border-color: var(--accent);
  padding-left: 24px;
}
.nx-link-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.nx-link-info { flex: 1; min-width: 0; }
.nx-link-name {
  font-size: 0.9rem; font-weight: 700;
  color: var(--black);
}
.nx-link-url {
  font-size: 0.72rem; color: var(--gray-400);
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.nx-link-admin {
  font-size: 0.7rem; font-weight: 600;
  color: var(--accent);
  padding: 2px 8px; border-radius: 4px;
  background: var(--accent-bg);
  white-space: nowrap;
}
.nx-link-arrow {
  color: var(--gray-300); font-size: 1.2rem;
  transition: color 0.2s;
}
.nx-link-card:hover .nx-link-arrow { color: var(--accent); }

/* === Stats (Hero inner) === */
.nx-stats {
  display: flex; gap: 0;
  margin-top: 28px;
  background: rgba(255,255,255,0.05);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 16px 0 0;
}
.nx-stat {
  flex: 1; text-align: center; padding: 8px 0 12px;
}
.nx-stat + .nx-stat {
  border-left: 1px solid rgba(255,255,255,0.08);
}
.nx-stat-num {
  font-size: 1.5rem; font-weight: 900;
  color: white;
}
.nx-stat-label {
  font-size: 0.7rem; color: rgba(255,255,255,0.4);
  margin-top: 2px;
}

/* === Tool Header (inside tools) === */
.nx-tool-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--gray-100);
}
.nx-back {
  font-size: 0.82rem; font-weight: 700;
  color: var(--accent);
  display: flex; align-items: center; gap: 4px;
  text-decoration: none;
}
.nx-back::before {
  content: ''; display: block;
  width: 6px; height: 6px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.nx-tool-title {
  font-size: 0.9rem; font-weight: 600;
  color: var(--gray-600);
}

/* === Empty State === */
.nx-empty {
  text-align: center; padding: 60px 24px;
  color: var(--gray-400);
}
.nx-empty-icon { font-size: 3rem; margin-bottom: 16px; }
.nx-empty-text { font-size: 0.95rem; }

/* === Link Grid === */
.nx-link-grid {
  display: grid; grid-template-columns: 1fr; gap: 8px;
}
@media (min-width: 640px) {
  .nx-link-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .nx-link-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* === Profile === */
.nx-profile {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; position: relative;
}
.nx-profile-img {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  display: none;
}
.nx-profile-menu {
  display: none; position: absolute;
  top: 100%; right: 0;
  min-width: 160px; padding-top: 8px; z-index: 300;
}
.nx-profile-menu-inner {
  background: var(--white); border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  padding: 8px 0;
  border: 1px solid var(--gray-100);
}
.nx-profile:hover .nx-profile-menu { display: block; }
.nx-profile-menu a, .nx-profile-menu button {
  display: block; width: 100%;
  padding: 10px 20px; text-align: left;
  font-size: 14px; font-weight: 600;
  color: var(--gray-600); background: none;
  border: none; cursor: pointer; font-family: inherit;
}
.nx-profile-menu a:hover, .nx-profile-menu button:hover {
  background: #fef9c3; color: var(--black);
}

/* === Keyboard shortcut hint === */
.nx-kbd {
  display: inline-flex; align-items: center;
  padding: 2px 6px; border-radius: 4px;
  font-size: 0.7rem; font-weight: 600;
  background: var(--gray-100); color: var(--gray-400);
  border: 1px solid var(--gray-200);
  margin-left: 8px;
}

/* === Section divider === */
.nx-divider {
  height: 1px; background: var(--gray-100);
  max-width: var(--max-w); margin: 0 auto;
}

/* === Responsive === */
@media (max-width: 767px) {
  .nx-filters { margin-top: -20px; padding: 0 16px; }
  .nx-search-wrap { padding: 0 16px; }
  .nx-search-icon { left: 32px; }
}
