/* ============================================================
   DevUtils - Shared Stylesheet
   Design: Dark terminal aesthetic | Green accent | Monospace
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg:       #0d0f11;
  --bg2:      #141618;
  --bg3:      #1a1d20;
  --bg4:      #22262b;
  --border:   #2a2f36;
  --border2:  #353c45;
  --text:     #e8eaed;
  --text2:    #9aa3af;
  --text3:    #5c6470;
  --accent:   #00d084;
  --accent2:  #00a86b;
  --accent-dim: rgba(0,208,132,.08);
  --accent-glow: rgba(0,208,132,.15);
  --red:      #ff5a5a;
  --yellow:   #f5c542;
  --mono:     'JetBrains Mono', monospace;
  --sans:     'DM Sans', sans-serif;
  --radius:   8px;
  --radius-lg: 12px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- ANIMATIONS ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .4; }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,208,132,0); }
  50%      { box-shadow: 0 0 20px 2px rgba(0,208,132,.08); }
}

/* ---- NAV ---- */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,15,17,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 52px;
  animation: fadeIn .4s var(--ease-out);
}

.nav-logo {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.3px;
  transition: opacity .2s;
}
.nav-logo:hover { opacity: .8; }
.nav-logo span { color: var(--text2); font-weight: 400; }

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: var(--text2);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color .2s var(--ease-out), background .2s var(--ease-out), transform .15s;
  position: relative;
}
.nav-links a:hover {
  color: var(--text);
  background: var(--bg4);
  transform: translateY(-1px);
}
.nav-links a:active { transform: translateY(0); }

/* ---- NAV DROPDOWN ---- */
.nav-dropdown {
  position: relative;
}
.nav-dropdown > a {
  display: flex; align-items: center; gap: 4px;
}
.nav-dropdown > a::after {
  content: '';
  border: 4px solid transparent;
  border-top: 5px solid currentColor;
  margin-top: 2px;
  transition: transform .2s var(--ease-out);
}
.nav-dropdown:hover > a::after,
.nav-dropdown.open > a::after {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out), visibility .2s;
  box-shadow: 0 12px 40px rgba(0,0,0,.4), 0 0 0 1px rgba(0,208,132,.05);
  z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--text2);
  text-decoration: none;
  font-size: 13px;
  transition: background .15s, color .15s, transform .15s;
}
.nav-dropdown-menu a:hover {
  background: var(--accent-dim);
  color: var(--accent);
  transform: translateX(2px);
}
.nav-dropdown-menu a .dd-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--bg4);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px;
  color: var(--accent);
  flex-shrink: 0;
  transition: background .15s;
}
.nav-dropdown-menu a:hover .dd-icon {
  background: rgba(0,208,132,.15);
}
.nav-dropdown-menu a .dd-info { min-width: 0; }
.nav-dropdown-menu a .dd-name { font-size: 13px; font-weight: 500; }
.nav-dropdown-menu a .dd-count { font-size: 11px; color: var(--text3); }
.nav-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 8px;
}

@media (max-width: 600px) {
  .nav-dropdown-menu {
    position: fixed;
    top: 53px; left: 0; right: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    min-width: unset;
  }
}

/* ---- LAYOUT ---- */
.wrapper {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ---- HERO / TOOL HEADER ---- */
.tool-header {
  margin-bottom: 28px;
  animation: fadeInUp .5s var(--ease-out);
}

.tool-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px;
  color: var(--accent); background: var(--accent-dim);
  border: 1px solid rgba(0,208,132,.2);
  border-radius: 20px; padding: 3px 10px;
  margin-bottom: 14px;
  text-transform: uppercase; letter-spacing: .5px;
}
.tool-badge::before {
  content: ''; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

h1 {
  font-family: var(--sans);
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 10px;
}

.tool-description {
  color: var(--text2);
  font-size: 14.5px;
  max-width: 600px;
  line-height: 1.65;
}

/* ---- TOOL CARD ---- */
.tool-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
  animation: fadeInUp .6s var(--ease-out) .1s both;
  transition: border-color .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.tool-card:hover {
  border-color: var(--border2);
}

.tool-card-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  transition: transform .2s var(--ease-spring);
}
.dot:hover { transform: scale(1.3); }
.dot-red   { background: #ff5f57; }
.dot-yellow{ background: #febc2e; }
.dot-green { background: #28c840; }

.tool-card-title {
  font-family: var(--mono); font-size: 11px;
  color: var(--text3); margin-left: 4px;
}

.tool-body { padding: 20px; }

/* ---- INPUTS & CONTROLS ---- */
label {
  display: block;
  font-size: 12px; font-weight: 500;
  color: var(--text2);
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 7px;
  transition: color .2s;
}

textarea, input[type="text"] {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 12px 14px;
  resize: vertical;
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out), background .2s;
  outline: none;
}
textarea:focus, input[type="text"]:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(0,208,132,.1), 0 0 16px rgba(0,208,132,.05);
  background: var(--bg);
}
textarea { min-height: 110px; }

input[type="number"] {
  width: 100%;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: var(--mono); font-size: 14px;
  padding: 12px 14px; outline: none;
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out), background .2s;
}
input[type="number"]:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(0,208,132,.1), 0 0 16px rgba(0,208,132,.05);
  background: var(--bg);
}

select {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: 13px; padding: 9px 12px;
  outline: none; cursor: pointer;
  transition: border-color .2s, background .2s;
}
select:focus { border-color: var(--accent2); background: var(--bg); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  cursor: pointer; border: none;
  transition: all .2s var(--ease-out);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,.08);
  opacity: 0;
  transition: opacity .2s;
}
.btn:active::after { opacity: 1; }

.btn-primary {
  background: var(--accent); color: #0a0c0e;
  box-shadow: 0 2px 8px rgba(0,208,132,.2);
}
.btn-primary:hover {
  background: #00b873;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,208,132,.3);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(0,208,132,.2); }

.btn-secondary {
  background: var(--bg4); color: var(--text2);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  color: var(--text);
  border-color: var(--border2);
  background: var(--bg3);
  transform: translateY(-1px);
}
.btn-secondary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent; color: var(--text3);
  border: 1px solid var(--border);
  font-size: 12px; padding: 6px 12px;
}
.btn-ghost:hover {
  color: var(--accent);
  border-color: rgba(0,208,132,.3);
  background: var(--accent-dim);
  transform: translateY(-1px);
}
.btn-ghost:active { transform: translateY(0); }

.btn-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 14px;
}

/* ---- OUTPUT ---- */
.output-block {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-family: var(--mono); font-size: 13px; color: var(--text);
  min-height: 60px; word-break: break-all; white-space: pre-wrap;
  line-height: 1.65;
  transition: border-color .2s;
}
.output-label {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 7px;
}

/* ---- DIVIDER ---- */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 18px 0;
}

/* ---- GRID ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 580px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---- TABS ---- */
.tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.tab {
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  color: var(--text2); background: transparent;
  transition: all .2s var(--ease-out);
  position: relative;
}
.tab.active {
  background: var(--accent-dim); color: var(--accent);
  border-color: rgba(0,208,132,.25);
  box-shadow: 0 0 12px rgba(0,208,132,.08);
}
.tab:hover:not(.active) {
  background: var(--bg4); color: var(--text);
  transform: translateY(-1px);
}

/* ---- STATUS / ALERT ---- */
.status {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  margin-top: 12px;
  animation: fadeIn .25s var(--ease-out);
}
.status-ok  { background: rgba(0,208,132,.08); color: var(--accent); border: 1px solid rgba(0,208,132,.2); }
.status-err { background: rgba(255,90,90,.08);  color: var(--red);   border: 1px solid rgba(255,90,90,.2); }
.status-warn{ background: rgba(245,197,66,.08); color: var(--yellow); border: 1px solid rgba(245,197,66,.2); }

/* ---- COPY TOAST ---- */
#copy-toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--accent); color: #0a0c0e;
  padding: 9px 22px; border-radius: 20px;
  font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: all .3s var(--ease-spring);
  z-index: 999;
  box-shadow: 0 4px 20px rgba(0,208,132,.3);
}
#copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- FAQ SECTION ---- */
.faq-section {
  margin-top: 52px;
  animation: fadeInUp .6s var(--ease-out) .2s both;
}

.faq-section h2 {
  font-size: 20px; font-weight: 600;
  margin-bottom: 22px; color: var(--text);
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 8px;
  transition: border-color .2s var(--ease-out), box-shadow .2s;
}
.faq-item:hover {
  border-color: var(--border2);
}
.faq-item.open {
  border-color: rgba(0,208,132,.2);
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}

.faq-q {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  font-size: 14px; font-weight: 500; color: var(--text);
  cursor: pointer; user-select: none;
  background: var(--bg2);
  transition: background .2s var(--ease-out), color .2s;
  gap: 12px;
}
.faq-q:hover { background: var(--bg3); }
.faq-q .chevron {
  flex-shrink: 0; width: 16px; height: 16px;
  color: var(--text3);
  transition: transform .3s var(--ease-spring), color .2s;
}
.faq-item:hover .chevron { color: var(--accent); }
.faq-item.open .chevron { transform: rotate(180deg); color: var(--accent); }

.faq-a {
  display: none;
  padding: 14px 18px 18px;
  font-size: 13.5px; color: var(--text2);
  line-height: 1.7;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.faq-item.open .faq-a { display: block; animation: fadeIn .25s var(--ease-out); }
.faq-a code {
  font-family: var(--mono); font-size: 12px;
  background: var(--bg4); color: var(--accent);
  padding: 1px 6px; border-radius: 4px;
  transition: background .15s;
}
.faq-a code:hover { background: var(--bg3); }

/* ---- RELATED TOOLS ---- */
.related-section {
  margin-top: 48px;
  animation: fadeInUp .6s var(--ease-out) .3s both;
}
.related-section h2 { font-size: 18px; font-weight: 600; margin-bottom: 16px; }

.related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.related-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  text-decoration: none; color: var(--text);
  transition: border-color .25s var(--ease-out), transform .25s var(--ease-out),
              box-shadow .25s var(--ease-out), background .25s;
}
.related-card:hover {
  border-color: rgba(0,208,132,.3);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.2), 0 0 0 1px rgba(0,208,132,.1);
  background: linear-gradient(135deg, var(--bg2) 0%, rgba(0,208,132,.03) 100%);
}
.related-icon {
  font-family: var(--mono); font-size: 18px;
  color: var(--accent); flex-shrink: 0;
  transition: transform .3s var(--ease-spring);
}
.related-card:hover .related-icon { transform: scale(1.15); }
.related-card-info { min-width: 0; }
.related-card-name {
  font-size: 13px; font-weight: 500;
  transition: color .2s;
}
.related-card:hover .related-card-name { color: var(--accent); }
.related-card-desc { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* ---- FOOTER ---- */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  font-size: 12px; color: var(--text3);
  animation: fadeIn .6s var(--ease-out) .4s both;
}
footer a {
  color: var(--text2); text-decoration: none;
  transition: color .2s var(--ease-out);
  position: relative;
}
footer a::after {
  content: '';
  position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width .25s var(--ease-out);
}
footer a:hover { color: var(--accent); }
footer a:hover::after { width: 100%; }
.footer-links { display: flex; gap: 20px; justify-content: center; margin-top: 10px; }

/* ---- UTILITIES ---- */
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12{ margin-top: 12px; }
.mt-16{ margin-top: 16px; }
.text-mono { font-family: var(--mono); }
.text-accent { color: var(--accent); }
.text-dim { color: var(--text2); }
.text-sm { font-size: 13px; }

/* ---- SELECTION ---- */
::selection {
  background: rgba(0,208,132,.2);
  color: var(--text);
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .wrapper { padding: 28px 16px 60px; }
  nav { padding: 0 16px; }
  .btn-row { flex-direction: column; }
  .btn { justify-content: center; }
  .related-grid { grid-template-columns: 1fr; }
}

/* ---- REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
