/* Native High-Performance System Font Stack (0ms latency, 100% GDPR compliant) */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Strict Light Palette */
  --bg-main: #f9fafb;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --border-subtle: #e5e7eb;
  --border-strong: #d1d5db;
  --text-main: #111827;
  --text-muted: #4b5563;
  --accent: #111827;
  --accent-contrast: #ffffff;
}

html.dark {
  /* Strict Dark Palette */
  --bg-main: #0b0c0e;
  --bg-surface: #14161a;
  --bg-card: #14161a;
  --border-subtle: #22252b;
  --border-strong: #323742;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --accent: #f9fafb;
  --accent-contrast: #0b0c0e;
}

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

h1, h2, .text-balance {
  text-wrap: balance;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.text-balance {
  text-wrap: balance;
}

pre, code, kbd, .font-mono {
  font-family: var(--font-mono);
}

/* Category Color-Coded Icon Containers (48x48px, inner 24x24px) */
.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.tool-icon svg, .tool-icon i {
  width: 24px;
  height: 24px;
}

.tool-icon.media {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.tool-icon.qr {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.tool-icon.text {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.tool-icon.dev {
  background: rgba(6, 182, 212, 0.12);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.tool-icon.sponsored {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

/* Card Styling: Entire card clickable, no visual noise, 18px title, 14.5px desc */
.tool-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 24px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

html.dark .tool-card:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
}

.tool-card-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-main);
  margin-top: 16px;
  margin-bottom: 6px;
}

.tool-card-desc {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Filter Buttons (15px, 10px 20px padding, 10px radius) */
.cat-filter-btn {
  font-size: 15px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 10px;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

/* Compact Smart Dropzone */
.smart-quick-dropzone {
  background: rgba(99, 102, 241, 0.04);
  border: 1.5px dashed #818cf8;
  border-radius: 12px;
  padding: 18px 24px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.smart-quick-dropzone:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: #6366f1;
}

/* Solid Surfaces */
.surface-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

/* Button Components */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--bg-surface);
  color: var(--text-main);
  font-weight: 500;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.btn-secondary:hover {
  border-color: var(--border-strong);
}

/* Touch adjustments */
@media (hover: none) and (pointer: coarse) {
  .keyboard-shortcut-hint {
    display: none !important;
  }
}

/* Horizontal scrollbar hiding */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 3-Column Responsive Grid */
#tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

@media (max-width: 1024px) {
  #tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 640px) {
  #tools-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* Modal Overlay */
.modal-overlay {
  background-color: rgba(0, 0, 0, 0.75);
}
