/* ============================================
   TOOLTS.COM — Global Design System
   Version: 1.0
   ============================================ */

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

/* ---------- CSS Variables ---------- */
:root {
  /* Backgrounds */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8FAFC;
  --bg-tool: #F1F5F9;
  --bg-tool-hover: #E2E8F0;
  
  /* Text */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;
  
  /* Brand */
  --brand: #2563EB;
  --brand-hover: #1D4ED8;
  --brand-light: #EFF6FF;
  --brand-dark: #1E40AF;
  --accent: #10B981;
  --accent-hover: #059669;
  --accent-light: #ECFDF5;
  
  /* Logo specific */
  --logo-highlight: #2563EB;
  --logo-text: #0F172A;
  
  /* Utility */
  --border: #E2E8F0;
  --border-focus: #2563EB;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  
  /* Typography */
  --font-display: 'DM Sans', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Layout */
  --max-width: 1120px;
  --header-height: 64px;
}

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-secondary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.25;
  font-weight: 700;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.375rem, 3vw, 1.875rem); letter-spacing: -0.02em; }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.375rem); letter-spacing: -0.015em; }
h4 { font-size: 1.125rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

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

strong { font-weight: 600; color: var(--text-primary); }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

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

.section {
  padding: var(--sp-16) 0;
}

.section-alt {
  background: var(--bg-secondary);
}

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

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

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
  color: var(--logo-text);
  transition: opacity 0.2s;
}
.logo:hover { opacity: 0.8; color: var(--logo-text); }
.logo .tt { color: var(--logo-highlight); }

/* Navigation */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  list-style: none;
}

.nav-links a {
  display: block;
  padding: var(--sp-2) var(--sp-4);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}
.nav-links a:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.nav-links a.active {
  color: var(--brand);
  background: var(--brand-light);
}

/* Mobile menu button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-2);
  color: var(--text-primary);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--text-primary);
  color: var(--text-muted);
  padding: var(--sp-12) 0 var(--sp-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--sp-10);
  margin-bottom: var(--sp-10);
}

.footer-brand .logo {
  color: var(--text-inverse);
  margin-bottom: var(--sp-4);
}
.footer-brand .logo .tt { color: #60A5FA; }

.footer-brand p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #94A3B8;
  max-width: 280px;
}

.footer-col h4 {
  color: var(--text-inverse);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-4);
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.footer-col a {
  color: #94A3B8;
  font-size: 0.875rem;
  transition: color 0.2s;
  text-decoration: none;
}
.footer-col a:hover { color: var(--text-inverse); }

.footer-bottom {
  border-top: 1px solid #1E293B;
  padding-top: var(--sp-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: #64748B;
}

.footer-bottom a {
  color: #64748B;
  text-decoration: none;
}
.footer-bottom a:hover { color: #94A3B8; }

/* ---------- Tool Card (Home page) ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-5);
}

.tool-card {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.tool-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tool-card-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-light);
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
}

.tool-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--sp-1);
}

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

/* ---------- Tool Page Layout ---------- */
.tool-hero {
  padding: var(--sp-8) 0 var(--sp-6);
  text-align: center;
}

.tool-hero h1 {
  margin-bottom: var(--sp-2);
}

.tool-hero .subtitle {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

.tool-area {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  margin-bottom: var(--sp-8);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--brand);
  color: var(--text-inverse);
}
.btn-primary:hover { background: var(--brand-hover); color: var(--text-inverse); }

.btn-accent {
  background: var(--accent);
  color: var(--text-inverse);
}
.btn-accent:hover { background: var(--accent-hover); color: var(--text-inverse); }

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

.btn-sm {
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.8125rem;
}

/* ---------- Form Elements ---------- */
textarea, input[type="text"], input[type="number"], select {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
textarea:focus, input[type="text"]:focus, input[type="number"]:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea {
  resize: vertical;
  line-height: 1.7;
}

/* ---------- SEO Content Section ---------- */
.seo-content {
  max-width: 768px;
  margin: 0 auto;
  padding: var(--sp-12) var(--sp-6);
}

.seo-content h2 {
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
}

.seo-content h3 {
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
}

.seo-content p {
  font-size: 1.0625rem;
  line-height: 1.8;
}

.seo-content ul, .seo-content ol {
  padding-left: var(--sp-6);
  margin-bottom: 1rem;
}

.seo-content li {
  margin-bottom: var(--sp-2);
  line-height: 1.7;
}

/* ---------- Related Tools ---------- */
.related-tools {
  background: var(--bg-secondary);
  padding: var(--sp-12) 0;
}

.related-tools h2 {
  text-align: center;
  margin-bottom: var(--sp-8);
}

/* ---------- Stats Row ---------- */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  justify-content: center;
}

.stat-box {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-6);
  text-align: center;
  min-width: 130px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: var(--sp-1);
}

/* ---------- FAQ Accordion ---------- */
.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: var(--sp-5) 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
}
.faq-question:hover { color: var(--brand); }

.faq-question .icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  transition: transform 0.3s;
}

.faq-item.open .faq-question .icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer-inner {
  padding-bottom: var(--sp-5);
  font-size: 1rem;
  line-height: 1.7;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  padding: var(--sp-3) 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs span { margin: 0 var(--sp-2); }

/* ---------- Copy Feedback ---------- */
.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: var(--text-inverse);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 999;
  pointer-events: none;
}
.copy-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  :root { --header-height: 56px; }
  
  .menu-toggle { display: block; }
  
  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: var(--sp-4) var(--sp-6);
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8);
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: var(--sp-3);
    text-align: center;
  }
  
  .tools-grid {
    grid-template-columns: 1fr;
  }
  
  .tool-area {
    padding: var(--sp-4);
    border-radius: var(--radius);
  }
  
  .stats-row {
    gap: var(--sp-3);
  }
  
  .stat-box {
    min-width: calc(50% - var(--sp-3));
    padding: var(--sp-3) var(--sp-4);
  }
}

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