/* ============================================================
   Tools4Pdf — homepage styles
   Primary accent: #FA5252 (shared across all PDF pages)
   App drawer: identical size, shape, and style to the original
   ============================================================ */

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

:root {
  /* Brand — #FA5252 */
  --primary: #FA5252;
  --primary-dark: #E03131;
  --primary-darker: #C92A2A;
  --primary-soft: #FFF5F5;
  --primary-tint: #FFE3E3;
  --primary-border: #FFC9C9;

  /* Neutrals */
  --secondary-bg: #ffffff;
  --card-border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #475569;
  --gray-bg: #f1f5f9;
  --bg: #f8fafc;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.02);

  --radius-card: 20px;
  --transition: 0.2s ease;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { text-decoration: none; color: inherit; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

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

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 24px;
}

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #FA5252, #C92A2A);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.logo span {
  font-weight: 800;
  color: var(--primary);
  background: none;
  -webkit-background-clip: unset;
}

.app-drawer-btn {
  background: var(--primary-soft);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.5rem;
  color: var(--primary);
}
.app-drawer-btn:hover { background: var(--primary-tint); transform: scale(1.02); }
.app-drawer-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Drawer (identical size/shape/style to original) ---------- */
.drawer-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.2s, opacity 0.2s;
}
.drawer-overlay.active { visibility: visible; opacity: 1; }

.app-drawer {
  position: fixed;
  top: 80px;
  right: 24px;
  width: 320px;
  background: white;
  border-radius: 32px;
  box-shadow: 0 25px 40px -12px rgba(0,0,0,0.25);
  padding: 20px 16px;
  z-index: 1001;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  pointer-events: none;
  border: 1px solid var(--card-border);
}
.drawer-overlay.active .app-drawer {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--primary-tint);
  margin-bottom: 16px;
}
.drawer-header h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}
.close-drawer {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.close-drawer:hover { background: var(--primary-soft); color: var(--primary); }

.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 8px;
}
.app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-radius: 16px;
  transition: background 0.2s;
  cursor: pointer;
  color: var(--text);
}
.app-item:hover { background: var(--gray-bg); }
.app-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-tint);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
}
.app-name { font-size: 0.7rem; font-weight: 500; text-align: center; }

.drawer-tagline {
  margin-top: 16px;
  text-align: center;
  font-size: 0.7rem;
  color: #94a3b8;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 60px 0 32px;
}
.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(145deg, #0f172a, #FA5252);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  max-width: 900px;
  margin: 0 auto 16px;
}
.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto;
}

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 48px 0 32px;
}
.filter-tag {
  background: white;
  border: 1px solid var(--card-border);
  padding: 8px 20px;
  border-radius: 40px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
}
.filter-tag.active,
.filter-tag:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.filter-tag:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: 2px; }

/* ---------- Tools grid ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin: 40px 0 60px;
}
.tool-card {
  background: white;
  border-radius: var(--radius-card);
  border: 1px solid var(--card-border);
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}
.tool-card a {
  display: block;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  height: 100%;
}
.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.tool-icon {
  font-size: 2.2rem;
  color: var(--primary);
  margin-bottom: 16px;
}
.tool-card h3 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.tool-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.badge-new {
  background: var(--primary-tint);
  color: var(--primary-darker);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 40px;
  display: inline-block;
  margin-bottom: 12px;
}

.hidden-card { display: none !important; }

.workflows-card {
  background: #fef9e3;
  border: 1px solid #ffe6b3;
}
.workflows-card .tool-icon i { color: #f59e0b; }
.action-link {
  margin-top: 16px;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Section titles ---------- */
.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 64px 0 24px;
}

/* ---------- Info cards ---------- */
.cards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: center;
  margin: 32px 0 48px;
}
.info-card {
  flex: 1;
  min-width: 260px;
  background: white;
  border-radius: 28px;
  padding: 32px 24px;
  text-align: center;
  border: 1px solid var(--card-border);
  transition: all 0.2s;
}
.info-card i { font-size: 2.5rem; color: var(--primary); margin-bottom: 20px; }
.info-card h3 { font-size: 1.5rem; margin-bottom: 12px; }
.info-card p { color: var(--text-muted); }

/* ---------- Trust row ---------- */
.trust-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  margin: 60px 0 40px;
  padding: 24px 0;
  border-top: 1px solid var(--card-border);
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}
.trust-item i { font-size: 1.8rem; color: var(--primary); }

/* ---------- SEO content ---------- */
.seo-content {
  background: white;
  border-radius: var(--radius-card);
  padding: 32px;
  margin-top: 32px;
  box-shadow: var(--shadow-sm);
}
.seo-content h2 {
  font-size: 1.5rem;
  margin-bottom: 14px;
  color: var(--text);
}
.seo-content p {
  color: var(--text-muted);
  line-height: 1.7;
}

.seo-content details {
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 10px;
  background: white;
  transition: var(--transition);
}
.seo-content details[open] { background: var(--primary-soft); border-color: var(--primary-border); }
.seo-content summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
  position: relative;
  padding-right: 24px;
  color: var(--text);
}
.seo-content summary::-webkit-details-marker { display: none; }
.seo-content summary::after {
  content: '+';
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: 400;
}
.seo-content details[open] summary::after { content: '−'; }
.seo-content details p { margin-top: 10px; font-size: 0.9rem; line-height: 1.6; }

/* ---------- Footer ---------- */
.footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 48px 0 32px;
  margin-top: 64px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 32px;
  margin-bottom: 48px;
}
.footer-col h4 { color: white; margin-bottom: 18px; font-size: 1rem; font-weight: 600; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
  color: #94a3b8;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.footer-col a:hover { color: white; }
.copyright {
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid #1e293b;
  font-size: 0.75rem;
  color: #64748b;
}
.copyright a { color: #94a3b8; }
.copyright a:hover { color: white; }

/* ---------- Noscript ---------- */
.noscript-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--primary-darker);
  color: white;
  padding: 12px 20px;
  text-align: center;
  font-size: 0.9rem;
  z-index: 9999;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero h1 { font-size: 2.2rem; }
  .hero p { font-size: 1rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .app-drawer { right: 16px; left: 16px; width: auto; top: 70px; }
  .section-title { font-size: 1.6rem; }
  .trust-row { gap: 24px; }
  .seo-content { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .header, .footer, .drawer-overlay, .filter-bar, .trust-row { display: none !important; }
}