/* Tools page redesign (loaded after the page's own styles) */

/* ── Header ── */
.tools-hero {
  padding: calc(var(--navbar-h) + 2.25rem) 0 2rem;
  background:
    radial-gradient(60% 140% at 90% 0%, rgba(0,212,255,.08), transparent 65%),
    linear-gradient(180deg, #0a121a, var(--bg-base));
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.tools-hero .tools-hero-inner { align-items: flex-end; }
.tools-hero-text { max-width: 560px; }
.tools-hero .tools-hero-title {
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  color: #fff; margin-bottom: .6rem;
}
.tools-hero .tools-hero-desc { max-width: 520px; font-size: 1rem; color: #9aa7ba; }
.tools-hero .tools-hero-stats { gap: 0; }
.tools-hero .tools-stat {
  text-align: left; padding: 0 1.75rem;
  border-left: 1px solid rgba(255,255,255,.1);
}
.tools-hero .tools-stat:first-child { padding-left: 0; border-left: 0; }
.tools-hero .tools-stat:last-child { padding-right: 0; }
.tools-hero .tools-stat-num {
  font-family: var(--font-body); font-variant-numeric: tabular-nums;
  font-size: 2rem; font-weight: 700; line-height: 1; margin-bottom: .35rem; color: #fff;
}
.tools-hero .tools-stat-label {
  font-family: var(--font-body); font-size: .78rem;
  letter-spacing: .04em; text-transform: none; color: #8b98ab;
}

/* ── Filters and search ── */
.tools-filter-bar {
  gap: .5rem; padding: 1.4rem 0 1.5rem; margin-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.tools-filter-bar .tools-filter-btn {
  font-family: var(--font-body); font-size: .82rem; font-weight: 600;
  text-transform: none; letter-spacing: 0;
  padding: .45rem 1rem; border-radius: 999px;
  color: #aab6c6; background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.1);
}
.tools-filter-bar .tools-filter-btn:hover { color: #fff; border-color: rgba(0,212,255,.4); background: rgba(0,212,255,.06); }
.tools-filter-bar .tools-filter-btn.active { color: #00d4ff; border-color: rgba(0,212,255,.5); background: rgba(0,212,255,.1); }
.tools-search-icon { left: .85rem; opacity: 1; display: flex; color: #7e8da0; }
.tools-search-icon svg { width: 16px; height: 16px; }
.tools-filter-bar .tools-search {
  width: 260px; height: 40px; padding: .5rem .9rem .5rem 2.5rem;
  font-family: var(--font-body); font-size: .85rem; border-radius: 10px;
  background: rgba(6,9,13,.7); border: 1px solid rgba(255,255,255,.1);
}
.tools-filter-bar .tools-search:focus {
  border-color: rgba(0,212,255,.6); background: rgba(8,13,19,.95);
  box-shadow: 0 0 0 4px rgba(0,212,255,.1);
}

/* ── Cards ── */
.tools-grid { gap: 1.25rem; }
.tools-grid .tool-card {
  background: linear-gradient(180deg, #111b27, #0b131c);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.tools-grid .tool-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0,212,255,.4);
  box-shadow: 0 14px 34px rgba(0,0,0,.4);
}
.tools-grid .tc-header { padding: 1.3rem 1.3rem 1rem; gap: 1rem; border-bottom: 0; }
.tools-grid .tc-icon-wrap {
  width: 48px; height: 48px; border-radius: 12px; overflow: hidden;
  font-size: 0; color: #00d4ff;
  background: #0a1119; border: 1px solid rgba(255,255,255,.1);
  transition: border-color .25s ease;
}
.tc-icon-wrap svg { width: 23px; height: 23px; }
.tc-icon-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tools-grid .tool-card:hover .tc-icon-wrap { border-color: rgba(0,212,255,.45); }

.tc-namerow { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.tools-grid .tc-name { margin: 0; font-size: 1.02rem; }
.tc-free {
  flex-shrink: 0; padding: .12rem .55rem; border-radius: 999px;
  font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: #00d4ff; background: rgba(0,212,255,.08); border: 1px solid rgba(0,212,255,.35);
}
.tools-grid .tc-tagline {
  margin: .25rem 0 .6rem; font-size: .82rem; line-height: 1.5; color: #9aa7ba;
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.tc-meta-line { display: flex; align-items: center; gap: .6rem; font-size: .74rem; color: #8b98ab; }
.tc-dot { width: 3px; height: 3px; border-radius: 50%; background: #556374; }
.tc-diff { display: inline-flex; align-items: center; gap: .45rem; text-transform: capitalize; }
.tc-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.tc-bars i { width: 3px; border-radius: 1px; background: rgba(255,255,255,.18); }
.tc-bars i:nth-child(1) { height: 5px; }
.tc-bars i:nth-child(2) { height: 8px; }
.tc-bars i:nth-child(3) { height: 11px; }
.tc-bars i.on { background: #00d4ff; }

.tools-grid .tc-body { padding: 0 1.3rem 1.1rem; }
.tools-grid .tc-desc { font-size: .84rem; line-height: 1.65; color: #8e9bad; -webkit-line-clamp: 3; }
.tools-grid .tc-footer { padding: .85rem 1.3rem; border-top: 1px solid rgba(255,255,255,.07); }
.tools-grid .tc-stat { font-family: var(--font-body); font-size: .76rem; gap: .4rem; color: #8b98ab; }
.tc-stat svg { width: 14px; height: 14px; color: #6f8196; }
.tools-grid .tc-cta {
  font-family: var(--font-body); font-size: .8rem; font-weight: 700;
  text-transform: none; letter-spacing: 0; color: #00d4ff;
}
.tc-cta svg { width: 15px; height: 15px; transition: transform .2s ease; }
.tools-grid .tool-card:hover .tc-cta svg { transform: translateX(3px); }

.tool-card-skeleton { border-radius: 14px; background: #0d1520; }

@media (max-width: 768px) {
  .tools-hero .tools-hero-stats { justify-content: flex-start; }
  .tools-filter-bar .tools-search { width: 100%; }
}

/* TOOLS COMPACT - smaller cards, difficulty styled like the Courses page */

.tools-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; margin-bottom: 3rem; }

.tools-grid .tool-card {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(130% 95% at 0% 0%, rgba(140,180,255,.08), transparent 58%),
    linear-gradient(160deg, #16212f, #0d1520);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 10px 26px rgba(0,0,0,.28);
}
.tools-grid .tool-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,.17);
  background:
    radial-gradient(130% 95% at 0% 0%, rgba(140,180,255,.13), transparent 60%),
    linear-gradient(160deg, #1a283b, #0e1826);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 16px 34px rgba(0,0,0,.4);
}

.tools-grid .tc-header { padding: 1.05rem 1.15rem .75rem; gap: .85rem; }
.tools-grid .tc-icon-wrap {
  width: 42px; height: 42px; border-radius: 11px;
  background: linear-gradient(145deg, #162434, #0b121a);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.tools-grid .tc-icon-wrap svg { width: 20px; height: 20px; }
.tools-grid .tool-card:hover .tc-icon-wrap {
  border-color: rgba(0,212,255,.55);
  box-shadow: 0 0 18px rgba(0,212,255,.25);
}

.tools-grid .tc-name { font-size: .98rem; }
.tools-grid .tc-tagline {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin: .15rem 0 .55rem; font-size: .78rem;
}
.tools-grid .tc-body { padding: 0 1.15rem .85rem; }
.tools-grid .tc-desc { font-size: .8rem; line-height: 1.6; color: #93a1b4; -webkit-line-clamp: 2; }
.tools-grid .tc-footer { padding: .7rem 1.15rem; }
.tools-grid .tc-stat { font-size: .74rem; }
.tools-grid .tc-cta { font-size: .78rem; }

/* Difficulty: same font, colors and bars as the Courses page */
.tools-grid .tc-meta-line { gap: .55rem; font-size: .76rem; }
.tools-grid .tc-diff {
  --dc: #22c55e; color: var(--dc);
  gap: .5rem; font-family: var(--font-mono); font-size: .82rem;
  font-weight: 700; letter-spacing: .02em; line-height: 1;
  text-transform: capitalize;
}
.tools-grid .tc-diff--beginner     { --dc: #22c55e; }
.tools-grid .tc-diff--intermediate { --dc: #f59e0b; }
.tools-grid .tc-diff--advanced     { --dc: #f43f5e; }
.tools-grid .tc-bars { gap: 2px; height: 15px; align-items: flex-end; }
.tools-grid .tc-bars i { width: 4px; background: rgba(255,255,255,.16); }
.tools-grid .tc-bars i:nth-child(1) { height: 40%; }
.tools-grid .tc-bars i:nth-child(2) { height: 70%; }
.tools-grid .tc-bars i:nth-child(3) { height: 100%; }
.tools-grid .tc-bars i.on { background: var(--dc); }

/* Hero: same glow, grid and edge as the Courses page */
.tools-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0,212,255,0.07) 0%, rgba(0,212,255,0.02) 50%, transparent 100%),
    radial-gradient(ellipse at 60% 0%, rgba(0,212,255,0.08) 0%, transparent 55%);
  border-bottom: 1px solid rgba(0,212,255,0.1);
}
.tools-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.035) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, black 0%, transparent 100%);
          mask-image: linear-gradient(180deg, black 0%, transparent 100%);
}
.tools-hero > .container { position: relative; z-index: 1; }
