/* ============================================================
   Font Picker — Fancy Text Generator
   Colors: #2563eb primary, #f59e0b secondary, #f8fafc bg, #1e293b text
   ============================================================ */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #f59e0b;
  --secondary-hover: #d97706;
  --bg: #f8fafc;
  --text: #1e293b;
  --text-light: #64748b;
  --white: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

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

/* --- Header --- */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.lang-switch {
  display: flex;
  gap: 0.25rem;
}

.lang-btn {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.lang-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.lang-btn:hover:not(.active) {
  background: #f1f5f9;
}

/* --- Main --- */
main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

/* --- Hero --- */
.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.hero h1 .fancy {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* --- Input Section --- */
.input-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.input-section label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text);
}

#text-input {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.15rem;
  font-family: var(--font);
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
  min-height: 60px;
  outline: none;
  color: var(--text);
  background: var(--bg);
}

#text-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

#text-input::placeholder {
  color: #94a3b8;
}

.char-count {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.35rem;
}

.actions-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* --- Font Grid --- */
.font-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.font-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}

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

.font-card:active {
  transform: translateY(0);
}

.font-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.font-card-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
}

.copy-badge {
  font-size: 0.7rem;
  background: #dcfce7;
  color: #166534;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
}

.copy-badge.visible {
  opacity: 1;
}

.font-card-preview {
  font-size: 1.3rem;
  line-height: 1.4;
  word-break: break-word;
  min-height: 1.6em;
  color: var(--text);
  display: flex;
  align-items: center;
}

.font-card-preview.empty {
  color: #cbd5e1;
  font-style: italic;
  font-size: 0.95rem;
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1e293b;
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Footer --- */
footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 2.5rem 1.5rem 1.5rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}

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

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.footer-col a {
  display: block;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  padding: 0.3rem 0;
  transition: color 0.2s;
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
}

.footer-bottom a {
  color: var(--primary);
  text-decoration: none;
}

.footer-bottom a:hover {
  text-decoration: underline;
}

/* --- Legal Pages --- */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
}

.legal-page h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.legal-page h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.legal-page p {
  margin-bottom: 1rem;
  color: var(--text);
  line-height: 1.7;
}

.legal-page ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.legal-page li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

.legal-page address {
  font-style: normal;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  line-height: 1.6;
}

/* --- AdSense --- */
.adsense-container {
  text-align: center;
  margin: 1.5rem 0;
  min-height: 90px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.85rem;
  padding: 1rem;
}

/* --- Responsive --- */
@media (min-width: 640px) {
  .font-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero h1 {
    font-size: 2.75rem;
  }
}

@media (min-width: 900px) {
  .font-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .hero h1 {
    font-size: 3rem;
  }
}

@media (max-width: 480px) {
  .header-inner {
    flex-wrap: wrap;
    justify-content: center;
  }
  .hero h1 {
    font-size: 1.6rem;
  }
  .font-card-preview {
    font-size: 1.05rem;
  }
  .input-section {
    padding: 1rem;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
/* ─── Footer inline layout ──────────────────────────── */
footer .cross-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.5rem;
  padding: 1rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}
footer .cross-links strong {
  color: #e2e8f0;
  font-weight: 600;
  margin-right: 0.25rem;
}
footer .cross-links a {
  color: #93c5fd;
  text-decoration: none;
  white-space: nowrap;
}
footer .cross-links a:hover {
  color: #fff;
  text-decoration: underline;
}
footer .footer-bottom {
  text-align: center;
  padding: 1rem 0 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}
footer .footer-bottom h4 {
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
footer .legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.75rem;
  font-size: 0.85rem;
}
footer .legal-links a {
  color: #64748b;
  text-decoration: none;
}
footer .legal-links a:hover {
  color: #fff;
  text-decoration: underline;
}
