/* ============================================================
   TOOL CARDS — Modern SaaS Redesign
   Inspired by SmallPDF / iLovePDF design language
   Desktop: 4 cols | Tablet: 2 cols | Mobile: 1 col
   ============================================================ */

/* ── Grid Container ── */
.tool-cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: stretch;    /* ensures all rows stretch equally */
  margin-bottom: 4px;
}

/* ── Card Base ── */
.tc {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1.5px solid #E8EDF4;
  border-radius: 16px;
  padding: 26px 22px 22px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 168px;  /* ensures equal height baseline */
  /* Reset gap from parent so we use margin instead */
  gap: 0;
}

/* Top accent line on hover */
.tc::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 16px 16px 0 0;
}

/* Category-specific accent colours */
.cat-block:nth-child(1) .tc::before { background: linear-gradient(90deg, #1E88E5, #42A5F5); }
.cat-block:nth-child(2) .tc::before { background: linear-gradient(90deg, #FF7043, #FFA726); }
.cat-block:nth-child(3) .tc::before { background: linear-gradient(90deg, #43A047, #66BB6A); }
.cat-block:nth-child(4) .tc::before { background: linear-gradient(90deg, #8E24AA, #7C4DFF); }
.cat-block:nth-child(5) .tc::before { background: linear-gradient(90deg, #0097A7, #26C6DA); }

/* ── Hover State ── */
.tc:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(30, 40, 80, 0.12),
              0 4px 12px rgba(30, 40, 80, 0.06);
  border-color: #D0DCF0;
}
.tc:hover::before { transform: scaleX(1); }

/* ── Icon Container ── */
.tc-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 16px;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.tc:hover .tc-icon {
  transform: scale(1.08) translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

/* Icon colour variants */
.tc-icon--blue   { background: #EFF6FF; color: #1E88E5; }
.tc-icon--orange { background: #FFF7ED; color: #F4511E; }
.tc-icon--green  { background: #F0FDF4; color: #2E7D32; }
.tc-icon--purple { background: #FAF5FF; color: #7B1FA2; }
.tc-icon--red    { background: #FFF1F0; color: #E53935; }
.tc-icon--teal   { background: #E0F7FA; color: #00838F; }
.tc-icon--pink   { background: #FCE4EC; color: #C2185B; }
.tc-icon--indigo { background: #E8EAF6; color: #3949AB; }

/* ── Card Body (title + description) ── */
.tc-body {
  flex: 1;               /* takes remaining vertical space */
  display: flex;
  flex-direction: column;
}

.tc-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #1A1F2E;
  margin-bottom: 7px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.tc-body p {
  font-size: 0.835rem;
  line-height: 1.58;
  color: #7A849A;
  flex: 1;
  margin: 0;
}

/* ── Arrow — pinned to bottom-right ── */
.tc-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F0F4F8;
  color: #9AA3B2;
  font-size: 0.85rem;
  font-weight: 700;
  align-self: flex-end;
  margin-top: 14px;
  flex-shrink: 0;
  transition: background 0.22s ease,
              color 0.22s ease,
              transform 0.22s ease;
}

.tc:hover .tc-arrow {
  background: #1E88E5;
  color: #ffffff;
  transform: translateX(2px);
}

/* ── Category Section Block ── */
.cat-block {
  margin-bottom: 32px;
}

/* ── Category Label Badge ── */
.cat-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px 6px 10px;
  border-radius: 100px;
  margin-bottom: 14px;
}

.cat-label-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
}

.cat-label--blue   { background: #EFF6FF; color: #1565C0; }
.cat-label--orange { background: #FFF3E0; color: #E65100; }
.cat-label--green  { background: #F1F8E9; color: #2E7D32; }
.cat-label--purple { background: #F3E5F5; color: #6A1B9A; }
.cat-label--teal   { background: #E0F7FA; color: #00695C; }

/* ── Section Header ── */
.cats-section {
  padding: 72px 0 48px;
  background: #F8F9FB;
}

.cats-header {
  text-align: center;
  margin-bottom: 48px;
}

.cats-header .section-pill {
  display: inline-block;
  background: #EFF6FF;
  color: #1565C0;
  border: 1px solid #BFDBFE;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 14px;
}

.cats-header .cats-h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  color: #1A1F2E;
  margin-bottom: 12px;
  line-height: 1.2;
}

.cats-header p {
  color: #5A6478;
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ── Footer / See All ── */
.cats-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 36px;
  border-top: 1px solid #E2E8F0;
}

/* ── Responsive: Tablet (≤ 900px) → 2 columns ── */
@media (max-width: 900px) {
  .tool-cards-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .tc {
    min-height: 160px;
  }
}

/* ── Responsive: Medium Mobile (≤ 600px) → 1 column ── */
@media (max-width: 600px) {
  .tool-cards-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tc {
    flex-direction: row;
    align-items: flex-start;
    min-height: auto;
    padding: 18px 16px;
    gap: 0;
  }

  .tc-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    margin-bottom: 0;
    margin-right: 14px;
  }

  .tc-body {
    flex: 1;
  }

  .tc-body h3 {
    font-size: 0.95rem;
    margin-bottom: 4px;
  }

  .tc-body p {
    font-size: 0.8rem;
  }

  .tc-arrow {
    width: 24px;
    height: 24px;
    margin-top: 0;
    margin-left: 8px;
    align-self: center;
    font-size: 0.75rem;
  }

  .cats-section {
    padding: 48px 0 32px;
  }
}

/* ── Small mobile (≤ 400px) ── */
@media (max-width: 400px) {
  .tc {
    padding: 14px 13px;
  }
}
