/* ============================================
   ListFormat.tools — Global Styles
   Aesthetic: Clean utility, soft teal accent,
   editorial clarity, generous whitespace
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700&family=Space+Mono:wght@400;700&display=swap');

:root {
  /* Brand palette */
  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-200: #99f6e4;
  --teal-300: #5eead4;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --teal-800: #115e59;
  --teal-900: #134e4a;

  /* Neutrals */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Semantic */
  --bg: #ffffff;
  --bg-subtle: var(--gray-50);
  --bg-tool: #ffffff;
  --text: var(--gray-800);
  --text-muted: var(--gray-500);
  --text-heading: var(--gray-900);
  --accent: var(--teal-600);
  --accent-hover: var(--teal-700);
  --accent-light: var(--teal-50);
  --accent-border: var(--teal-200);
  --border: var(--gray-200);
  --border-focus: var(--teal-400);
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);

  /* Typography */
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Mono', 'Menlo', monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

main {
  flex: 1;
  padding: 40px 0 80px;
}

/* ---- Header / Nav ---- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.92);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  max-width: 1100px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.site-logo .logo-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--accent);
  background: var(--accent-light);
}

.lang-switch {
  margin-left: 8px;
  padding: 5px 10px !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lang-switch:hover {
  border-color: var(--accent-border) !important;
}

/* Mobile nav */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 700px) {
  .nav-toggle { display: block; }
  .header-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 24px;
    gap: 4px;
    box-shadow: var(--shadow-md);
  }
  .header-nav.open { display: flex; }
  .header-nav a { padding: 10px 12px; width: 100%; }
  .lang-switch { margin-left: 0; width: 100%; text-align: center; }
}

/* ---- Page Hero ---- */
.page-hero {
  text-align: center;
  margin-bottom: 36px;
  padding-top: 12px;
}

.page-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.page-hero h1 .accent {
  color: var(--accent);
}

.page-hero .subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ---- Tool Card ---- */
.tool-card {
  background: var(--bg-tool);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

/* ---- Options bar ---- */
.options-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  align-items: center;
}

.option-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.option-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.option-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.option-group select {
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}

.option-group select:focus {
  border-color: var(--border-focus);
}

.option-group input[type="text"] {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  width: 80px;
  outline: none;
  transition: border-color 0.15s;
}

.option-group input[type="text"]:focus {
  border-color: var(--border-focus);
}

/* ---- Textarea ---- */
.textarea-wrap {
  position: relative;
}

.textarea-wrap textarea {
  width: 100%;
  min-height: 180px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  color: var(--text);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.textarea-wrap textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.textarea-wrap textarea::placeholder {
  color: var(--gray-400);
}

.textarea-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: block;
}

.char-count {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 0.72rem;
  color: var(--gray-400);
  font-family: var(--font-mono);
  pointer-events: none;
}

/* ---- Buttons ---- */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-sm);
}

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

.btn-primary:active {
  transform: translateY(0);
}

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

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

/* Copy feedback */
.btn.copied {
  background: var(--teal-700) !important;
  color: white !important;
  border-color: var(--teal-700) !important;
}

/* Swap button */
.btn-swap {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

.btn-swap:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.btn-swap svg {
  width: 20px;
  height: 20px;
}

/* ---- Stats bar ---- */
.stats-bar {
  display: flex;
  gap: 20px;
  justify-content: center;
  padding: 12px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.stats-bar .stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stats-bar .stat-value {
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-mono);
}

/* ---- SEO Content Section ---- */
.seo-content {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.seo-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  margin-top: 40px;
}

.seo-content h2:first-child {
  margin-top: 0;
}

.seo-content p {
  color: var(--text);
  margin-bottom: 14px;
  max-width: 680px;
}

.seo-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--teal-800);
}

/* ---- FAQ ---- */
.faq-section {
  margin-top: 48px;
}

.faq-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 20px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}

.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s;
  color: var(--text-heading);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item summary:hover {
  background: var(--gray-50);
}

.faq-item .faq-answer {
  padding: 0 20px 16px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ---- Internal links section ---- */
.related-tools {
  margin-top: 48px;
  padding: 28px;
  background: var(--accent-light);
  border-radius: var(--radius);
  border: 1px solid var(--accent-border);
}

.related-tools h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 14px;
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.related-tool-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: white;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid var(--accent-border);
  transition: box-shadow 0.15s, transform 0.15s;
}

.related-tool-link:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.related-tool-link .tool-emoji {
  font-size: 1.2rem;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .page-hero h1 { font-size: 1.55rem; }
  .tool-card { padding: 20px 16px; }
  .options-bar { gap: 12px; }
  .btn-row { flex-direction: column; }
  .btn-row .btn { width: 100%; justify-content: center; }
  .stats-bar { flex-wrap: wrap; justify-content: center; }
  .textarea-wrap textarea { min-height: 140px; }
}

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

.tool-card {
  animation: fadeInUp 0.4s ease-out;
}

.page-hero {
  animation: fadeInUp 0.35s ease-out;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gray-800);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 1000;
}

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