/* ==========================================================
   FancyFontsCopy.com - Global Styles
   Clean, modern, mobile-first design
   Zero external dependencies
   ========================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-primary: #6c5ce7;
  --color-primary-dark: #5b4cdb;
  --color-primary-light: #a29bfe;
  --color-secondary: #00cec9;
  --color-accent: #fd79a8;
  --color-bg: #f8f9ff;
  --color-bg-white: #ffffff;
  --color-text: #2d3436;
  --color-text-light: #636e72;
  --color-text-lighter: #b2bec3;
  --color-border: #e0e3f1;
  --color-success: #00b894;
  --color-header-bg: #1a1a2e;
  --color-header-text: #ffffff;
  --color-card-bg: #ffffff;
  --color-card-hover: #f4f3ff;
  --gradient-primary: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 50%, #00cec9 100%);
  --gradient-hero: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --max-width: 1200px;
  --header-height: 64px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-stack);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.main-content {
  flex: 1;
  padding: 32px 0;
}

/* --- Header --- */
.site-header {
  background: var(--color-header-bg);
  color: var(--color-header-text);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-logo:hover {
  color: var(--color-primary-light);
  text-decoration: none;
}

.logo-icon {
  font-size: 1.5rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  color: rgba(255,255,255,0.85);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.main-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
  text-decoration: none;
}

.main-nav a.active {
  color: #fff;
  background: var(--color-primary);
}

#mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
}

/* --- Hero / Tool Input Section --- */
.tool-hero {
  background: var(--gradient-hero);
  padding: 48px 0 40px;
  color: #fff;
  text-align: center;
}

.tool-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.2;
}

.tool-hero .subtitle {
  font-size: 1.1rem;
  opacity: 0.8;
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.5;
}

.input-wrapper {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

#text-input {
  width: 100%;
  min-height: 120px;
  padding: 20px;
  font-size: 1.1rem;
  font-family: var(--font-stack);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.1);
  color: #fff;
  resize: vertical;
  transition: border-color 0.3s, background 0.3s;
  line-height: 1.6;
}

#text-input::placeholder {
  color: rgba(255,255,255,0.4);
}

#text-input:focus {
  outline: none;
  border-color: var(--color-primary-light);
  background: rgba(255,255,255,0.15);
}

.input-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

#char-count {
  font-size: 0.85rem;
  opacity: 0.6;
}

#btn-clear {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

#btn-clear:hover {
  background: rgba(255,255,255,0.25);
}

/* --- Filter Tabs --- */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 0;
  justify-content: center;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 24px;
}

.filter-tab {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-light);
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.filter-tab:hover {
  color: var(--color-primary);
  border-color: var(--color-primary-light);
  text-decoration: none;
}

.filter-tab.active {
  color: #fff;
  background: var(--color-primary);
  border-color: var(--color-primary);
}

/* --- Font Cards --- */
.font-preview-grid {
  display: grid;
  gap: 16px;
}

.category-header {
  margin-top: 20px;
  margin-bottom: 4px;
}

.category-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.font-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s;
}

.font-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.font-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.font-card-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.font-card-body {
  padding: 16px;
  font-size: 1.15rem;
  line-height: 1.8;
  word-break: break-word;
  color: var(--color-text);
  min-height: 56px;
  cursor: text;
  user-select: all;
  -webkit-user-select: all;
}

.font-card-body-large {
  font-size: 1.4rem;
  padding: 24px;
  min-height: 80px;
}

.font-card-large {
  border-width: 2px;
}

/* --- Copy Button --- */
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-primary);
  background: transparent;
  border: 1.5px solid var(--color-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: var(--font-stack);
}

.btn-copy:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn-copy.copied {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}

.btn-copy svg {
  flex-shrink: 0;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-lighter);
}

.empty-state p {
  font-size: 1.1rem;
}

/* --- SEO Content Sections --- */
.seo-content {
  max-width: 800px;
  margin: 48px auto 0;
  padding: 40px;
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.seo-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--color-text);
}

.seo-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--color-text);
}

.seo-content p {
  margin-bottom: 16px;
  line-height: 1.7;
  color: var(--color-text-light);
}

.seo-content ul, .seo-content ol {
  margin: 0 0 16px 20px;
  line-height: 1.8;
  color: var(--color-text-light);
}

.seo-content a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* --- FAQ Section --- */
.faq-section {
  max-width: 800px;
  margin: 32px auto 0;
}

.faq-section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

.faq-item {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 18px 20px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-stack);
}

.faq-question::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--color-primary);
  transition: transform 0.3s;
}

.faq-item.open .faq-question::after {
  content: '\2212';
}

.faq-answer {
  display: none;
  padding: 0 20px 18px;
  color: var(--color-text-light);
  line-height: 1.7;
}

.faq-item.open .faq-answer {
  display: block;
}

/* --- Internal Link Cards --- */
.related-tools {
  margin-top: 40px;
}

.related-tools h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.tool-link-card {
  display: block;
  padding: 20px;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s;
}

.tool-link-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  transform: translateY(-2px);
}

.tool-link-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.tool-link-card p {
  font-size: 0.85rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

/* --- Hub Pages --- */
.hub-hero {
  background: var(--gradient-hero);
  padding: 48px 0;
  color: #fff;
  text-align: center;
}

.hub-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.hub-hero p {
  font-size: 1.1rem;
  opacity: 0.8;
  max-width: 600px;
  margin: 0 auto;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.hub-card {
  display: block;
  padding: 28px;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all 0.25s;
}

.hub-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  transform: translateY(-3px);
}

.hub-card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.hub-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.hub-card p {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

/* --- Guide Pages --- */
.guide-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px;
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.guide-content h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.guide-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 32px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.guide-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 20px 0 8px;
}

.guide-content p {
  margin-bottom: 16px;
  line-height: 1.8;
  color: var(--color-text-light);
}

.guide-content ul, .guide-content ol {
  margin: 0 0 16px 24px;
  line-height: 1.8;
  color: var(--color-text-light);
}

.guide-content code {
  background: var(--color-bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
}

.guide-content blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 12px 20px;
  margin: 16px 0;
  background: var(--color-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-text-light);
  font-style: italic;
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  padding: 12px 0;
  font-size: 0.85rem;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 4px;
}

.breadcrumbs li:not(:last-child)::after {
  content: '\203A';
  color: var(--color-text-lighter);
  margin-left: 4px;
}

.breadcrumbs a {
  color: var(--color-text-light);
}

.breadcrumbs a:hover {
  color: var(--color-primary);
}

.breadcrumbs span {
  color: var(--color-text-lighter);
}

/* --- Footer --- */
.site-footer {
  background: var(--color-header-bg);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 24px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.footer-col h4 {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 8px;
}

.footer-col a {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #fff;
  text-decoration: none;
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
}

/* --- 404 Page --- */
.error-page {
  text-align: center;
  padding: 80px 20px;
}

.error-page h1 {
  font-size: 6rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 16px;
}

.error-page h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.error-page p {
  color: var(--color-text-light);
  margin-bottom: 24px;
}

.btn-primary {
  display: inline-block;
  padding: 12px 28px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .main-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-header-bg);
    flex-direction: column;
    padding: 20px;
    gap: 4px;
    z-index: 99;
    overflow-y: auto;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 14px 16px;
    font-size: 1rem;
  }

  #mobile-menu-toggle {
    display: block;
  }

  .tool-hero {
    padding: 32px 0 28px;
  }

  .tool-hero h1 {
    font-size: 1.6rem;
  }

  .tool-hero .subtitle {
    font-size: 0.95rem;
  }

  #text-input {
    min-height: 100px;
    font-size: 1rem;
    padding: 16px;
  }

  .filter-tabs {
    gap: 6px;
    padding: 14px 0;
  }

  .filter-tab {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .font-card-body {
    font-size: 1rem;
    padding: 12px;
  }

  .font-card-body-large {
    font-size: 1.15rem;
    padding: 16px;
  }

  .seo-content, .guide-content {
    padding: 24px 20px;
    margin-left: 0;
    margin-right: 0;
    border-radius: var(--radius-md);
  }

  .seo-content h2, .guide-content h1 {
    font-size: 1.4rem;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .hub-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .hub-hero h1 {
    font-size: 1.6rem;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .tool-hero h1 {
    font-size: 1.35rem;
  }

  .font-card-header {
    padding: 10px 12px;
  }

  .btn-copy {
    padding: 5px 10px;
    font-size: 0.78rem;
  }
}

/* --- FAQ Script --- */
/* Handles in inline script on each page for FAQ toggle */

/* --- Print --- */
@media print {
  .site-header, .site-footer, .filter-tabs, .input-wrapper, .input-controls,
  .btn-copy, .related-tools, #mobile-menu-toggle {
    display: none !important;
  }

  .font-card {
    break-inside: avoid;
    border: 1px solid #ccc;
  }
}

/* --- Accessibility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

*:focus-visible {
  outline: 3px solid var(--color-primary-light);
  outline-offset: 2px;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.font-card {
  animation: fadeIn 0.3s ease both;
}

.font-card:nth-child(n+5) {
  animation-delay: 0.05s;
}

.font-card:nth-child(n+10) {
  animation-delay: 0.1s;
}
