/* Font Style - Global CSS Design System */

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

:root {
  --bg-primary: #F8FAFC;      /* Clean slate light gray background */
  --bg-surface: #FFFFFF;      /* Clean pure white cards and sections */
  --bg-elevated: #F1F5F9;     /* Light slate gray for inputs and buttons */
  --accent-primary: #6366F1;  /* Indigo accent color, very premium and modern */
  --accent-hover: #4F46E5;    /* Slightly darker indigo on hover */
  --accent-glow: rgba(99, 102, 241, 0.15);
  --border: #E2E8F0;          /* Soft border color */
  --border-focus: #CBD5E1;    /* Slightly darker border on focus */
  --text-primary: #0F172A;    /* Dark slate blue for primary text */
  --text-muted: #64748B;      /* Medium slate gray for muted text */
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;

  --navbar-bg: rgba(255, 255, 255, 0.85);
  --sticky-bg: rgba(255, 255, 255, 0.85);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-logo: 'Syne', sans-serif;
  --font-preview: 'Segoe UI Symbol', 'Segoe UI Historic', 'Cambria Math', 'STIX Two Math', 'STIXGeneral', 'Noto Sans Math', math, 'Segoe UI', Arial, sans-serif;
}

[data-theme="dark"] {
  --bg-primary: #0F172A;      /* Dark slate blue background */
  --bg-surface: #1E293B;      /* Slate blue surface */
  --bg-elevated: #334155;     /* Lighter slate blue for input/buttons */
  --accent-primary: #818CF8;  /* Lighter indigo for dark mode contrast */
  --accent-hover: #6366F1;    /* Accent hover */
  --accent-glow: rgba(129, 140, 248, 0.25);
  --border: #334155;          /* Darker border color */
  --border-focus: #475569;    /* Darker border focus */
  --text-primary: #F8FAFC;    /* Off-white text */
  --text-muted: #94A3B8;      /* Lighter gray text */

  --navbar-bg: rgba(30, 41, 59, 0.85);
  --sticky-bg: rgba(30, 41, 59, 0.85);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--accent-hover);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navbar */
.navbar {
  border-bottom: 1px solid var(--border);
  background: var(--navbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  z-index: 10;
  height: 70px;
  display: flex;
  align-items: center;
}
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 16px;
}
.logo {
  font-family: var(--font-logo);
  font-weight: 800;
  font-size: 1.45rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.logo-icon {
  display: block;
  flex-shrink: 0;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(124, 92, 248, 0.35);
  transition: box-shadow 0.2s, transform 0.2s;
}
.logo:hover .logo-icon {
  transform: rotate(-6deg) scale(1.08);
  box-shadow: 0 4px 18px rgba(124, 92, 248, 0.55);
}
.logo-word {
  color: var(--text-primary);
}
.logo-accent {
  background: linear-gradient(90deg, #7C5CF8, #B06EF3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.875rem;
  transition: color 0.15s ease, background 0.15s ease;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
}
.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.nav-links a.active {
  color: var(--accent-primary);
  background: var(--accent-glow);
  font-weight: 600;
}

/* Hamburger toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: 70px;
    left: 0; right: 0;
    background: var(--navbar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 20px;
    gap: 4px;
    z-index: 99;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 1rem;
  }
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 60px 0 30px;
}
.hero-title {
  font-family: var(--font-logo);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto 30px;
}

/* Tool Area */
.tool-container {
  max-width: 900px;
  margin: 0 auto 40px;
}
.input-wrapper {
  position: sticky;
  top: 0;
  z-index: 98;
  background: var(--bg-primary);
  padding: 10px 0 8px;
}
.main-input {
  width: 100%;
  height: 52px;
  min-height: 52px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0 24px;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-family: var(--font-sans);
  resize: none;
  line-height: 52px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  display: block;
}
.main-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--accent-glow), 0 4px 30px rgba(15, 23, 42, 0.12);
}

/* Counter & Info Row */
.input-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0 8px;
}
.char-counter {
  font-weight: 600;
  color: var(--text-primary);
}
.char-counter.warning {
  color: var(--warning);
  animation: counterPulse 1s infinite;
}
.char-counter.danger {
  color: var(--danger);
  animation: counterPulse 0.5s infinite;
}
@keyframes counterPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Filter Bars */
.filters-container {
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.filter-row::-webkit-scrollbar {
  height: 4px;
}
.filter-row::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.filter-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.platform-pill, .category-tab {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.platform-pill:hover, .category-tab:hover {
  border-color: var(--border-focus);
  color: var(--text-primary);
}
.platform-pill.active, .category-tab.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #FFF;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Font Results Container for Sectioned Layout */
.font-results-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 48px;
  margin-bottom: 60px;
}

/* Font Cards Grid */
.font-results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 768px) {
  .font-results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .font-results-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.font-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  min-height: 140px;
  min-width: 0; /* Critical fix for grid-child sizing */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  animation: cardFadeIn 0.3s ease-out both;
  animation-delay: calc(var(--card-index) * 0.03s);
}
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.font-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-focus);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.style-name {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.heart-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: color 0.15s, transform 0.15s;
}
.heart-btn:hover {
  color: var(--danger);
  transform: scale(1.1);
}
.heart-btn.active {
  color: var(--danger);
}
.heart-btn.active .heart-icon {
  animation: heartPop 0.3s ease;
  fill: var(--danger);
}
@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.font-preview {
  font-family: var(--font-preview);
  font-size: 1.35rem;
  color: var(--text-primary);
  word-break: break-all;
  overflow-wrap: anywhere;
  line-break: anywhere;
  user-select: all;
  min-height: 36px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.copy-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.copy-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-glow);
}
.compatibility-badges {
  font-size: 0.95rem;
  display: flex;
  gap: 6px;
}

/* Toast Notification */
.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--accent-primary);
  color: #FFF;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.4);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s ease;
  opacity: 0;
  z-index: 1000;
}
.copy-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Info Content Section (SEO Text) */
.info-section {
  padding: 60px 0;
  border-top: 1px solid var(--border);
  background: rgba(241, 245, 249, 0.6);
}
.info-grid {
  max-width: 800px;
  margin: 0 auto;
}
.info-title {
  font-family: var(--font-logo);
  font-size: 2rem;
  margin-bottom: 24px;
  text-align: center;
}
.info-paragraph {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 1.05rem;
  line-height: 1.7;
}
.info-h2 {
  font-family: var(--font-logo);
  font-size: 1.5rem;
  margin: 36px 0 16px;
}
.info-list {
  list-style: none;
  margin-bottom: 24px;
}
.info-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 12px;
  color: var(--text-muted);
}
.info-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-weight: bold;
}

/* Accordion FAQs */
.faq-accordion {
  margin-top: 30px;
}
.faq-item {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-question {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 18px 20px;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-answer {
  padding: 0 20px 18px;
  color: var(--text-muted);
  display: none;
}
.faq-item.active .faq-answer {
  display: block;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 48px 0 28px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
  align-items: start;
}
@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
}
.footer-brand .logo {
  font-size: 1.3rem;
  margin-bottom: 12px;
}
.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 240px;
}
.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 9px;
  transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--accent-primary); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
}
.footer-bottom-links {
  display: flex;
  gap: 20px;
}
.footer-bottom-links a {
  color: var(--text-muted);
}
.footer-bottom-links a:hover { color: var(--accent-primary); }


/* Homepage Category Sections */
.homepage-category-section {
  margin-bottom: 56px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
}
.category-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
}
.category-section-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.category-section-title {
  font-family: var(--font-logo);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.category-section-divider {
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary) 0%, rgba(124, 58, 237, 0) 100%);
  border: none;
  margin-top: 4px;
}
.see-all-category-link {
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s ease;
  margin-bottom: 4px;
}
.see-all-category-link:hover {
  opacity: 0.8;
}
.see-all-category-btn-container {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}
.see-all-category-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 24px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}
.see-all-category-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
  color: #FFF;
}

/* Go-to category button — shown at top right of each category section */
.goto-category-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary, #7c3aed));
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 2px 8px var(--accent-glow, rgba(99,102,241,0.35));
  letter-spacing: 0.01em;
}
.goto-category-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow, rgba(99,102,241,0.5));
  opacity: 0.92;
}

/* Accessibility reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Sticky Input Bar */
.sticky-input-bar {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: var(--sticky-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  z-index: 99;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  padding: 10px 0;
}
.sticky-input-bar.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.sticky-input-container {
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.sticky-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sticky-input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--accent-glow), 0 2px 15px rgba(99, 102, 241, 0.08);
}
.sticky-sparkle {
  color: var(--accent-primary);
  font-size: 1.1rem;
  margin-right: 10px;
}
#sticky-text-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  padding: 10px 0;
  font-size: 1.05rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
}
.sticky-char-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 10px;
  white-space: nowrap;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease, transform 0.15s ease;
  padding: 0;
  margin-left: 16px;
  flex-shrink: 0;
}
.theme-toggle-btn:hover {
  background: var(--border);
  transform: scale(1.05);
}
.theme-toggle-btn svg {
  transition: transform 0.3s ease;
}
.theme-toggle-btn:active svg {
  transform: rotate(30deg);
}

/* Toggle Sun/Moon display */
.theme-toggle-btn .sun-icon {
  display: none;
}
.theme-toggle-btn .moon-icon {
  display: block;
}
[data-theme="dark"] .theme-toggle-btn .sun-icon {
  display: block;
}
[data-theme="dark"] .theme-toggle-btn .moon-icon {
  display: none;
}

/* Fix white text in category page input textareas */
.cat-input-bar textarea {
  color: var(--text-primary) !important;
}

/* Sticky text input bar — category pages */
.cat-input-bar {
  position: sticky;
  top: 0;
  z-index: 98;
  background: var(--bg-primary);
  padding: 10px 0;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  padding: 0 16px;
  height: 52px;
  background: var(--bg-surface);
  box-shadow: 0 2px 12px rgba(15,23,42,0.06);
  margin-bottom: 24px;
}
.cat-input-bar textarea {
  flex: 1;
  background: transparent !important;
  border: none !important;
  outline: none;
  color: var(--text-primary) !important;
  font-size: 1.05rem;
  font-family: var(--font-sans);
  resize: none;
  height: 100%;
  padding: 0;
  line-height: 52px;
}
.cat-input-bar .char-info {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
}
