.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

.hidden {
  display: none !important;
}

#primary-nav {
  display: none;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

#primary-nav:not(.hidden) {
  display: flex;
}

@media (min-width: 1024px) {
  #primary-nav,
  #primary-nav.hidden {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 0.125rem;
  }
}

#nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid #99f6e4;
  background: #f0fdfa;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f766e;
  cursor: pointer;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: background 0.3s ease, border-color 0.3s ease;
}

#nav-toggle:hover {
  background: #ccfbf1;
  border-color: #5eead4;
}

@media (min-width: 1024px) {
  #nav-toggle {
    display: none;
  }
}

.py-10 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

@media (min-width: 640px) {
  .sm\:py-10 {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
}

body {
  padding-top: 64px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 60;
  transform: translateY(-200%);
  border-radius: 0.75rem;
  background: #0f172a;
  color: #fff;
  padding: 0.75rem 1rem;
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.nav-link,
.footer-link {
  transition: all 0.2s ease;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  display: inline-block;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.nav-link:hover,
.footer-link:hover {
  color: #0f766e;
  background: #f0fdfa;
}

.nav-link {
  position: relative;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  letter-spacing: normal;
  line-height: 1.25;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #0f766e, #ea580c);
  transition: all 0.3s ease;
  transform: translateX(-50%);
  border-radius: 1px;
}

.nav-link:hover::after {
  width: 60%;
}

/* Dropdown Menu Styles */
.nav-dropdown {
  position: relative;
  font-size: 0.8125rem !important;
}

.nav-link-main {
  display: inline-flex;
  align-items: center;
}

.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 9999;
  min-width: 220px;
  transform: translateY(8px);
}

.nav-dropdown:hover .submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.submenu-inner {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.5rem;
  min-width: 220px;
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
}

.submenu-item {
  display: block;
  padding: 0.4rem 0.65rem;
  font-size: 0.75rem !important;
  font-weight: 500;
  color: #475569;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: normal;
  line-height: 1.4;
}

.submenu-item:hover {
  background: #f0fdfa;
  color: #0f766e;
}

.submenu-view-all {
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e2e8f0;
  color: #0f766e;
  font-weight: 600;
}

.submenu-view-all:hover {
  background: #0f766e;
  color: white;
}

.hero-shell {
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.14), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.ad-shell {
  display: none;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 1));
}

.ad-slot {
  display: none;
  min-height: 120px;
  align-items: center;
  justify-content: center;
  border: 1px dashed #94a3b8;
  border-radius: 1.5rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(241, 245, 249, 0.95)),
    repeating-linear-gradient(
      -45deg,
      rgba(148, 163, 184, 0.08),
      rgba(148, 163, 184, 0.08) 12px,
      transparent 12px,
      transparent 24px
    );
  color: #475569;
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}

.ad-slot--leaderboard {
  min-height: 90px;
}

.ad-slot--feed {
  min-height: 180px;
}

.ad-slot--sidebar {
  min-height: 600px;
}

.tool-card {
  display: block;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  background: #fff;
  padding: 1.5rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: #94a3b8;
  box-shadow: 0 24px 55px rgba(15, 23, 42, 0.08);
}

.tool-card h3 {
  margin-top: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
}

.tool-card p {
  margin-top: 0.75rem;
  color: #475569;
  line-height: 1.75;
}

.tool-card--link:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.35);
  outline-offset: 4px;
}

.tool-icon {
  display: inline-flex;
  min-height: 3rem;
  min-width: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: #ecfeff;
  color: #115e59;
  font-size: 1rem;
  font-weight: 700;
}

.tool-textarea {
  min-height: 22rem;
  width: 100%;
  resize: vertical;
  border-radius: 1.25rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  padding: 1rem;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.7;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-textarea:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.tool-input,
.tool-input-file {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-input:focus,
.tool-input-file:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.tool-select,
.tool-range {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-select:focus,
.tool-range:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.metric-card,
.calc-card,
.preview-panel {
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  background: #f8fafc;
  padding: 1.25rem;
}

.metric-label,
.preview-title,
.calc-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.metric-value {
  display: block;
  margin-top: 0.65rem;
  font-size: 1.8rem;
  font-weight: 700;
  color: #0f172a;
}

.calc-result {
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

.preview-panel {
  min-height: 20rem;
}

.preview-image {
  display: block;
  max-height: 17rem;
  width: 100%;
  margin-top: 1rem;
  border-radius: 1rem;
  object-fit: contain;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.preview-placeholder {
  margin-top: 1rem;
  color: #64748b;
  line-height: 1.7;
}

.tool-output {
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  background: #f8fafc;
  padding: 1rem;
  color: #0f172a;
  line-height: 1.7;
  word-break: break-word;
}

.tool-output--mono {
  font-family: Consolas, Monaco, "Courier New", monospace;
}

.tool-button {
  border-radius: 1rem;
  padding: 0.8rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tool-button--primary {
  background: #0f766e;
  color: #fff;
}

.tool-button--primary:hover {
  background: #115e59;
}

.tool-button--secondary {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
}

.tool-button--secondary:hover,
.tool-button--ghost:hover {
  background: #f1f5f9;
}

.tool-button--ghost {
  border: 1px solid transparent;
  background: #fff;
  color: #334155;
}

.tab-btn {
  border-radius: 0.75rem 0.75rem 0 0;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  background: #f1f5f9;
  color: #64748b;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tab-btn:hover {
  background: #e2e8f0;
  color: #334155;
}

.tab-btn--active {
  background: #fff;
  color: #0f172a;
  border-color: #dbe4ee;
  border-bottom-color: #fff;
}

.tool-card.is-hidden,
.tool-card-enhanced.is-hidden,
a[data-tool-name].is-hidden,
.category-section.is-hidden {
  display: none;
}

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  max-height: 320px;
  overflow-y: auto;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
  z-index: 100;
}
.search-dropdown.hidden { display: none; }
.search-dropdown-cat {
  padding: 8px 16px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #0f766e;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
  z-index: 1;
}
.search-dropdown-cat:first-child { border-top: none; }
.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: #334155;
  text-decoration: none;
  transition: background 0.15s;
  cursor: pointer;
}
.search-dropdown-item:hover {
  background: #f0fdfa;
  color: #0f766e;
}
.search-dropdown-item .sd-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.search-dropdown-item .sd-name { font-weight: 500; }
.search-dropdown-item .sd-desc {
  font-size: 12px;
  color: #94a3b8;
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.search-dropdown-empty {
  padding: 20px 16px;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
}
.search-dropdown::-webkit-scrollbar { width: 6px; }
.search-dropdown::-webkit-scrollbar-track { background: transparent; }
.search-dropdown::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.drag-drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 8rem;
  border: 2px dashed #cbd5e1;
  border-radius: 1rem;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  padding: 1.5rem;
}

.drag-drop-zone:hover {
  border-color: #0f766e;
  background: #f0fdfa;
}

.drag-drop-zone.has-file {
  border-color: #0f766e;
  border-style: solid;
  background: #f0fdfa;
}

.drag-drop-zone.is-dragover {
  border-color: #0f766e;
  background: #ccfbf1;
  transform: scale(1.01);
}

.drag-drop-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: #475569;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  pointer-events: none;
}

.drag-drop-icon {
  width: 2rem;
  height: 2rem;
  color: #94a3b8;
}

.drag-drop-zone.is-dragover .drag-drop-icon {
  color: #0f766e;
}

.drag-drop-hint {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: #0f766e;
  font-weight: 600;
  text-align: center;
  min-height: 1.25rem;
  word-break: break-all;
}

.jwt-tab-container {
  position: relative;
  display: flex;
  gap: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0.375rem;
}

.jwt-tab {
  position: relative;
  z-index: 1;
  flex: 1;
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
  text-align: center;
}

.jwt-tab:hover {
  color: #0f172a;
}

.jwt-tab--active {
  color: #0f766e;
}

.jwt-tab--active:hover {
  color: #0f766e;
}

.jwt-tab-indicator {
  position: absolute;
  top: 0.375rem;
  bottom: 0.375rem;
  border-radius: 0.5rem;
  background: #fff;
  border: 1px solid #0f766e;
  box-shadow: 0 1px 3px rgba(15, 118, 110, 0.1);
  transition: left 0.2s ease, width 0.2s ease;
  pointer-events: none;
}

/* Dark mode JWT tabs */
html.dark .jwt-tab-container {
  background: rgba(15, 23, 42, 0.8);
  border-color: #1e2d4a;
  backdrop-filter: blur(8px);
}

html.dark .jwt-tab {
  color: #64748b;
}

html.dark .jwt-tab:hover {
  color: #e2e8f0;
}

html.dark .jwt-tab--active {
  color: #2dd4bf;
}

html.dark .jwt-tab--active:hover {
  color: #2dd4bf;
}

html.dark .jwt-tab-indicator {
  background: rgba(30, 41, 59, 0.9);
  border-color: #2dd4bf;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.2);
}

.jwt-json-block {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8fafc;
  padding: 0.75rem 1rem;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #0f172a;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Enhanced Visual Styles */
.hero-gradient {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 50%, #134e4a 100%);
  position: relative;
  overflow: hidden;
}

.hero-gradient::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(234,88,12,0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-gradient::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.floating-shapes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  animation: float 6s ease-in-out infinite;
}

.shape-1 { width: 80px; height: 80px; background: rgba(234,88,12,0.2); top: 15%; right: 8%; animation-delay: 0s; }
.shape-2 { width: 50px; height: 50px; background: rgba(255,255,255,0.15); top: 55%; right: 20%; animation-delay: 1s; }
.shape-3 { width: 100px; height: 100px; background: rgba(255,255,255,0.08); bottom: 10%; right: 5%; animation-delay: 2s; }
.shape-4 { width: 40px; height: 40px; background: rgba(234,88,12,0.15); top: 30%; left: 5%; animation-delay: 3s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(10deg); }
}

.tagline-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}

.hero-btn-primary {
  background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
  color: white;
  border: none;
  padding: 0.875rem 2rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.hero-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(234,88,12,0.4);
}

.hero-btn-primary:hover::before {
  left: 100%;
}

.hero-btn-secondary {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.875rem 2rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-btn-secondary:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-2px);
}

.stats-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
  transition: all 0.3s ease;
}

.stats-card:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}

.stats-value {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff, #a7f3d0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  margin-top: 0.25rem;
}

.feature-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0f766e, #ea580c);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(15, 118, 110, 0.12);
  border-color: #0f766e;
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

.feature-icon-teal { background: linear-gradient(135deg, #0f766e, #115e59); color: white; }
.feature-icon-orange { background: linear-gradient(135deg, #ea580c, #dc2626); color: white; }
.feature-icon-blue { background: linear-gradient(135deg, #0284c7, #0369a1); color: white; }
.feature-icon-purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: white; }

.tool-card-enhanced {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: block;
}

.tool-card-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0f766e, #ea580c);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tool-card-enhanced:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(15, 118, 110, 0.12);
  border-color: #0f766e;
  text-decoration: none;
}

.tool-card-enhanced:hover::before {
  opacity: 1;
}

.tool-card-enhanced h3 {
  font-weight: 600;
  color: #0f172a;
}

.tool-card-enhanced p {
  color: #64748b;
  line-height: 1.6;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.category-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}

.footer-gradient {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  position: relative;
  overflow: hidden;
}

.footer-gradient::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(15,118,110,0.2) 0%, transparent 70%);
  border-radius: 50%;
}

/* Tool page input enhancement */
.input-enhanced {
  width: 100%;
  border-radius: 0.75rem;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  padding: 0.875rem 1rem;
  font-size: 0.95rem;
  color: #0f172a;
  outline: none;
  transition: all 0.3s ease;
}

.input-enhanced:focus {
  border-color: #0f766e;
  background: white;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

.btn-enhanced {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  color: white;
  border: none;
  padding: 0.875rem 2rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-enhanced:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.35);
}

.btn-enhanced:hover::before {
  left: 100%;
}

.btn-enhanced:active {
  transform: translateY(0);
}

.result-card {
  background: linear-gradient(135deg, #f0fdfa 0%, #ecfeff 100%);
  border: 2px solid #0f766e;
  border-radius: 1.5rem;
  position: relative;
  overflow: hidden;
}

.result-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(15,118,110,0.1) 0%, transparent 70%);
}

.bmi-value-display {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #0f766e, #ea580c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.category-underweight { background: #dbeafe; color: #1e40af; }
.category-normal { background: #d1fae5; color: #065f46; }
.category-overweight { background: #fef3c7; color: #92400e; }
.category-obese { background: #fee2e2; color: #991b1b; }

html.dark .category-underweight { background: rgba(30, 64, 175, 0.3); color: #93c5fd; }
html.dark .category-normal { background: rgba(6, 95, 70, 0.3); color: #6ee7b7; }
html.dark .category-overweight { background: rgba(146, 64, 14, 0.3); color: #fcd34d; }
html.dark .category-obese { background: rgba(153, 27, 27, 0.3); color: #fca5a5; }

@media (max-width: 1279px) {
  .ad-slot--sidebar {
    min-height: 250px;
  }
}

/* ===== DARK MODE ===== */
html.dark {
  color-scheme: dark;
  transition: background 0.3s ease, color 0.3s ease;
}

html.dark body {
  background: linear-gradient(180deg, #0c1222 0%, #0f172a 50%, #111827 100%);
  color: #e2e8f0;
}

html.dark .bg-slate-50 { background: #0c1222 !important; }
html.dark .bg-white { background: rgba(30, 41, 59, 0.7) !important; border-color: #1e2d4a !important; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
html.dark .bg-white\/10 { background: rgba(30,41,59,0.5); }
html.dark .bg-white\/60 { background: rgba(30,41,59,0.6) !important; }

html.dark .text-slate-900 { color: #f1f5f9; }
html.dark .text-slate-800 { color: #e2e8f0; }
html.dark .text-slate-700 { color: #cbd5e1; }
html.dark .text-slate-600 { color: #94a3b8; }

html.dark .border-slate-200 { border-color: #1e2d4a; }
html.dark .border-slate-300 { border-color: #2a3a52; }

html.dark .tool-input,
html.dark .tool-input-file,
html.dark .tool-select,
html.dark .tool-textarea {
  background: rgba(30, 41, 59, 0.8);
  border-color: #2a3a52;
  color: #e2e8f0;
  backdrop-filter: blur(8px);
}

html.dark .tool-input::placeholder,
html.dark .tool-textarea::placeholder {
  color: #64748b;
}

html.dark .tool-button--secondary {
  background: rgba(30, 41, 59, 0.8);
  border-color: #2a3a52;
  color: #e2e8f0;
}

html.dark .tool-button--secondary:hover {
  background: #2a3a52;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

html.dark .tool-button--primary {
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.25);
}

html.dark .tool-button--primary:hover {
  box-shadow: 0 0 30px rgba(45, 212, 191, 0.4);
}

html.dark .tab-btn {
  background: rgba(30, 41, 59, 0.6);
  color: #94a3b8;
  border-color: #2a3a52;
}

html.dark .tab-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
}

html.dark .tab-btn--active {
  background: #1e293b;
  color: #f1f5f9;
  border-color: #38bdf8;
}

html.dark .search-dropdown {
  background: #1e293b;
  border-color: #2a3a52;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
html.dark .search-dropdown-cat {
  background: #0f172a;
  color: #5eead4;
  border-color: #1e293b;
}
html.dark .search-dropdown-item { color: #e2e8f0; }
html.dark .search-dropdown-item:hover { background: rgba(15,118,110,0.15); color: #5eead4; }
html.dark .search-dropdown-item .sd-desc { color: #64748b; }
html.dark .search-dropdown-empty { color: #64748b; }

html.dark .metric-card,
html.dark .calc-card,
html.dark .preview-panel,
html.dark .tool-output {
  background: rgba(30, 41, 59, 0.7);
  border-color: #1e2d4a;
  color: #e2e8f0;
  backdrop-filter: blur(12px);
}

html.dark .tool-textarea {
  background: rgba(30, 41, 59, 0.8);
  border-color: #2a3a52;
  color: #e2e8f0;
}

html.dark .submenu-inner {
  background: rgba(15, 23, 42, 0.95);
  border-color: #1e2d4a;
  backdrop-filter: blur(16px);
}

html.dark .submenu-item {
  color: #cbd5e1;
  transition: all 0.2s ease;
}

html.dark .submenu-item:hover {
  background: rgba(45, 212, 191, 0.1);
  color: #2dd4bf;
  border-left: 2px solid #2dd4bf;
}

html.dark .ad-slot {
  background: rgba(30, 41, 59, 0.5);
  border-color: #1e2d4a;
  color: #64748b;
}

html.dark .skip-link {
  background: #1e293b;
}

html.dark .hero-shell {
  background: radial-gradient(circle at top left, rgba(45, 212, 191, 0.15), transparent 40%),
    radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.08), transparent 40%),
    linear-gradient(180deg, #0c1222 0%, #0f172a 100%);
}

/* Tool cards glow effect in dark mode */
html.dark a[href*="tools/"] {
  transition: all 0.3s ease;
}

html.dark a[href*="tools/"]:hover {
  box-shadow: 0 8px 32px rgba(45, 212, 191, 0.12), 0 0 0 1px rgba(45, 212, 191, 0.15);
}

/* Category section labels */
html.dark .text-teal-600 {
  color: #2dd4bf;
}

/* Section headings */
html.dark h2 {
  color: #f1f5f9;
}

html.dark h3 {
  color: #f1f5f9;
}

html.dark p {
  color: #cbd5e1;
}

/* Tool page specific */
html.dark .tool-section,
html.dark .tool-section-full {
  background: rgba(30, 41, 59, 0.7);
  border-color: #1e2d4a;
  color: #e2e8f0;
  backdrop-filter: blur(12px);
}

html.dark .section-title {
  color: #f1f5f9;
}

/* Footer */
html.dark footer {
  background: #080e1a;
  border-color: #1e2d4a;
  color: #94a3b8;
}

/* Breadcrumb */
html.dark .breadcrumb {
  color: #64748b;
}

html.dark .breadcrumb a {
  color: #94a3b8;
}

/* Scroll to top */
html.dark .scroll-top-btn {
  background: rgba(30, 41, 59, 0.9);
  border-color: #1e2d4a;
  color: #e2e8f0;
  backdrop-filter: blur(8px);
}

html.dark .scroll-top-btn:hover {
  background: rgba(45, 212, 191, 0.2);
  border-color: #2dd4bf;
  color: #2dd4bf;
}

/* ===== FOCUS INDICATORS (Accessibility) ===== */
:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.5);
  outline-offset: 2px;
  border-radius: 4px;
}

.tool-button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.5);
  outline-offset: 2px;
}

/* Dark mode overrides for hardcoded backgrounds */
html.dark .tool-card {
  background: rgba(30, 41, 59, 0.7);
  border-color: #1e2d4a;
  backdrop-filter: blur(12px);
}

html.dark .tool-card:hover {
  border-color: #2a3a52;
}

html.dark .tool-textarea {
  background: rgba(30, 41, 59, 0.8);
  border-color: #2a3a52;
  color: #e2e8f0;
}

html.dark .tool-output {
  background: rgba(30, 41, 59, 0.7);
  border-color: #1e2d4a;
  color: #e2e8f0;
}

html.dark .metric-card {
  background: rgba(30, 41, 59, 0.7);
  border-color: #1e2d4a;
  color: #e2e8f0;
}

html.dark .calc-card {
  background: rgba(30, 41, 59, 0.7);
  border-color: #1e2d4a;
  color: #e2e8f0;
}

html.dark .preview-panel {
  background: rgba(30, 41, 59, 0.7);
  border-color: #1e2d4a;
  color: #e2e8f0;
}

/* Dark mode for stat cards and other light backgrounds */
html.dark .bg-white {
  background: rgba(30, 41, 59, 0.7) !important;
  border-color: #1e2d4a !important;
  backdrop-filter: blur(12px);
}

html.dark .bg-slate-50 {
  background: #0c1222 !important;
}

/* Dark mode for form labels and text */
html.dark .text-slate-800 {
  color: #e2e8f0 !important;
}

html.dark .text-slate-700 {
  color: #cbd5e1 !important;
}

/* Dark mode for stat cards */
html.dark [style*="background: linear-gradient(135deg, #ffffff"] {
  background: rgba(30, 41, 59, 0.7) !important;
  border-color: #1e2d4a !important;
}

/* ===== LOADING SKELETON ===== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.5rem;
}

html.dark .skeleton {
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.7) 25%, rgba(45, 212, 191, 0.08) 50%, rgba(30, 41, 59, 0.7) 75%);
  background-size: 200% 100%;
}

@media (max-width: 1023px) {
  .submenu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    box-shadow: none;
    border: none;
    padding: 0;
    min-width: auto;
  }

  .submenu-inner {
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0.25rem 0 0.25rem 1rem;
  }

  .nav-dropdown:hover .submenu {
    transform: none;
  }
}

.theme-toggle-float {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  color: #334155;
}

.theme-toggle-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  border-color: #0f766e;
}

html.dark .theme-toggle-float {
  background: rgba(15, 23, 42, 0.9);
  border-color: #1e2d4a;
  color: #e2e8f0;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

html.dark .theme-toggle-float:hover {
  background: rgba(45, 212, 191, 0.15);
  border-color: #2dd4bf;
  color: #2dd4bf;
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.2);
}

/* Tool cards - override inline styles with glassmorphism */
html.dark a[style*="background: linear-gradient"],
html.dark a[style*="background:linear-gradient"] {
  background: rgba(30, 41, 59, 0.6) !important;
  border-color: #1e2d4a !important;
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}

html.dark a[style*="background: linear-gradient"]:hover,
html.dark a[style*="background:linear-gradient"]:hover {
  box-shadow: 0 8px 32px rgba(45, 212, 191, 0.12), 0 0 0 1px rgba(45, 212, 191, 0.15);
  transform: translateY(-2px);
}

html.dark a[style*="background: linear-gradient"] h3,
html.dark a[style*="background:linear-gradient"] h3 {
  color: #f1f5f9 !important;
}

html.dark a[style*="background: linear-gradient"] p,
html.dark a[style*="background:linear-gradient"] p {
  color: #94a3b8 !important;
}

/* Section headings */
html.dark h2 {
  color: #f1f5f9;
}

html.dark h3 {
  color: #f1f5f9;
}

html.dark p {
  color: #cbd5e1;
}

/* Category section labels */
html.dark .text-teal-600 {
  color: #2dd4bf;
}

/* Form elements */
html.dark input[type="text"],
html.dark input[type="number"],
html.dark input[type="email"],
html.dark input[type="url"],
html.dark input[type="password"],
html.dark input[type="search"],
html.dark input:not([type]),
html.dark textarea,
html.dark select {
  background: rgba(30, 41, 59, 0.8);
  border-color: #2a3a52;
  color: #e2e8f0;
  backdrop-filter: blur(8px);
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #64748b;
}

/* Buttons */
html.dark button {
  color: #e2e8f0;
}

/* Links in dark mode */
html.dark a:not(.group):not(.nav-link):not(.submenu-item) {
  color: #2dd4bf;
}

/* Tool page specific */
html.dark .tool-section,
html.dark .tool-section-full {
  background: rgba(30, 41, 59, 0.7);
  border-color: #1e2d4a;
  color: #e2e8f0;
  backdrop-filter: blur(12px);
}

html.dark .section-title {
  color: #f1f5f9;
}

/* Footer */
html.dark footer {
  background: #080e1a;
  border-color: #1e2d4a;
  color: #94a3b8;
}

/* Breadcrumb */
html.dark .breadcrumb {
  color: #64748b;
}

html.dark .breadcrumb a {
  color: #94a3b8;
}

/* Scroll to top */
html.dark .scroll-top-btn {
  background: rgba(15, 23, 42, 0.9);
  border-color: #1e2d4a;
  color: #e2e8f0;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

html.dark .scroll-top-btn:hover {
  background: rgba(45, 212, 191, 0.15);
  border-color: #2dd4bf;
  color: #2dd4bf;
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.2);
}

/* Dice Face Styles */
.dice-face {
  width: 100px;
  height: 100px;
  background: white;
  border: 3px solid #e2e8f0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.12);
  transition: transform 0.2s ease;
}

.dice-face:hover {
  transform: scale(1.05);
}

.dice-face .text-5xl {
  line-height: 1;
}

/* Dice rolling animation */
@keyframes diceRoll {
  0% { transform: rotateX(0deg) rotateY(0deg); }
  25% { transform: rotateX(90deg) rotateY(90deg); }
  50% { transform: rotateX(180deg) rotateY(180deg); }
  75% { transform: rotateX(270deg) rotateY(270deg); }
  100% { transform: rotateX(360deg) rotateY(360deg); }
}

.dice-rolling {
  animation: diceRoll 0.4s linear infinite;
}

/* Quick Access Bar */
#fku-quick-access-chips { transition: opacity 0.15s ease; }
#fku-qa-prev, #fku-qa-next { transition: all 0.15s ease; }
#fku-qa-prev:active:not(:disabled), #fku-qa-next:active:not(:disabled) { transform: scale(0.9); }
