*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --nf-bg: #f5f5f7;
  --nf-card: #ffffff;
  --nf-border: #e1e1e6;
  --nf-text: #111827;
  --nf-muted: #6b7280;
  --nf-primary: #2563eb;
  --nf-primary-soft: #dbeafe;
  --nf-danger: #ef4444;
  --nf-radius-lg: 16px;
  --nf-radius-md: 12px;
  --nf-shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.12);
  --nf-max-width: 960px;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #eef2ff 0, #f9fafb 40%, #f5f5f7 100%);
  color: var(--nf-text);
}

/* Header */

.nf-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: rgba(249, 250, 251, 0.86);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

.nf-header-inner {
  max-width: var(--nf-max-width);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nf-logo {
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.nf-nav {
  display: flex;
  gap: 0.5rem;
}

.nf-link-button {
  border: none;
  background: transparent;
  font-size: 0.9rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  color: var(--nf-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.nf-link-button:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--nf-text);
}

/* Main */

.nf-main {
  max-width: var(--nf-max-width);
  margin: 1.5rem auto 3rem;
  padding: 0 1rem 2rem;
}

/* Hero */

.nf-hero {
  text-align: center;
  margin-bottom: 1.5rem;
}

.nf-hero h1 {
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
}

.nf-hero-subtitle {
  margin: 0;
  color: var(--nf-muted);
  font-size: 0.95rem;
}

/* Input section */

.nf-input-section {
  background: var(--nf-card);
  border-radius: var(--nf-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--nf-shadow-soft);
  border: 1px solid rgba(226, 232, 240, 0.9);
  margin-bottom: 1.5rem;
}

.nf-input-group {
  margin-bottom: 1rem;
}

.nf-input-group label,
.nf-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--nf-muted);
}

.nf-input-group input[type="text"] {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--nf-border);
  font-size: 0.95rem;
  outline: none;
  background-color: #f9fafb;
  transition: border 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.nf-input-group input[type="text"]:focus {
  border-color: var(--nf-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
  background-color: #ffffff;
}

/* Pills */

.nf-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.nf-pill {
  border-radius: 999px;
  border: 1px solid var(--nf-border);
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  background: #f9fafb;
  cursor: pointer;
  color: var(--nf-muted);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    transform 0.05s;
}

.nf-pill:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #111827;
}

.nf-pill-active {
  background: var(--nf-primary-soft);
  border-color: var(--nf-primary);
  color: #1d4ed8;
  font-weight: 600;
}

/* Input buttons */

.nf-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.nf-primary-button,
.nf-secondary-button {
  border-radius: 999px;
  padding: 0.55rem 1.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: transform 0.04s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.nf-primary-button {
  background: #111827;
  color: #f9fafb;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
}

.nf-primary-button:hover {
  background: #020617;
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.45);
}

.nf-primary-button:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.nf-secondary-button {
  background: #e5e7eb;
  color: #111827;
}

.nf-secondary-button:hover:not(:disabled) {
  background: #d1d5db;
}

.nf-secondary-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.nf-status-text {
  font-size: 0.85rem;
  color: var(--nf-muted);
}

/* Results */

.nf-results-section {
  margin-top: 1.5rem;
}

.nf-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.9rem;
}

.nf-result-card {
  background: var(--nf-card);
  border-radius: var(--nf-radius-md);
  padding: 0.9rem 0.95rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  animation: fadeInUp 0.35s ease both;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nf-result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.13);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Skeleton loading */

.nf-skeleton-card {
  animation: fadeInUp 0.3s ease both;
}

.nf-skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.nf-result-name {
  font-weight: 600;
  font-size: 1rem;
}

.nf-result-meaning {
  font-size: 0.85rem;
  color: var(--nf-muted);
}

.nf-result-meta {
  font-size: 0.78rem;
  color: #9ca3af;
}

.nf-result-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.nf-result-buttons {
  display: flex;
  gap: 0.35rem;
}

.nf-chip-button {
  border-radius: 999px;
  border: 1px solid var(--nf-border);
  padding: 0.22rem 0.55rem;
  font-size: 0.78rem;
  background: #f9fafb;
  cursor: pointer;
  color: var(--nf-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  transition: background 0.15s ease, border 0.15s ease, color 0.15s ease;
}

.nf-chip-button:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #111827;
}

.nf-chip-button.primary {
  border-color: var(--nf-primary);
  background: var(--nf-primary-soft);
  color: #1d4ed8;
}

.nf-chip-button.danger {
  border-color: var(--nf-danger);
  color: var(--nf-danger);
}

.nf-more-wrapper {
  margin-top: 1.2rem;
  display: flex;
  justify-content: center;
}

/* SEO section */

.nf-seo-section {
  margin-top: 2.5rem;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--nf-radius-lg);
  padding: 1.5rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.nf-seo-section h2 {
  font-size: 1.1rem;
  margin-top: 0;
}

.nf-seo-section p,
.nf-seo-section li {
  font-size: 0.9rem;
  color: var(--nf-muted);
}

.nf-seo-section ul {
  padding-left: 1.2rem;
}

.nf-faq-item {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

/* Modal */

.nf-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 30;
}

.hidden {
  display: none !important;
}

.nf-modal {
  background: #ffffff;
  border-radius: 18px;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--nf-shadow-soft);
}

.nf-modal-header {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--nf-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nf-modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.nf-icon-button {
  border-radius: 999px;
  border: none;
  background: #f3f4f6;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
}

.nf-icon-button:hover {
  background: #e5e7eb;
}

.nf-modal-body {
  padding: 0.9rem 1.1rem 1.1rem;
  overflow: auto;
}

.nf-empty-text {
  font-size: 0.9rem;
  color: var(--nf-muted);
}

/* Footer */

.nf-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* Responsive */

@media (max-width: 640px) {
  .nf-input-section {
    padding: 1.1rem;
  }

  .nf-hero h1 {
    font-size: 1.7rem;
  }

  .nf-header-inner {
    padding: 0.55rem 1rem;
  }
}
