/* MiToolHub Design System — Indigo + Zinc, glassmorphic */
:root {
  --brand: #6366f1;
  --brand-hover: #4f46e5;
  --brand-glow: rgba(99, 102, 241, 0.35);
  --surface: #fafafa;
  --ink: #18181b;
  --radius: 1rem;
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

html.dark {
  --surface: #09090b;
  --ink: #fafafa;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--surface);
  color: var(--ink);
  min-height: 100vh;
}

.font-display {
  font-family: var(--font-display);
}

/* Header / Navbar — always sticky and fully visible (Google-style) */
[data-mh-header] {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: var(--surface);
}

html.dark [data-mh-header] {
  background: var(--surface);
}

/* Atmospheric background */
.mh-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(99, 102, 241, 0.12), transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(99, 102, 241, 0.08), transparent 45%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(161, 161, 170, 0.08), transparent 50%);
}

html.dark .mh-atmosphere {
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(99, 102, 241, 0.18), transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(79, 70, 229, 0.12), transparent 45%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(39, 39, 42, 0.5), transparent 50%);
}

/* Glassmorphism */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(228, 228, 231, 0.8);
}

html.dark .glass {
  background: rgba(24, 24, 27, 0.8);
  border-color: rgba(39, 39, 42, 0.9);
}

.glass-strong {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(228, 228, 231, 0.9);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

html.dark .glass-strong {
  background: rgba(24, 24, 27, 0.92);
  border-color: rgba(63, 63, 70, 0.8);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Brand accents */
.btn-brand {
  background: var(--brand);
  color: #fff;
  transition: all 0.3s ease-in-out;
}

.btn-brand:hover {
  background: var(--brand-hover);
  box-shadow: 0 0 0 4px var(--brand-glow);
}

.btn-brand:active {
  transform: scale(0.95);
}

.focus-brand:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.ring-brand {
  --tw-ring-color: var(--brand);
}

/* Tool cards */
.tool-card {
  transition: all 0.3s ease-in-out;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

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

.tool-card:active {
  transform: scale(0.98);
}

/* Dropzone */
.dropzone {
  border: 2px dashed rgb(212, 212, 216);
  transition: all 0.3s ease-in-out;
  cursor: pointer;
}

html.dark .dropzone {
  border-color: rgb(63, 63, 70);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--brand);
  background: rgba(99, 102, 241, 0.06);
}

.dropzone.dragover {
  box-shadow: inset 0 0 0 2px var(--brand-glow);
}

/* Progress bar */
.progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgb(228, 228, 231);
  overflow: hidden;
}

html.dark .progress-track {
  background: rgb(63, 63, 70);
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #818cf8);
  transition: width 0.3s ease-in-out;
}

/* Skeleton + shimmer */
.skeleton {
  background: linear-gradient(
    90deg,
    rgb(228, 228, 231) 25%,
    rgb(244, 244, 245) 50%,
    rgb(228, 228, 231) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 0.5rem;
}

html.dark .skeleton {
  background: linear-gradient(
    90deg,
    rgb(39, 39, 42) 25%,
    rgb(63, 63, 70) 50%,
    rgb(39, 39, 42) 75%
  );
  background-size: 200% 100%;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-line { height: 0.875rem; margin-bottom: 0.5rem; }
.skeleton-line.w-3-4 { width: 75%; }
.skeleton-line.w-1-2 { width: 50%; }
.skeleton-block { height: 7.5rem; width: 100%; }

/* Modals */

.modal-backdrop {
  background: rgba(9, 9, 11, 0.55);
  backdrop-filter: blur(6px);
}

.modal-enter {
  animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Diff colors */
.diff-add { background: rgba(34, 197, 94, 0.15); }
.diff-del { background: rgba(239, 68, 68, 0.15); }
.diff-add-line { border-left: 3px solid rgb(34, 197, 94); }
.diff-del-line { border-left: 3px solid rgb(239, 68, 68); }

/* Beta badge */
.badge-beta {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--brand);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

/* Tool workspace panel (standalone tool pages) */
.tool-panel {
  display: block;
}

.tool-panel.active {
  animation: fadeSlide 0.3s ease-out;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* JSON tree */
.json-tree ul { list-style: none; padding-left: 1.25rem; }
.json-tree .key { color: var(--brand); }
.json-tree .string { color: #059669; }
html.dark .json-tree .string { color: #34d399; }
.json-tree .number { color: #d97706; }
.json-tree .boolean { color: #db2777; }
.json-tree .null { color: #71717a; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgb(212, 212, 216);
  border-radius: 999px;
}
html.dark ::-webkit-scrollbar-thumb { background: rgb(63, 63, 70); }

/* RTL helpers for future ar/ */
[dir="rtl"] .tool-card:hover { transform: translateY(-4px); }
[dir="rtl"] .json-tree ul { padding-left: 0; padding-right: 1.25rem; }

/* Language dropdown */
.mh-lang-menu {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.mh-lang-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#mh-lang-chevron.rotate-180 {
  transform: rotate(180deg);
}

/* Tools dropdown (mega menu) */
.mh-dropdown-panel {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.mh-dropdown-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.mh-tools-menu {
  border: 1px solid rgba(228, 228, 231, 0.9);
}

html.dark .mh-tools-menu {
  border-color: rgba(63, 63, 70, 0.8);
}

.mh-tools-cat-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgb(161, 161, 170);
  margin-bottom: 0.4rem;
}

.mh-tools-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.6rem;
  font-size: 0.875rem;
  color: rgb(63, 63, 70);
  transition: all 0.2s ease-in-out;
}

html.dark .mh-tools-link {
  color: rgb(212, 212, 216);
}

.mh-tools-link:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--brand);
}

html.dark .mh-tools-link:hover {
  background: rgba(99, 102, 241, 0.16);
  color: #a5b4fc;
}

#mh-tools-chevron {
  transition: transform 0.18s ease;
}

#mh-tools-chevron.rotate-180 {
  transform: rotate(180deg);
}

/* Tools dropdown — open on hover (no gap between button and menu) */
#mh-tools-wrap:hover #mh-tools-menu {
  display: block !important;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#mh-tools-wrap:hover #mh-tools-chevron {
  transform: rotate(180deg);
}


/* Navbar search (compact, in header) */

.mh-nav-search {
  position: relative;
  display: flex;
  align-items: center;
}

.mh-nav-search svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgb(161, 161, 170);
  pointer-events: none;
}

.mh-nav-search-input {
  width: 100%;
  min-width: 9rem;
  padding: 0.5rem 0.75rem 0.5rem 2.1rem;
  border-radius: 0.75rem;
  border: 1px solid rgb(228, 228, 231);
  background: rgba(255, 255, 255, 0.85);
  color: rgb(24, 24, 27);
  font-size: 0.875rem;
  transition: all 0.3s ease-in-out;
}

html.dark .mh-nav-search-input {
  border-color: rgb(63, 63, 70);
  background: rgba(24, 24, 27, 0.85);
  color: rgb(250, 250, 250);
}

.mh-nav-search-input::placeholder {
  color: rgb(161, 161, 170);
}

.mh-nav-search-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.mh-nav-search--mobile {
  width: 100%;
}

.tool-card.is-filtered-out,
[data-category-header].is-filtered-out {
  display: none !important;
}

/* Ad slots — collapse cleanly when empty (no forced height) */
.mh-ad-slot {
  transition: all 0.3s ease-in-out;
}

.mh-ad-slot:empty {
  display: none;
}



