/* ============================================================
   ToolBox Express – Custom Styles
   Tailwind handles most styling; this file covers:
   - Reusable component classes not easily expressed in HTML
   - Custom toggle switches
   - Prose typography for static pages
   - Misc utilities
   ============================================================ */

/* ---- Nav links ---- */
.nav-link {
  @apply px-4 py-2 rounded-lg text-sm font-medium text-gray-600 hover:text-brand-600 hover:bg-brand-50 transition-all duration-150 focus:outline-none focus:ring-2 focus:ring-brand-400 focus:ring-offset-1;
}
.nav-link.active {
  @apply text-brand-600 bg-brand-50;
}
.nav-link-mobile {
  @apply w-full text-left px-4 py-3 rounded-xl text-sm font-medium text-gray-700 hover:text-brand-600 hover:bg-brand-50 transition-all focus:outline-none;
}
.nav-link-mobile.active {
  @apply text-brand-600 bg-brand-50;
}

/* ---- Toggle switch track ---- */
.toggle-label {
  @apply flex items-center justify-between gap-2 cursor-pointer select-none bg-gray-50 hover:bg-gray-100 border border-gray-200 rounded-xl px-3 py-2.5 text-sm font-medium text-gray-700 transition-colors;
}
.toggle-track {
  @apply relative flex-shrink-0 w-10 h-5 bg-gray-300 rounded-full transition-colors duration-200 ring-offset-1;
}
.toggle-track::after {
  content: '';
  @apply absolute left-0.5 top-0.5 w-4 h-4 bg-white rounded-full shadow transition-transform duration-200;
}
.peer:checked ~ .toggle-track::after {
  @apply translate-x-5;
}

/* ---- Countdown units ---- */
.countdown-unit {
  @apply flex flex-col items-center bg-white rounded-xl border border-gray-200 shadow-sm py-3;
}
.countdown-num {
  @apply text-3xl font-extrabold text-gray-900 leading-none tabular-nums;
}
.countdown-lbl {
  @apply text-xs font-semibold text-gray-400 uppercase tracking-widest mt-1;
}

/* ---- Form inputs ---- */
.form-input {
  @apply w-full border border-gray-200 rounded-xl px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-brand-400 focus:border-transparent transition placeholder-gray-400;
}
.form-error {
  @apply text-xs text-red-500 mt-1;
}

/* ---- Footer links ---- */
.footer-link {
  @apply text-gray-400 hover:text-gray-200 transition-colors focus:outline-none focus:underline;
}

/* ---- Prose (static content pages) ---- */
.prose-custom h2 {
  @apply text-xl font-bold text-gray-900 mt-8 mb-3;
}
.prose-custom p {
  @apply text-gray-600 leading-relaxed mb-4;
}
.prose-custom ul {
  @apply list-disc list-inside text-gray-600 space-y-1.5 mb-4 pl-2;
}
.prose-custom strong {
  @apply font-semibold text-gray-800;
}
.prose-custom em {
  @apply italic;
}
.prose-custom a {
  @apply text-brand-600 hover:underline;
}

/* ---- Page transitions ---- */
.page-section {
  @apply w-full;
}

/* ---- Strength bar colours ---- */
#strength-bar[data-level="weak"]   { @apply bg-red-400 w-1/4; }
#strength-bar[data-level="fair"]   { @apply bg-orange-400 w-2/4; }
#strength-bar[data-level="good"]   { @apply bg-yellow-400 w-3/4; }
#strength-bar[data-level="strong"] { @apply bg-emerald-500 w-full; }

/* ---- Smooth scroll ---- */
html { scroll-behavior: smooth; }

/* ---- Custom range slider (cross-browser) ---- */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #4f46e5;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(79,70,229,0.4);
  transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #4f46e5;
  border: none;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(79,70,229,0.4);
}

/* ---- Spinner keyframes (Tailwind animate-spin covers rotation, this is a fallback) ---- */
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 0.75s linear infinite; }

/* ---- Mobile responsiveness helpers ---- */
@media (max-width: 640px) {
  .countdown-num { font-size: 1.75rem; }
}
