/*
 * Micro Tools Site Styles
 *
 * This stylesheet defines the visual appearance for the Micro Tools website.
 * It follows a clean, modern aesthetic with a soft glass feel. Colors are
 * defined as CSS variables for easy customization. Focus states and
 * responsive layouts ensure accessibility and usability across devices.
 */

:root {
  --bg: #F6FFF8;
  --card: #FFFFFF;
  --text: #0B2B1D;
  --muted: #5A7A6B;
  --primary: #16A34A;
  --accent: #A3FF12;
  --border: rgba(11,43,29,0.12);
  --radius: 10px;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.5;
}

/* Subtle premium background: soft gradients + faint noise (no external assets) */
body {
  position: relative;
  min-height: 100vh;
  background-image:
    radial-gradient(900px 500px at 15% -10%, rgba(22,163,74,0.16), transparent 55%),
    radial-gradient(700px 400px at 85% 0%, rgba(163,255,18,0.14), transparent 60%),
    radial-gradient(900px 600px at 50% 110%, rgba(22,163,74,0.10), transparent 55%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}

/* Ensure visible focus outlines for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Sticky header */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

header input[type="search"] {
  width: 100%;
  max-width: 300px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
}

/* Hero section with gradient */
.hero {
  padding: 3rem 1rem 2rem;
  text-align: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: var(--card);
}

.hero h1 {
  margin: 0;
  font-size: 2.5rem;
}

.hero p {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  color: rgba(255,255,255,0.9);
}

.categories {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-chip {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.2);
  color: var(--card);
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.category-chip.active,
.category-chip:hover {
  background: var(--card);
  color: var(--primary);
}

/* Grid of cards on index */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  padding: 2rem 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(11,43,29,0.08);
  backdrop-filter: blur(6px);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 10px rgba(11,43,29,0.15);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  color: var(--primary);
}

.card p {
  flex-grow: 1;
  margin: 0 0 1rem;
  color: var(--muted);
}

.card .button {
  align-self: flex-start;
}

/* Buttons */
.button {
  display: inline-block;
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-weight: 600;
  background: var(--primary);
  color: var(--card);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.button:hover {
  background: var(--accent);
  color: var(--text);
}

.button.secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.button.secondary:hover {
  background: var(--primary);
  color: var(--card);
}

/* Inputs & controls */
input[type="text"],
input[type="number"],
input[type="datetime-local"],
input[type="color"],
select,
textarea,
input[type="file"],
input[type="range"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  box-sizing: border-box;
}

textarea {
  resize: vertical;
}

label {
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 0.25rem;
}

/* Tool page layout */
.tool-page {
  padding: 2rem 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.tool-desc {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.tool-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.tool-form .actions {
  display: flex;
  gap: 0.5rem;
}

/* FAQ and related sections */
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}

.faq summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--primary);
}

.related ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.related li {
  margin: 0;
}

.related a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px dashed var(--primary);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.related a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Footer */
footer {
  padding: 2rem 1rem;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

footer nav a {
  color: var(--primary);
  text-decoration: none;
  margin: 0 0.25rem;
}

footer nav a:hover {
  color: var(--accent);
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--card);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1001;
}

.toast.show {
  opacity: 1;
}

/* Example toggle label */
.example-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.example-toggle input {
  margin: 0;
}