/* ==========================================================
   SMART CYBER CAFE — ALL TOOLS DIRECTORY (v2 Fresh Redesign)
   Palette: Royal Blue (#1a3566), Gold (#d97706), Emerald (#10b981), Slate
   Style: Minimalist, Airy, High-Performance, WCAG AA Accessible
   ========================================================== */

/* ── PAGE BASE & AMBIENT DECOR ── */
.tools-page-body {
  background-color: var(--slate-50, #f8fafc);
  color: var(--slate-800, #1e293b);
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

.tools-bg-decor {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.tools-bg-decor .glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  will-change: transform;
}

.glow-royal {
  top: -12%;
  left: -10%;
  width: 48vw;
  height: 48vw;
  background: radial-gradient(circle, rgba(26, 53, 102, 0.28) 0%, rgba(37, 99, 235, 0.1) 70%, transparent 100%);
}

.glow-gold {
  top: 5%;
  right: -8%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.18) 0%, rgba(245, 158, 11, 0.05) 70%, transparent 100%);
}

.glow-emerald {
  bottom: -15%;
  left: 20%;
  width: 42vw;
  height: 42vw;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.14) 0%, transparent 70%);
}

/* ── MAIN CONTAINER ── */
.tools-main-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 76px 24px 60px;
  min-height: calc(100vh - 80px);
}

/* ── STREAMLINED DIRECTORY HEADER ── */
.tools-directory-header {
  margin-bottom: 24px;
}

/* Top Row: Title, Counter Badge & Freemium Chip */
.tools-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tools-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.tools-page-title {
  font-family: 'DM Sans', 'Inter', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.025em;
  margin: 0;
  line-height: 1.2;
}

.tools-counter-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-500, #64748b);
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid var(--slate-200, #e2e8f0);
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Sleek Freemium Announcement Chip */
.tools-freemium-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.95), rgba(240, 253, 250, 0.95));
  border: 1px solid rgba(186, 230, 253, 0.9);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.8rem;
  color: #0369a1;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.08);
}

.tools-freemium-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  flex-shrink: 0;
}

.tools-freemium-chip-text {
  line-height: 1.3;
}

.tools-freemium-chip-text strong {
  color: #0f172a;
}

.tools-chip-link {
  color: var(--royal, #1a3566);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.15s ease;
}

.tools-chip-link:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* ── UNIFIED ACTION TOOLBAR ── */
.tools-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 16px -2px rgba(26, 53, 102, 0.04);
}

/* Category Filter Pills */
.tools-category-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tools-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  font-size: 0.825rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--slate-600, #475569);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  white-space: nowrap;
}

.tools-cat-pill svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
}

.tools-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  color: inherit;
  transition: all 0.18s ease;
}

.tools-cat-pill:hover {
  background: rgba(241, 245, 249, 0.9);
  color: var(--royal-dark, #122549);
}

.tools-cat-pill.active {
  background: var(--royal, #1a3566);
  color: #ffffff;
  border-color: var(--royal, #1a3566);
  box-shadow: 0 2px 8px rgba(26, 53, 102, 0.25);
}

.tools-cat-pill.active .tools-pill-count {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Compact Integrated Search Wrap */
.tools-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 12px;
  width: 280px;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tools-search-wrap:focus-within {
  border-color: var(--royal, #1a3566);
  box-shadow: 0 0 0 3px rgba(26, 53, 102, 0.1);
  width: 320px;
}

.tools-search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--slate-400, #94a3b8);
  pointer-events: none;
  transition: color 0.2s ease;
}

.tools-search-wrap:focus-within .tools-search-icon {
  color: var(--royal, #1a3566);
}

#tools-search-input {
  width: 100%;
  padding: 8px 64px 8px 36px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--slate-800, #1e293b);
  background: transparent;
  border: none;
  outline: none;
  line-height: 1.4;
}

#tools-search-input::placeholder {
  color: var(--slate-400, #94a3b8);
  font-size: 0.825rem;
}

.tools-search-clear {
  position: absolute;
  right: 36px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--slate-100, #f1f5f9);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--slate-500, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tools-search-clear:hover {
  background: var(--slate-200, #e2e8f0);
  color: #0f172a;
}

.tools-search-kbd {
  position: absolute;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  min-width: 20px;
  padding: 0 5px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: monospace;
  color: var(--slate-400, #94a3b8);
  background: var(--slate-100, #f1f5f9);
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: 4px;
  user-select: none;
  pointer-events: none;
}

/* ── TOOL GRID ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 24px;
}

/* ── TOOL CARD (MINIMALIST ARCHITECTURE) ── */
.tool-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  padding: 24px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px -2px rgba(26, 53, 102, 0.04), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
}

.tool-card:hover {
  transform: translateY(-5px);
  background: #ffffff;
  border-color: rgba(26, 53, 102, 0.3);
  box-shadow: 0 20px 36px -8px rgba(26, 53, 102, 0.12), 0 6px 16px -4px rgba(26, 53, 102, 0.05);
}

.tool-card:focus-visible {
  border-color: var(--royal, #1a3566);
  box-shadow: 0 0 0 3px rgba(26, 53, 102, 0.25), 0 10px 24px rgba(26, 53, 102, 0.1);
}

/* Card Top Row */
.tool-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tool-card-img-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.8);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.tool-card:hover .tool-card-img-wrap {
  transform: scale(1.08) rotate(2deg);
}

.tool-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tool-card-img-wrap svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  fill: none;
}

/* Card Badges */
.tool-badge {
  font-size: 0.725rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}

.badge-popular {
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.badge-free {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-multi,
.badge-multi-grid {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.badge-instant {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-new {
  background: rgba(14, 165, 233, 0.1);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

.badge-asterisk {
  font-size: 0.85em;
  vertical-align: super;
  margin-left: 1px;
}

/* Card Title & Desc */
.tool-title {
  font-family: 'DM Sans', 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
  letter-spacing: -0.015em;
  transition: color 0.2s ease;
}

.tool-card:hover .tool-title {
  color: var(--royal, #1a3566);
}

.tool-desc {
  font-size: 0.9rem;
  color: var(--slate-600, #475569);
  line-height: 1.55;
  margin: 0 0 16px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Feature Tags */
.tool-tags-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tool-tag-chip {
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--slate-500, #64748b);
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.8);
  padding: 3px 8px;
  border-radius: 6px;
  line-height: 1.2;
}

/* Card Footer Action */
.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(226, 232, 240, 0.7);
  margin-top: auto;
}

.tool-tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #047857;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
  padding: 4px 9px;
  border-radius: 8px;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.tool-card:hover .tool-tier-pill {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
}

.tier-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: tierPulse 2.5s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes tierPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.tier-limit {
  font-weight: 600;
  opacity: 0.85;
}

.tool-action-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tool-action-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--royal, #1a3566);
  letter-spacing: 0.01em;
}

.tool-action-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--slate-100, #f1f5f9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate-600, #475569);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.tool-action-circle svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.5;
  stroke: currentColor;
  fill: none;
}

.tool-card:hover .tool-action-circle {
  background: var(--royal, #1a3566);
  color: #ffffff;
  transform: translateX(4px);
  box-shadow: 0 4px 10px rgba(26, 53, 102, 0.25);
}

/* ── FAIR-USE & FREEMIUM TRANSPARENCY CARD ── */
.tools-fairuse-card {
  margin-top: 48px;
  padding: 22px 28px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 18px;
  box-shadow: 0 4px 20px -2px rgba(26, 53, 102, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tools-fairuse-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.tools-fairuse-asterisk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(217, 119, 6, 0.12);
  color: #d97706;
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1;
}

.tools-fairuse-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.tools-fairuse-text {
  font-size: 0.85rem;
  color: var(--slate-500, #64748b);
  line-height: 1.6;
  margin: 0;
}

/* ── EMPTY STATE ── */
.tools-empty-state {
  text-align: center;
  padding: 64px 24px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  border: 1.5px dashed var(--slate-300, #cbd5e1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: 560px;
  margin: 40px auto;
}

.tools-empty-icon-wrap {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: rgba(26, 53, 102, 0.06);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--royal, #1a3566);
}

.tools-empty-svg {
  width: 32px;
  height: 32px;
}

.tools-empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
}

.tools-empty-desc {
  font-size: 0.95rem;
  color: var(--slate-600, #475569);
  line-height: 1.6;
  margin: 0 0 24px;
}

.tools-empty-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--royal, #1a3566);
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(26, 53, 102, 0.25);
}

.tools-empty-btn:hover {
  background: var(--royal-mid, #1e4080);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(26, 53, 102, 0.3);
}

/* ── UTILITY HELPERS ── */
.hidden {
  display: none !important;
}

/* ── RESPONSIVE ADAPTATIONS ── */
@media (max-width: 1024px) {
  .tools-main-container {
    padding: 72px 20px 60px;
  }
  .tools-search-wrap {
    width: 240px;
  }
  .tools-search-wrap:focus-within {
    width: 260px;
  }
  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .tools-main-container {
    padding: 68px 16px 40px;
  }
  .tools-header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .tools-freemium-chip {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .tools-toolbar {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
  }
  .tools-search-wrap {
    width: 100%;
  }
  .tools-search-wrap:focus-within {
    width: 100%;
  }
  .tools-category-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tools-category-pills::-webkit-scrollbar {
    display: none;
  }
  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
  }
  .tool-card {
    padding: 20px;
  }
  .tools-fairuse-card {
    padding: 16px 18px;
    margin-top: 36px;
  }
  .tool-card-footer {
    flex-wrap: wrap;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .tools-page-title {
    font-size: 1.45rem;
  }
  .tools-header-title-wrap {
    width: 100%;
    justify-content: space-between;
  }
  .tools-freemium-chip {
    font-size: 0.75rem;
    padding: 4px 10px;
  }
  .tool-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .tool-action-wrap {
    width: 100%;
    justify-content: space-between;
  }
  .tools-grid {
    grid-template-columns: 1fr;
  }
}

/* ── REDUCED MOTION PREFERENCE ── */
@media (prefers-reduced-motion: reduce) {
  .tool-card,
  .tool-card-img-wrap,
  .tool-action-circle,
  .tools-cat-pill,
  .tools-search-wrap {
    transition: none !important;
    transform: none !important;
  }
}

