/* ========================================
   CRMVersus - Main Stylesheet
   Inspired by EmailVersus.com
   Responsive · SEO-optimized
   ======================================== */

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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --green: #10b981;
  --red: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px 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: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--gray-50);
  min-height: 100vh;
}

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

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--primary);
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

/* --- Site Header --- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.logo:hover { color: var(--primary-dark); }

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

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-700);
  padding: 4px;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 0.25rem;
}
.nav-list li a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--gray-600);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.2s;
}
.nav-list li a:hover,
.nav-list li a.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: var(--white);
  padding: 3.5rem 0;
  text-align: center;
}
.hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
.hero-sub {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}
.hero-search {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
  gap: 0.5rem;
}
.hero-search input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
  box-shadow: var(--shadow);
}
.hero-search button {
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--gray-900);
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.hero-search button:hover { background: #d97706; }

/* --- Categories --- */
.categories {
  padding: 3rem 0;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.category-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all 0.2s;
  display: block;
  color: inherit;
}
.category-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}
.category-card .cat-icon { font-size: 1.75rem; display: block; margin-bottom: 0.5rem; }
.category-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }
.category-card p { font-size: 0.85rem; color: var(--gray-500); line-height: 1.4; }

/* --- Top Rated CRM Grid --- */
.top-rated {
  padding: 3rem 0;
  background: var(--white);
}
.crm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.crm-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all 0.2s;
  background: var(--white);
  display: flex;
  flex-direction: column;
}
.crm-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.crm-card .crm-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.crm-card .crm-logo.sf { background: #009ddc20; color: #009ddc; }
.crm-card .crm-logo.hs { background: #ff7a5920; color: #ff7a59; }
.crm-card .crm-logo.zc { background: #e43f2b20; color: #e43f2b; }
.crm-card .crm-logo.pd { background: #0eb67b20; color: #0eb67b; }
.crm-card .crm-logo.fs { background: #2b96e820; color: #2b96e8; }
.crm-card .crm-logo.ac { background: #2979ff20; color: #2979ff; }
.crm-card .crm-logo.ml { background: #00bcd420; color: #00bcd4; }
.crm-card .crm-logo.kv { background: #3b2c7a20; color: #3b2c7a; }
.crm-card .crm-logo.zm { background: #d4202620; color: #d42026; }
.crm-card .crm-logo.bv { background: #1e40af20; color: #1e40af; }
.crm-card .crm-logo.eb { background: #4f46e520; color: #4f46e5; }
.crm-card .crm-logo.su { background: #0ac77520; color: #0ac775; }

.crm-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.crm-card .crm-desc {
  font-size: 0.85rem;
  color: var(--gray-500);
  line-height: 1.45;
  flex: 1;
  margin-bottom: 0.75rem;
}
.crm-card .crm-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.crm-card .stars {
  color: var(--accent);
  font-size: 0.9rem;
}
.crm-card .rating-num {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
}
.crm-card .crm-price {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-bottom: 0.75rem;
}
.crm-card .crm-price strong { color: var(--green); }
.crm-card .crm-compare-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: auto;
}
.crm-card .crm-compare-link:hover { gap: 0.6rem; }

/* --- Trust Section --- */
.trust-section {
  padding: 2rem 0;
  text-align: center;
}
.trust-note {
  font-size: 0.9rem;
  color: var(--gray-500);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.5;
}

/* --- Footer --- */
.site-footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 3rem 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2rem;
  padding-bottom: 2rem;
}
.footer-col h4 {
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.footer-col p { font-size: 0.85rem; line-height: 1.5; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.35rem; }
.footer-col ul li a { color: var(--gray-400); font-size: 0.85rem; }
.footer-col ul li a:hover { color: var(--primary); }

.footer-bottom {
  border-top: 1px solid var(--gray-700);
  padding: 1rem 0;
  text-align: center;
}
.footer-bottom p { font-size: 0.8rem; color: var(--gray-500); }

/* --- Scroll to Top --- */
.scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  box-shadow: var(--shadow-lg);
  z-index: 99;
}
.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* ========================================
   Comparison Page (vs/ template)
   ======================================== */
.comparison-hero {
  background: var(--gray-900);
  color: var(--white);
  padding: 2.5rem 0;
  text-align: center;
}
.comparison-hero h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.comparison-hero .breadcrumb { font-size: 0.85rem; color: var(--gray-400); }
.comparison-hero .breadcrumb a { color: var(--gray-300); }
.comparison-hero .breadcrumb a:hover { color: var(--white); }

.compare-table-wrap { overflow-x: auto; margin: 2rem 0; }
.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.compare-table th,
.compare-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.9rem;
}
.compare-table th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
  white-space: nowrap;
}
.compare-table tr:last-child td { border-bottom: none; }
.compare-table .feature-name { font-weight: 500; color: var(--gray-700); }
.compare-table .check { color: var(--green); font-weight: bold; }
.compare-table .cross { color: var(--red); }
.compare-table .partial { color: var(--accent); }

.vs-intro { padding: 2rem 0; }
.vs-intro p { font-size: 1rem; color: var(--gray-600); line-height: 1.7; max-width: 800px; margin: 0 auto; text-align: center; }

.pro-con-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}
.pro-con-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--gray-200);
}
.pro-con-card h3 {
  font-weight: 700;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}
.pro-con-card.pros h3 { color: var(--green); }
.pro-con-card.cons h3 { color: var(--red); }
.pro-con-card ul { list-style: none; }
.pro-con-card ul li {
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--gray-600);
  padding-left: 1.5rem;
  position: relative;
}
.pro-con-card.pros ul li::before { content: '✅'; position: absolute; left: 0; }
.pro-con-card.cons ul li::before { content: '❌'; position: absolute; left: 0; }

/* --- Category Page --- */
.category-header {
  background: var(--gray-900);
  color: var(--white);
  padding: 2.5rem 0;
  text-align: center;
}
.category-header h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.category-header p { font-size: 1rem; color: var(--gray-300); }

.tool-list { padding: 2rem 0; }
.tool-list .crm-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
  .hero h1 { font-size: 1.75rem; }
  .category-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .nav-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0;
  }
  .nav-list.open { display: flex; }
  .nav-list li a { padding: 0.75rem 1.25rem; border-radius: 0; }
  .nav-list li a:hover { background: var(--gray-50); }

  .hero h1 { font-size: 1.5rem; }
  .hero-search { flex-direction: column; }
  .hero-search button { width: 100%; }

  .crm-grid { grid-template-columns: 1fr; }
  .pro-con-grid { grid-template-columns: 1fr; }

  .section-title { font-size: 1.35rem; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero { padding: 2.5rem 0; }
  .hero h1 { font-size: 1.3rem; }
  .category-grid { grid-template-columns: 1fr; }
}

/* --- Print --- */
@media print {
  .site-header, .site-footer, .scroll-top, .hero-search { display: none; }
  .hero { background: none !important; color: #000; padding: 1rem 0; }
}
