/* =============================================
   OnlineToolsPro - Premium Human-Crafted Styles
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..800&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {
  --bg: #f4f3ef; /* Warm elegant paper */
  --surface: #ffffff;
  --surface-2: #eae9e4;
  --text: #1a1a1a;
  --text-2: #5c5c5c;
  --primary: #f25f4c; /* Vibrant coral */
  --primary-hover: #d95544;
  --primary-light: rgba(242, 95, 76, 0.08);
  --accent: #219ebc; /* Vibrant ocean blue */
  --border: #dfddd6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0,0,0, 0.02);
  --font: 'Bricolage Grotesque', system-ui, sans-serif;
  --mono: 'Space Mono', monospace;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --header-bg: rgba(244, 243, 239, 0.85);
  --nav-bg: #ffffff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --tooltip-bg: #1a1a1a;
  --toggle-bg: #dfddd6;
  --input-bg: #ffffff;
  --card-1: rgba(242, 95, 76, 0.06);
  --card-2: rgba(33, 158, 188, 0.06);
  --card-3: rgba(16, 185, 129, 0.06);
}

[data-theme="dark"] {
  --bg: #0b0c10; /* Deep midnight */
  --surface: #14151a;
  --surface-2: #1e1f26;
  --text: #f0f0f5;
  --text-2: #8a8d98;
  --primary: #ff6b6b; /* Soft neon coral */
  --primary-hover: #ff8787;
  --primary-light: rgba(255, 107, 107, 0.12);
  --accent: #48cae4; /* Neon cyan */
  --border: #252730;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --header-bg: rgba(11, 12, 16, 0.85);
  --nav-bg: #14151a;
  --input-bg: #14151a;
  --toggle-bg: #252730;
  --card-1: rgba(255, 107, 107, 0.08);
  --card-2: rgba(72, 202, 228, 0.08);
  --card-3: rgba(16, 185, 129, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* Smooth transitions for light/dark theme swapping */
body, header, footer, .tool-card, input, textarea, select, .btn, .output-box, .toast, .stat-item, .timer-display, .related-card, .btn-outline, .tc-icon, .tc-title, .tc-desc, .logo, .logo span, .github-link {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  margin-right: 12px;
}
.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--toggle-bg, #ddd);
  border-radius: 10px;
  transition: background 0.25s;
  flex-shrink: 0;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}
.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(16px);
}
.toggle-label {
  font-size: 0.85rem;
  color: var(--text);
}
/* ===== END TOGGLE ===== */

/* ===== TOOL GRID ===== */
.tool-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
.tool-card {
  flex: 0 0 calc(25% - 11px);
  min-width: 180px;
}

/* ===== JSON SYNTAX HIGHLIGHTING ===== */
.json-container code textarea.json-output,
.json-output, .json-key, .json-string, .json-number, .json-boolean, .json-null {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}
.json-key { color: #2563eb; }
.json-string { color: #16a34a; }
.json-number { color: #d97706; }
.json-boolean { color: #7c3aed; }
.json-null { color: #dc2626; }

/* Monospace ONLY for code-like elements */
textarea, input[type="text"], input[type="url"], input[type="password"],
input[type="number"], select, code, pre, .output-box, .diff-output,
.json-tree, .timer-display, .color-row input[type="text"] {
  font-family: var(--mono);
}

/* ===== LAYOUT ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ===== HEADER ===== */
header {
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary);
  text-decoration: none;
}

.logo span { color: var(--text); }

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.github-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.github-link:hover { color: var(--primary); }

.theme-toggle {
  background: var(--toggle-bg);
  border: none;
  width: 40px;
  height: 24px;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: background 0.3s;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  transition: transform 0.3s;
}

[data-theme="dark"] .theme-toggle::after {
  transform: translateX(16px);
}

.theme-toggle-icon {
  position: absolute;
  font-size: 12px;
  line-height: 24px;
  top: 0;
  z-index: 1;
}

.theme-toggle-icon.sun { left: 5px; }
.theme-toggle-icon.moon { right: 5px; }

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 60px 20px 30px;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  font-family: var(--display);
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-2);
  max-width: 600px;
  margin: 0 auto 12px;
}

.hero-count {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: 8px 24px;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 8px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 14px 32px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  transition: all 0.2s;
}
.hero-cta:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(67,97,238,0.3);
}

/* ===== TOOL GRID ===== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 20px 0 40px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.33, 1, 0.68, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 35px rgba(67,97,238,0.15), 0 4px 10px rgba(0,0,0,0.08);
  border-color: var(--primary);
}

.tool-card:active {
  transform: translateY(-2px);
}

.tool-card-icon {
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  transition: transform 0.25s;
}

.tool-card:hover .tool-card-icon {
  transform: scale(1.15);
}

.tool-card-icon svg {
  width: 28px;
  height: 28px;
}

.tool-card-title { font-weight: 600; font-size: 0.95rem; }
.tool-card-desc { font-size: 0.8rem; color: var(--text-2); text-align: center; }

/* Popular badge */
.popular-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  letter-spacing: 0.3px;
}

/* Tool card icon background variants */
.tool-card-icon-bg-1 { background: var(--card-1); }
.tool-card-icon-bg-2 { background: var(--card-2); }
.tool-card-icon-bg-3 { background: var(--card-3); }

/* ===== TOOL SECTION ===== */
.tool-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 30px;
  padding: 30px;
  scroll-margin-top: 80px;
}

.tool-section h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
}

.tool-section .tool-desc {
  color: var(--text-2);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* ===== COPY BUTTON ===== */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-2);
  transition: all 0.2s;
  font-family: var(--font);
}
.copy-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.copy-btn.copied { background: #d1fae5; color: #065f46; border-color: #10b981; }

.copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}
.copy-row .output-box { flex: 1; margin: 0; }

/* ===== FORM ELEMENTS ===== */
label {
  display: block;
  font-weight: 600;
  margin: 12px 0 6px;
  font-size: 0.9rem;
  color: var(--text);
}

input[type="text"],
input[type="number"],
input[type="url"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--input-bg);
  color: var(--text);
  transition: border 0.2s;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,0.15);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-success {
  background: var(--primary);
  color: white;
}

.btn-success:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-group {
  display: flex;
  gap: 8px;
  margin: 14px 0;
  flex-wrap: wrap;
}

/* ===== OUTPUT ===== */
.output-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 10px 0;
  font-size: 0.9rem;
  min-height: 40px;
  word-break: break-all;
  white-space: pre-wrap;
  color: var(--text);
}

.result-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin: 6px 0;
}

.result-card {
  background: var(--primary-light);
  border: 1px solid rgba(67,97,238,0.2);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 10px 0;
}

.result-card .label { font-size: 0.8rem; color: var(--text-2); }
.result-card .value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }

.strength-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  margin: 6px 0;
  overflow: hidden;
}

.strength-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s, background 0.3s;
}

/* ===== DIFF SPECIFIC ===== */
.diff-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.diff-panel textarea { min-height: 200px; }

.diff-output {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 10px 0;
  max-height: 400px;
  overflow: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

.diff-same { background: transparent; color: var(--text); display: block; }
.diff-added { background: #d1fae5; color: #065f46; display: block; }
.diff-removed { background: #fee2e2; color: #991b1b; display: block; }

[data-theme="dark"] .diff-same { color: #cbd5e1; }
[data-theme="dark"] .diff-removed { background: #3b1a1a; color: #fca5a5; }
[data-theme="dark"] .diff-added { background: #1a3a2a; color: #86efac; }

/* ===== COUNTER SPECIFIC ===== */
.counter-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.stat-item {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.stat-item .num {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-item .lbl {
  font-size: 0.8rem;
  color: var(--text-2);
}

/* ===== LIST RANDOMIZER ===== */
.list-input-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.list-input-area textarea { min-height: 160px; }

.random-result {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  padding: 20px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  margin: 10px;
}

/* ===== COLOR PICKER ===== */
.color-preview {
  width: 100%;
  height: 80px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 10px 0;
}

.color-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 6px 0;
}

.color-row label { margin: 0; min-width: 50px; font-family: var(--font); }
.color-row input { flex: 1; }

input[type="color"] {
  width: 50px;
  height: 50px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 2px;
  background: var(--surface);
}

/* ===== STOPWATCH ===== */
.timer-display {
  font-size: 3.5rem;
  font-weight: 800;
  text-align: center;
  color: var(--text);
  letter-spacing: 2px;
  padding: 30px 0 20px;
}

.timer-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.timer-laps {
  margin-top: 20px;
  max-height: 200px;
  overflow-y: auto;
}

.timer-laps table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.timer-laps td, .timer-laps th { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.timer-laps th { font-weight: 600; color: var(--text-2); }

/* ===== QR CODE ===== */
.qr-display {
  text-align: center;
  padding: 20px;
}

.qr-display canvas, .qr-display img {
  max-width: 250px;
  border-radius: var(--radius-sm);
}

/* ===== JSON ===== */
.json-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 4px 0;
}

.json-tree {
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 30px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.85rem;
  margin-top: 40px;
}

footer a { color: var(--primary); text-decoration: none; }

footer .footer-tagline {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

/* ===== RESPONSIVE ===== */

/* ===== ACCESSIBILITY ===== */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--primary, #4361ee);
  color: #fff;
  padding: 12px 24px;
  z-index: 9999;
  font-weight: 600;
  border-radius: 0 0 8px 0;
  text-decoration: none;
}
.skip-nav:focus {
  top: 0;
}

*:focus-visible {
  outline: 3px solid var(--primary, #4361ee);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--primary, #4361ee);
  outline-offset: 2px;
}

/* ===== RESPONSIVE (original) ===== */
@media (max-width: 1024px) {
  .tool-grid { gap: 10px; }
  .tool-card { flex: 0 0 calc(33.33% - 10px); }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .diff-container { grid-template-columns: 1fr; }
  .list-input-area { grid-template-columns: 1fr; }
  .timer-display { font-size: 2.5rem; }
  .tool-section { padding: 20px 16px; }
}

@media (max-width: 480px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== AD PLACEHOLDER ===== */
.ad-placeholder {
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  color: var(--text-2);
  font-size: 0.8rem;
  margin: 20px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== BASE64 ===== */
.base64-row { display: flex; gap: 10px; margin: 10px 0; }
.base64-row .btn { flex: 1; justify-content: center; }

/* ===== PERCENTAGE ===== */
.percent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.percent-item {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.percent-item h4 { margin-bottom: 10px; font-size: 0.95rem; }

@media (max-width: 600px) {
  .percent-grid { grid-template-columns: 1fr; }
}

/* Percentage visual bar */
.percent-bar-wrap {
  margin: 6px 0;
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.percent-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: var(--primary);
  transition: width 0.3s;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  z-index: 999;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Keyboard shortcut hint */
.kbd {
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.75rem;
  font-family: var(--mono);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-2);
}

/* Color history swatch */
.color-history {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s;
}
.color-swatch:hover { transform: scale(1.2); }

/* Password passphrase mode */
.passphrase-display {
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  padding: 14px;
  color: var(--text);
  letter-spacing: 0.5px;
}

/* ===== PRINT FRIENDLY ===== */
@media print {
  header, footer, .tool-grid, .ad-placeholder, .theme-toggle { display: none !important; }
  .tool-section { break-inside: avoid; border: 1px solid #ddd; }
}


/* ===== HOMEPAGE ===== */
.hp-hero {
  position: relative;
  overflow: hidden;
  padding: 80px 20px 50px;
  text-align: center;
}
.hero-glow-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.08;
  transition: opacity 0.5s ease;
}
[data-theme="dark"] .hero-glow {
  opacity: 0.12;
}
.hero-glow-1 {
  width: 350px;
  height: 350px;
  background: var(--primary);
  top: -100px;
  left: 15%;
  animation: float-glow-1 25s infinite alternate ease-in-out;
}
.hero-glow-2 {
  width: 300px;
  height: 300px;
  background: var(--accent);
  bottom: -50px;
  right: 20%;
  animation: float-glow-2 20s infinite alternate ease-in-out;
}
@keyframes float-glow-1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.15); }
}
@keyframes float-glow-2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-50px, -30px) scale(1.1); }
}

.hp-hero h1, .hp-hero p, .hp-hero .hp-badges, .hp-hero .hp-trust {
  position: relative;
  z-index: 1;
}

.hp-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin: 0 0 16px;
  letter-spacing: -0.8px;
  color: var(--text);
  font-family: var(--display);
  line-height: 1.15;
}
.hp-tagline {
  font-size: 1.15rem;
  color: var(--text-2);
  max-width: 650px;
  margin: 0 auto 28px;
  line-height: 1.6;
}
.hp-badges {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.hp-badge {
  background: var(--surface);
  color: var(--text);
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hp-trust {
  font-size: 0.85rem;
  color: var(--text-2);
  margin-top: 10px;
  opacity: 0.8;
  letter-spacing: 0.2px;
}

.hp-search-section {
  max-width: 650px;
  margin: 0 auto 35px;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}
.hp-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.hp-search {
  width: 100%;
  padding: 14px 44px 14px 20px;
  font-size: 1.05rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.hp-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light), 0 8px 30px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.hp-search-shortcut {
  position: absolute;
  right: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-2);
  pointer-events: none;
  font-family: var(--mono);
}

.hp-categories {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}
.hp-cat {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.hp-cat:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.hp-cat.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.hp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 0 20px 50px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  min-height: 150px;
  box-shadow: var(--shadow);
}
.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.02);
  border-color: var(--primary);
}
.tc-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.tool-card:hover .tc-icon {
  transform: scale(1.12);
}
.tc-icon svg {
  width: 30px;
  height: 30px;
  display: block;
}
.tc-title {
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 4px;
  color: var(--text);
}
.tc-desc {
  font-size: 0.78rem;
  color: var(--text-2);
  text-align: center;
  line-height: 1.4;
  font-weight: 500;
}
.tool-card.popular::after {
  content: "Popular";
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.62rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
}

@media (max-width: 600px) {
  .hp-hero { padding: 60px 16px 40px; }
  .hp-hero h1 { font-size: 2.1rem; }
  .hp-tagline { font-size: 0.98rem; }
  .hp-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tool-card { padding: 18px 12px; min-height: 130px; }
  .tc-title { font-size: 0.88rem; }
  .tc-desc { font-size: 0.75rem; }
}

/* ===== BREADCRUMBS ===== */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-2);
  padding: 12px 0 4px;
  max-width: 1200px;
  margin: 0 auto;
}
.breadcrumb a {
  color: var(--text-2);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--primary);
  text-decoration: underline;
}
.breadcrumb span {
  color: var(--text);
  font-weight: 500;
}

/* ===== RELATED TOOLS ===== */
.related-tools {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}
.related-tools h2 {
  font-size: 1.3rem;
  margin-bottom: 16px;
  color: var(--text);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.related-card {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  box-shadow: var(--shadow);
}
.related-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.rc-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--text);
}
.rc-desc {
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.4;
}

/* ===== PREMIUM HEADER ===== */
header {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
}

/* ===== PREMIUM THEME TOGGLE ===== */
.theme-toggle {
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.theme-toggle:hover {
  background: var(--border);
  transform: rotate(15deg);
}
.theme-toggle::after {
  display: none !important;
}
.theme-toggle-icon {
  font-size: 1.1rem;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: absolute !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
}
[data-theme="light"] .theme-toggle-icon.sun {
  opacity: 1;
  transform: scale(1);
}
[data-theme="light"] .theme-toggle-icon.moon {
  opacity: 0;
  transform: scale(0) rotate(-45deg);
}
[data-theme="dark"] .theme-toggle-icon.sun {
  opacity: 0;
  transform: scale(0) rotate(45deg);
}
[data-theme="dark"] .theme-toggle-icon.moon {
  opacity: 1;
  transform: scale(1);
}


/* ===== HERO CANVAS & CARD ENTRANCE ===== */
.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.tool-card {
  opacity: 0;
  animation: cardEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ===== RESPONSIVE UTILITY GRIDS ===== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr !important;
  }
}

/* ===== 10X FEATURE STYLES: STARRED & RECENTS ===== */
.tool-card {
  position: relative;
}

/* Star button inside cards */
.tc-star-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  color: var(--text-2);
}
.tool-card:hover .tc-star-btn {
  opacity: 1;
  transform: scale(1);
}
.tc-star-btn:hover {
  background: var(--surface);
  border-color: var(--primary);
  color: #eab308;
  transform: scale(1.1);
}
.tc-star-btn.active {
  opacity: 1;
  transform: scale(1);
  color: #eab308;
  background: var(--surface);
  border-color: #fef08a;
}
.tc-star-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Recent tools bar */
.hp-recent-container {
  max-width: 650px;
  margin: -10px auto 30px;
  padding: 0 20px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-2);
}
.hp-recent-label {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}
.hp-recent-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hp-recent-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 12px;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.hp-recent-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

/* Favorites section header */
.hp-section-header {
  max-width: 1200px;
  margin: 40px auto 16px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hp-section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  font-family: var(--display);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Quick utility class for CSS grid transitions */
.fade-out {
  opacity: 0 !important;
  transform: scale(0.9) translateY(10px) !important;
  transition: all 0.25s ease-in-out;
}

/* ===== TEXTAREA ACTIONS UPGRADE ===== */
.textarea-actions-wrapper {
  position: relative;
  width: 100%;
  margin: 8px 0;
}
.textarea-actions-panel {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px;
  border-radius: 6px;
  opacity: 0.6;
  transition: opacity 0.2s, background-color 0.2s;
  z-index: 5;
}
.textarea-actions-wrapper:hover .textarea-actions-panel {
  opacity: 1;
  background: var(--surface);
}
.tx-action-btn {
  background: transparent;
  border: none;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-2);
  transition: all 0.2s;
}
.tx-action-btn:hover {
  background: var(--surface-2);
  color: var(--primary);
  transform: scale(1.05);
}
.textarea-actions-wrapper textarea {
  padding-right: 96px !important; /* Make sure text doesn't overlap the floating panel */
}

/* Mobile responsive adjustments for floating action panels */
@media (max-width: 600px) {
  .textarea-actions-wrapper {
    display: flex;
    flex-direction: column;
  }
  .textarea-actions-panel {
    position: relative;
    top: auto;
    right: auto;
    order: -1;
    margin-bottom: 6px;
    align-self: flex-end;
    opacity: 1;
    background: var(--surface-2);
    border-color: var(--border);
  }
  .textarea-actions-wrapper textarea {
    padding-right: 14px !important;
  }
}



