/* ============================================================
   DevToolsIndia — main.css
   Shared styles: variables, reset, nav, footer, utilities
   Change here → updates ALL pages automatically
   ============================================================ */

/* ── CSS VARIABLES ─────────────────────────────────────── */
:root {
  --bg:      #080c10;
  --bg2:     #0d1117;
  --bg3:     #161b22;
  --border:  #21262d;
  --border2: #30363d;
  --text:    #e6edf3;
  --text2:   #8b949e;
  --text3:   #484f58;
  --accent:  #f78166;
  --accent2: #ff9f43;
  --green:   #3fb950;
  --blue:    #58a6ff;
  --purple:  #bc8cff;
  --red:     #f85149;
  --yellow:  #e3b341;
  --cyan:    #39d353;
  --glow:    rgba(247, 129, 102, 0.15);
}

/* ── SITE WIDTH TOKEN ──────────────────────────────────── */
/* Change this ONE value to resize the entire site uniformly */
:root {
  --site-width: 1200px;
}

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

html { scroll-behavior: smooth; }

/* ── CLS PREVENTION ────────────────────────────────────── */
img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  max-width: 100%;
}

@font-face { font-display: swap; }

nav, footer, .page, .editor-container, .info-section,
.diff-output, .tool-header, .status-row {
  width: 100%;
  contain: layout;
}

/* Ad banner — NO min-height so it doesn't create gap before AdSense loads.
   AdSense iframe sets its own height once approved. */
.ad-top {
  width: 100%;
  overflow: hidden;
  contain: layout;
}

/* Only show a placeholder outline when AdSense not yet approved */
.ad-top:empty {
  display: none;
}

.ad-top .adsbygoogle {
  display: block;
  width: 100%;
}

body {
  margin: 0;        /* belt-and-suspenders — also set in critical inline CSS */
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Syne', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── GRID BACKGROUND ───────────────────────────────────── */
/* will-change: transform promotes to compositor layer — no layout shift */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

/* ── GLOW ORB (homepage only — opt in with .has-glow) ──── */
body.has-glow::after {
  content: '';
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(247,129,102,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

/* ── NAV ───────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: rgba(8, 12, 16, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  white-space: nowrap;        /* prevent logo wrapping to two lines */
}

.logo-icon {
  width: 30px;
  height: 30px;
  background: #0d1117;
  border: 1.5px solid rgba(247,129,102,0.5);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-icon svg { display: block; }  /* remove inline SVG bottom gap */

.logo span { color: var(--accent); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links { display: flex; gap: 4px; }

.nav-links a {
  color: var(--text2);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  transition: all 0.15s;
  letter-spacing: -0.01em;
}

.nav-links a:hover {
  color: var(--accent);
  background: rgba(247, 129, 102, 0.08);
}

.nav-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--green);
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

.breadcrumb {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text3);
  display: flex;
  gap: 8px;
  align-items: center;
}

.breadcrumb a { color: var(--text2); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ── FOOTER ────────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 40px 2rem 24px;
  max-width: var(--site-width);
  margin: 0 auto;
  width: 100%;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 32px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text2);
  font-size: 0.85rem;
  margin-top: 10px;
  max-width: 260px;
  line-height: 1.6;
  font-weight: 400;
}

.footer-links h4 {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 14px;
}

.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.footer-links a {
  color: var(--text2);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s;
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.footer-bottom a { color: var(--text3); text-decoration: none; transition: color 0.15s; }
.footer-bottom a:hover { color: var(--accent); }

/* ── PAGE WRAPPER ──────────────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  flex: 1;
  max-width: var(--site-width);
  margin: 0 auto;
  width: 100%;
  padding: 32px 2rem 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeUp 0.5s ease both;
}

/* Wider layout for tools with side-by-side editors */
.page-wide { max-width: 1400px; }

/* ── BUTTONS ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-family: 'Syne', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #080c10;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(247,129,102,0.25); }

.btn-ghost {
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-green {
  background: rgba(63,185,80,0.15);
  color: var(--green);
  border: 1px solid rgba(63,185,80,0.3);
}
.btn-green:hover { background: rgba(63,185,80,0.25); }

.btn-blue {
  background: rgba(88,166,255,0.12);
  color: var(--blue);
  border: 1px solid rgba(88,166,255,0.3);
}
.btn-blue:hover { background: rgba(88,166,255,0.2); }

.icon-btn {
  background: none;
  border: 1px solid var(--border2);
  color: var(--text2);
  padding: 4px 10px;
  border-radius: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── STATUS PILLS ──────────────────────────────────────── */
.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
}

.status-pill.valid  { color: var(--green);  background: rgba(63,185,80,0.1);  border: 1px solid rgba(63,185,80,0.25); }
.status-pill.invalid{ color: var(--red);    background: rgba(248,81,73,0.1);  border: 1px solid rgba(248,81,73,0.25); }
.status-pill.warn   { color: var(--yellow); background: rgba(227,179,65,0.1); border: 1px solid rgba(227,179,65,0.25); }
.status-pill.idle   { color: var(--text3);  background: var(--bg3);           border: 1px solid var(--border); }
.status-info        { color: var(--text3); }

/* ── AD BANNER ─────────────────────────────────────────── */
.ad-banner {
  background: var(--bg3);
  border: 1px dashed var(--border2);
  border-radius: 8px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── EDITOR / PANE ─────────────────────────────────────── */
.editor-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  min-height: 480px;
}

.editor-pane {
  background: var(--bg2);
  display: flex;
  flex-direction: column;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.pane-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pane-label .dot { width: 8px; height: 8px; border-radius: 50%; }
.pane-actions { display: flex; gap: 6px; }

/* ── SHARED TEXTAREA ───────────────────────────────────── */
textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.8;
  padding: 20px;
  min-height: 440px;
  display: block;
  width: 100%;
}
textarea::placeholder { color: var(--text3); }
textarea::-webkit-scrollbar { width: 5px; }
textarea::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── SECTION LABEL ─────────────────────────────────────── */
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text3);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── INFO SECTION ──────────────────────────────────────── */
.info-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
}
.info-section h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 12px; }
.info-section p  { color: var(--text2); font-size: 0.875rem; line-height: 1.8; font-weight: 400; margin-bottom: 12px; }
.info-section p:last-child { margin-bottom: 0; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.info-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.info-card h3 { font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; }
.info-card p  { font-size: 0.78rem; color: var(--text2); line-height: 1.6; font-weight: 400; }

/* ── ERROR PANEL ───────────────────────────────────────── */
.error-panel {
  background: rgba(248,81,73,0.06);
  border: 1px solid rgba(248,81,73,0.2);
  border-radius: 6px;
  padding: 10px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--red);
  display: none;
}
.error-panel.show { display: block; }

/* ── TOAST ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 999;
  background: var(--green);
  color: #080c10;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── TOGGLE SWITCH ─────────────────────────────────────── */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text2);
  white-space: nowrap;
}
.toggle {
  width: 32px;
  height: 18px;
  background: var(--border2);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle.on { background: var(--green); }
.toggle::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: left 0.2s;
}
.toggle.on::after { left: 17px; }

/* ── SELECT ────────────────────────────────────────────── */
select {
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 6px 28px 6px 12px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
select:focus { border-color: var(--accent); }

/* ── STATS BAR ─────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 20px;
  padding: 10px 16px;
  background: var(--bg3);
  border-top: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text3);
  flex-wrap: wrap;
}
.stat-item { display: flex; gap: 5px; }
.stat-item span { color: var(--text2); }

/* ── TOOL HEADER ───────────────────────────────────────── */
.tool-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.tool-title-group h1 { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.04em; }
.tool-title-group p  { color: var(--text2); font-size: 0.875rem; margin-top: 4px; font-weight: 400; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── ANIMATIONS ────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── MOBILE ────────────────────────────────────────────── */
@media (max-width: 768px) {
  nav { padding: 0 1rem; }
  .nav-links { display: none; }
  .page { padding: 20px 1rem 60px; }
  .editor-container { grid-template-columns: 1fr; }
  .footer-top { flex-direction: column; }
  .tool-header { flex-direction: column; }
}

@media (max-width: 480px) {
  .action-row { flex-direction: column; align-items: flex-start; }
  .footer-bottom { flex-direction: column; }
}
.nav-links a.active { color: var(--accent); background: rgba(247,129,102,0.08); }