/* ===== ToolboxKit — Global Styles ===== */
:root {
  --primary: #6c5ce7;
  --primary-dark: #5a4bd1;
  --secondary: #00cec9;
  --bg: #0f0f23;
  --bg-card: #1a1a2e;
  --bg-tool: #16213e;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #2d2d5e;
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #e17055;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,.3);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--secondary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary); }

/* ===== Layout ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== Header / Nav ===== */
header {
  background: rgba(15,15,35,.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 0;
}
header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-icon { width: 28px; height: 28px; vertical-align: middle; }
.logo span { color: var(--primary); }
nav { display: flex; gap: 20px; flex-wrap: wrap; }
nav a { color: var(--text-muted); font-weight: 500; font-size: .95rem; }
nav a:hover { color: var(--secondary); }

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 80px 20px 40px;
  background: linear-gradient(135deg, rgba(108,92,231,.1), rgba(0,206,201,.05));
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}
.hero h1 .highlight { color: var(--primary); }
.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 32px;
}

/* ===== Search ===== */
.search-box {
  max-width: 540px;
  margin: 0 auto 20px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.search-box input {
  flex: 1;
  padding: 14px 24px;
  border: 2px solid var(--border);
  border-radius: 50px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,92,231,.3); }
.search-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, box-shadow .3s, background .2s;
  flex-shrink: 0;
}
.search-btn:hover {
  transform: scale(1.1);
  background: var(--primary-dark);
  box-shadow: 0 0 20px rgba(108,92,231,.6), 0 0 40px rgba(108,92,231,.3);
}
.search-btn:active {
  transform: scale(0.95);
}

/* ===== Tool Grid ===== */
.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 48px 0 24px;
  padding-left: 16px;
  border-left: 4px solid var(--primary);
}
.section-title i.fa-solid {
  color: var(--primary);
  margin-right: 6px;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
  color: var(--text);
}
.tool-card .icon {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
  color: var(--primary);
}
.tool-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.tool-card p {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== Ad Spots ===== */
.ad-spot {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin: 30px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: .85rem;
}

/* ===== Tool Page Layout ===== */
.tool-page { padding: 40px 0 60px; }
.tool-header {
  text-align: center;
  margin-bottom: 32px;
}
.tool-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.tool-header h1 i.fa-solid {
  color: var(--primary);
  margin-right: 4px;
}
.tool-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.tool-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
}

/* Form elements */
textarea, input[type="text"], input[type="number"], input[type="url"], select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-tool);
  color: var(--text);
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: .95rem;
  resize: vertical;
  outline: none;
  transition: border-color .2s;
}
textarea:focus, input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,92,231,.3); }

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: .95rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  color: #fff;
  background: var(--bg-tool);
}
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary { background: var(--secondary); color: var(--bg); }
.btn-secondary:hover { opacity: .9; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { opacity: .9; }
.btn-sm { padding: 8px 16px; font-size: .85rem; }

.btn-group { display: flex; gap: 10px; margin: 16px 0; flex-wrap: wrap; }

.output-box {
  background: var(--bg-tool);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  min-height: 80px;
  font-family: 'Fira Code', monospace;
  font-size: .9rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 12px;
}

.stats-bar {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-label { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 1.3rem; font-weight: 700; color: var(--secondary); }

/* ===== Related Tools / CTA ===== */
.related-tools {
  margin-top: 40px;
}
.related-tools h2 {
  font-size: 1.4rem;
  margin-bottom: 16px;
}

/* ===== How To Section ===== */
.how-to-section {
  margin-top: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.how-to-section h2 {
  font-size: 1.4rem;
  margin-bottom: 20px;
}
.how-to-section ol {
  padding-left: 24px;
  line-height: 1.8;
  color: var(--text-muted);
}
.how-to-section ol li {
  margin-bottom: 10px;
}
.how-to-section ol li strong {
  color: var(--text);
}

/* ===== FAQ Section (SEO Content) ===== */
.faq-section {
  margin-top: 40px;
}
.faq-section h2 {
  font-size: 1.4rem;
  margin-bottom: 20px;
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-question {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background .2s;
}
.faq-question:hover { background: rgba(108,92,231,.1); }
.faq-answer {
  padding: 0 20px 16px;
  color: var(--text-muted);
  line-height: 1.7;
  display: none;
}
.faq-item.active .faq-answer { display: block; }
.faq-item.active .faq-toggle { transform: rotate(180deg); }
.faq-toggle { transition: transform .2s; }

/* ===== Footer ===== */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}
.footer-col h4 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text);
}
.footer-col a {
  display: block;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-size: .9rem;
}
.footer-col a:hover { color: var(--secondary); }
.footer-bottom {
  text-align: center;
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .85rem;
}

/* ===== Tool Page Sidebar Layout ===== */
.tool-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}
.tool-main { min-width: 0; }
.tool-sidebar {
  position: sticky;
  top: 80px;
}
.mobile-bottom-ad { display: none; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero { padding: 40px 16px 24px; }
  .tool-container { padding: 20px; }
  .stats-bar { gap: 16px; }
  header .container { justify-content: center; }
  nav { justify-content: center; }
  .tool-page-layout { display: block; }
  .tool-sidebar { display: none; }
  .mobile-bottom-ad {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 4px 0;
    text-align: center;
  }
  body { padding-bottom: 70px; }
}

/* ===== Utility ===== */
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.hidden { display: none; }
.copied-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--success);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 9999;
  animation: slideIn .3s ease;
}
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
