/* BraisedEgg Tools - Global Styles
   Light theme with ocean blue accent
   Clean, professional, optimized for desktop + mobile */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-light: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #0ea5e9;
  --accent-hover: #0284c7;
  --accent-dim: rgba(14, 165, 233, 0.1);
  --accent-light: #e0f2fe;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --transition: 0.2s ease;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; width: 100%; }

/* ===== Header ===== */
.site-header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
.logo:hover { text-decoration: none; }
.logo-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 2px;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.nav { display: flex; gap: 28px; align-items: center; }
.nav a { color: var(--text-muted); font-size: 0.92rem; font-weight: 500; position: relative; transition: color var(--transition); }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.active { color: var(--text); font-weight: 600; }
.nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ===== Hamburger Toggle ===== */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s ease;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Mobile Nav Drawer ===== */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.25s;
}
.nav-overlay.open { display: block; opacity: 1; }
.nav-mobile {
  display: block;
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  max-width: 85vw;
  height: 100%;
  background: var(--surface);
  z-index: 151;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0,0,0,0.12);
}
.nav-mobile.open { transform: translateX(0); }
.nav-mobile-inner { padding: 20px; }
.nav-mobile-home {
  display: block;
  padding: 12px 0;
  color: var(--accent-hover);
  font-weight: 700;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.nav-mobile-tools {
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  margin-bottom: 8px;
}
.nav-mobile a {
  display: block;
  padding: 11px 0;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile a:hover { color: var(--accent-hover); text-decoration: none; }

/* ===== Breadcrumb ===== */
.breadcrumb-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  font-size: 0.88rem;
}
.breadcrumb-bar .container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.breadcrumb-back {
  color: var(--accent-hover);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.15s;
}
.breadcrumb-back:hover { gap: 8px; text-decoration: none; }
.breadcrumb-link { color: var(--text-muted); transition: color 0.15s; }
.breadcrumb-link:hover { color: var(--accent-hover); text-decoration: none; }
.breadcrumb-sep { color: var(--text-muted); opacity: 0.5; }
.breadcrumb-current { color: var(--text); font-weight: 500; }

/* ===== Main ===== */
main { flex: 1; padding: 0; }

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 56px 24px 40px;
  background: linear-gradient(180deg, var(--accent-light) 0%, var(--bg) 100%);
  margin-bottom: 8px;
}
.hero-badge {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent-hover);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}
.hero h1 { font-size: 2.4rem; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.02em; }
.hero p { font-size: 1.1rem; color: var(--text-muted); max-width: 600px; margin: 0 auto; }
.tool-count { color: var(--accent-hover); font-weight: 700; }

/* ===== Search Bar ===== */
.search-wrap { max-width: 560px; margin: 0 auto 16px; }
.search-bar {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}
.search-bar input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  font-family: inherit;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.4;
  pointer-events: none;
  line-height: 1;
}
.search-shortcut {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
  opacity: 0.7;
}

/* ===== Category Filters ===== */
.category-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.cat-btn {
  padding: 7px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.cat-btn:hover { border-color: var(--accent); color: var(--accent-hover); background: var(--accent-light); }
.cat-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== Tool Grid ===== */
.tools-section { padding: 24px 0 0; }
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 8px;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  display: block;
  color: inherit;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.35s ease backwards;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
  text-decoration: none;
}
.tool-card:hover::before { transform: scaleX(1); }
.tool-card .icon {
  font-size: 1.6rem;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--surface-light);
}
.tool-card h3 { font-size: 1.05rem; margin-bottom: 6px; color: var(--text); }
.tool-card p { font-size: 0.87rem; color: var(--text-muted); line-height: 1.5; }
.tool-tag {
  display: inline-block;
  margin-top: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-hover);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Staggered fade-in */
.tool-card:nth-child(1) { animation-delay: 0.03s; }
.tool-card:nth-child(2) { animation-delay: 0.06s; }
.tool-card:nth-child(3) { animation-delay: 0.09s; }
.tool-card:nth-child(4) { animation-delay: 0.12s; }
.tool-card:nth-child(5) { animation-delay: 0.15s; }
.tool-card:nth-child(6) { animation-delay: 0.18s; }
.tool-card:nth-child(n+7) { animation-delay: 0.21s; }

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

/* No results */
.no-results {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 1.05rem;
  grid-column: 1 / -1;
}
.no-results-icon { font-size: 2rem; margin-bottom: 8px; display: block; }

/* ===== Tool Page Layout ===== */
.tool-page { max-width: 820px; margin: 0 auto; padding: 24px 0; }
.tool-header { margin-bottom: 24px; }
.tool-header h1 { font-size: 1.8rem; margin-bottom: 8px; }
.tool-header p { color: var(--text-muted); }
.tool-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
textarea, input[type="text"], input[type="number"], input[type="email"], select, input[type="datetime-local"] {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
}
textarea::placeholder, input::placeholder { color: var(--text-muted); }
textarea { min-height: 160px; resize: vertical; }
textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--accent);
  color: #fff;
  font-family: inherit;
}
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn.secondary { background: var(--surface-light); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--border); }
.btn.success { background: #10b981; color: #fff; }
.output-box {
  margin-top: 16px;
  padding: 14px;
  background: var(--surface-light);
  border-radius: var(--radius-sm);
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 0.92rem;
  word-break: break-all;
  min-height: 48px;
  display: flex;
  align-items: center;
  color: var(--text);
}
.stats { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.stat {
  background: var(--surface-light);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.stat strong { color: var(--accent-hover); font-size: 1.2rem; display: block; }

/* ===== Ad Slot ===== */
.ad-slot {
  margin: 32px 0;
  padding: 16px;
  background: var(--surface-light);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-slot::before { content: "Ad Slot"; }

/* ===== Article ===== */
.article { max-width: 720px; margin: 40px auto; padding: 0 24px; }
.article h1 { font-size: 2rem; margin-bottom: 8px; }
.article .meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }
.article h2 { font-size: 1.4rem; margin: 28px 0 12px; }
.article h3 { font-size: 1.15rem; margin: 22px 0 10px; }
.article p { margin-bottom: 14px; color: var(--text-muted); }
.article ul, .article ol { margin: 0 0 14px 24px; }
.article li { margin-bottom: 6px; color: var(--text-muted); }
.article code {
  background: var(--surface-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accent-hover);
}
.article pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 14px 0;
}
.article pre code { background: none; padding: 0; color: inherit; }
.article blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 16px;
  color: var(--text-muted);
  margin: 14px 0;
}

/* ===== Features Section ===== */
.features { margin-top: 56px; padding: 0 24px; }
.features h2 { font-size: 1.5rem; text-align: center; margin-bottom: 28px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.feature-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.feature-icon { font-size: 2rem; display: block; margin-bottom: 10px; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.feature-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; }

/* ===== Footer ===== */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 40px 0 20px;
  margin-top: 60px;
}
.site-footer .container { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: #fff; margin-bottom: 12px; font-size: 1rem; }
.site-footer a { color: #94a3b8; display: block; padding: 4px 0; font-size: 0.9rem; transition: color var(--transition); }
.site-footer a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid #1e293b; margin-top: 24px; padding-top: 16px; font-size: 0.85rem; text-align: center; }

/* ===== Scroll-to-Top ===== */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
}
.scroll-top:hover { background: var(--accent-hover); transform: scale(1.08); }

/* ===== Color Converter Specific ===== */
.color-preview-row { display:flex; gap:16px; align-items:center; margin-bottom:20px; }
.color-inputs { display:grid; gap:12px; }
.color-swatch { width:80px; height:60px; padding:0; border:1px solid var(--border); border-radius:var(--radius-sm); cursor:pointer; flex-shrink:0; background:transparent; }
.color-preview { flex:1; height:60px; border-radius:var(--radius-sm); border:1px solid var(--border); background:#4f46e5; transition: background 0.3s; }
@media (max-width: 480px) {
  .color-swatch { width:64px; height:54px; }
  .color-preview { height:54px; }
}

/* ===== Markdown Previewer Specific ===== */
.md-wrap { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.md-box { display:flex; flex-direction:column; }
.md-box label { font-weight:600; display:block; margin-bottom:6px; }
.md-box textarea { min-height:400px; font-size:0.9rem; flex:1; }
.md-preview {
  flex:1;
  padding: 16px;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 400px;
  overflow-x: auto;
  color: var(--text);
}
.md-preview h1 { font-size: 1.8rem; margin: 16px 0 8px; }
.md-preview h2 { font-size: 1.4rem; margin: 14px 0 6px; }
.md-preview h3 { font-size: 1.2rem; margin: 12px 0 4px; }
.md-preview p { margin: 8px 0; color: var(--text-muted); }
.md-preview ul, .md-preview ol { margin: 8px 0 8px 24px; }
.md-preview li { margin: 4px 0; color: var(--text-muted); }
.md-preview code { background: var(--surface); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; color: var(--accent-hover); }
.md-preview pre { background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 8px; overflow-x: auto; margin: 8px 0; }
.md-preview pre code { background: none; padding: 0; color: inherit; }
.md-preview blockquote { border-left: 4px solid var(--accent); padding-left: 12px; color: var(--text-muted); margin: 8px 0; }
.md-preview a { color: var(--accent-hover); }
.md-preview table { border-collapse: collapse; margin: 8px 0; }
.md-preview th, .md-preview td { border: 1px solid var(--border); padding: 6px 12px; }
.md-preview th { background: var(--surface); }

/* ===== Responsive — Desktop first, scale down ===== */
@media (max-width: 1024px) {
  .container { max-width: 100%; }
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .hero { padding: 36px 16px 28px; }
  .hero h1 { font-size: 1.7rem; }
  .hero p { font-size: 1rem; }
  .nav { display: none; }
  .nav-toggle { display: flex; }
  .site-footer .container { grid-template-columns: 1fr; gap: 24px; }
  .tool-card { padding: 18px; }
  .tool-card .icon { font-size: 1.4rem; width: 40px; height: 40px; }
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .tool-card h3 { font-size: 0.95rem; }
  .tool-card p { font-size: 0.82rem; }
  .search-bar input { font-size: 16px; padding: 12px 14px 12px 44px; }
  .search-icon { left: 14px; font-size: 0.9rem; }
  .search-shortcut { display: none; }
  .category-filters { gap: 6px; }
  .cat-btn { padding: 6px 14px; font-size: 0.8rem; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .breadcrumb-bar { font-size: 0.82rem; }
  .tool-page { padding: 16px 0; }
  .tool-box { padding: 18px; }
  .site-header .container { position: relative; z-index: 152; padding: 0 16px; }
  .md-wrap { grid-template-columns: 1fr; }
  .md-box textarea, .md-preview { min-height: 220px; }
  .features { padding: 0 16px; }
  .article { padding: 0 16px; }
}

@media (max-width: 480px) {
  .feature-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.5rem; }
  .tool-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tool-card { padding: 14px; }
  .tool-card .icon { font-size: 1.3rem; width: 36px; height: 36px; }
  .tool-card h3 { font-size: 0.88rem; }
  .tool-card p { font-size: 0.78rem; -webkit-line-clamp: 2; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; }
  .tool-tag { font-size: 0.65rem; padding: 1px 8px; }
  .hero-badge { font-size: 0.72rem; }
}
