/* ==========================================================================
   Developer Tools — Design System
   ========================================================================== */

:root {
  --bg:            #ffffff;
  --bg-subtle:     #f7f8fa;
  --bg-elevated:   #ffffff;
  --border:        #e7e9ee;
  --border-strong: #d5d8e0;
  --text:          #0b0c0f;
  --text-muted:    #656b7a;
  --text-faint:    #9aa0ae;
  --accent:        #6366f1;
  --accent-hover:  #4f46e5;
  --accent-soft:   rgba(99, 102, 241, 0.10);
  --ring:          rgba(99, 102, 241, 0.35);
  --success:       #16a34a;
  --danger:        #dc2626;
  --warning:       #d97706;
  --shadow-sm:     0 1px 2px rgba(16, 18, 27, 0.04), 0 1px 3px rgba(16, 18, 27, 0.06);
  --shadow-md:     0 4px 12px rgba(16, 18, 27, 0.06), 0 2px 6px rgba(16, 18, 27, 0.04);
  --shadow-lg:     0 12px 32px rgba(16, 18, 27, 0.10), 0 4px 12px rgba(16, 18, 27, 0.06);
  --sidebar-w:     264px;
}

.dark {
  --bg:            #0a0b0f;
  --bg-subtle:     #0e1015;
  --bg-elevated:   #14161d;
  --border:        #23262f;
  --border-strong: #2e323d;
  --text:          #f2f3f5;
  --text-muted:    #9ba1af;
  --text-faint:    #6b7280;
  --accent:        #818cf8;
  --accent-hover:  #a5b4fc;
  --accent-soft:   rgba(129, 140, 248, 0.12);
  --ring:          rgba(129, 140, 248, 0.40);
  --success:       #4ade80;
  --danger:        #f87171;
  --warning:       #fbbf24;
  --shadow-sm:     0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md:     0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg:     0 16px 40px rgba(0, 0, 0, 0.55);
}

* { border-color: var(--border); }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s ease, color .3s ease;
}

.font-mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---- Surfaces ---------------------------------------------------------- */
.surface       { background: var(--bg); }
.surface-subtle{ background: var(--bg-subtle); }
.surface-elev  { background: var(--bg-elevated); }
.border-app    { border-color: var(--border); }
.text-muted    { color: var(--text-muted); }
.text-faint    { color: var(--text-faint); }

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s cubic-bezier(.2,.7,.3,1), box-shadow .25s ease, border-color .25s ease;
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 500; font-size: .875rem; line-height: 1;
  padding: .625rem 1rem; border-radius: 10px;
  cursor: pointer; user-select: none; white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .12s ease, box-shadow .18s ease;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }

.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); }
.dark .btn-primary { color: #0a0b0f; }

.btn-secondary {
  background: var(--bg-elevated); color: var(--text); border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-subtle); border-color: var(--text-faint); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent); }

.btn-danger { background: transparent; color: var(--danger); border-color: var(--border-strong); }
.btn-danger:hover { background: rgba(220,38,38,.08); border-color: var(--danger); }

.btn-sm { padding: .4rem .7rem; font-size: .8rem; border-radius: 8px; }

/* ---- Inputs ------------------------------------------------------------ */
.input, .textarea {
  width: 100%;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: .75rem .9rem;
  font-size: .9rem;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
  background: var(--bg-elevated);
}
.textarea { resize: vertical; min-height: 180px; line-height: 1.6; }

/* ---- Badges ------------------------------------------------------------ */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 600; letter-spacing: .01em;
  padding: .25rem .6rem; border-radius: 999px;
  border: 1px solid var(--border);
}
.badge-accent  { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-success { background: rgba(22,163,74,.10); color: var(--success); border-color: transparent; }
.badge-danger  { background: rgba(220,38,38,.10); color: var(--danger); border-color: transparent; }

/* ---- Sidebar nav ------------------------------------------------------- */
.nav-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .75rem; border-radius: 10px;
  color: var(--text-muted); font-size: .9rem; font-weight: 500;
  transition: background-color .18s ease, color .18s ease;
  position: relative;
}
.nav-link:hover { background: var(--bg-subtle); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-link.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 999px; background: var(--accent);
}
.nav-link svg { flex-shrink: 0; }

/* ---- Scrollbar --------------------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ---- Animations -------------------------------------------------------- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn    { 0% { opacity: 0; transform: scale(.96); } 100% { opacity: 1; transform: scale(1); } }
@keyframes shimmer  { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }

.animate-fade-up { animation: fadeInUp .5s cubic-bezier(.2,.7,.3,1) both; }
.animate-fade    { animation: fadeIn .4s ease both; }
.animate-pop     { animation: popIn .3s cubic-bezier(.2,.7,.3,1) both; }

/* staggered children */
.stagger > * { animation: fadeInUp .5s cubic-bezier(.2,.7,.3,1) both; }
.stagger > *:nth-child(1){ animation-delay:.04s } .stagger > *:nth-child(2){ animation-delay:.10s }
.stagger > *:nth-child(3){ animation-delay:.16s } .stagger > *:nth-child(4){ animation-delay:.22s }
.stagger > *:nth-child(5){ animation-delay:.28s } .stagger > *:nth-child(6){ animation-delay:.34s }

/* ---- Toast ------------------------------------------------------------- */
#toast-root { position: fixed; bottom: 24px; right: 24px; z-index: 100; display: flex; flex-direction: column; gap: .6rem; }
.toast {
  display: flex; align-items: center; gap: .6rem;
  background: var(--bg-elevated); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  padding: .75rem 1rem; box-shadow: var(--shadow-lg);
  font-size: .875rem; font-weight: 500;
  animation: popIn .3s cubic-bezier(.2,.7,.3,1) both;
}
.toast.hide { animation: fadeIn .3s reverse both; }

/* ---- Dropzone ---------------------------------------------------------- */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
  transition: border-color .2s ease, background-color .2s ease;
}
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .dz-inner { transition: transform .2s ease; }
.dropzone:hover .dz-inner { transform: translateY(-2px); }
.dropzone.dragover .dz-inner span:first-child { transform: scale(1.08); }

/* progress bar */
.progress { height: 8px; border-radius: 999px; background: var(--bg-subtle); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #a855f7); transition: width .25s ease; }

/* file row */
.file-row { transition: background-color .18s ease, border-color .18s ease; }
.file-row:hover { border-color: var(--border-strong); }

/* crop tool */
.crop-stage { position: relative; display: inline-block; line-height: 0; touch-action: none; user-select: none; }
.crop-stage img { display: block; max-width: 100%; max-height: 460px; border-radius: 8px; }
.crop-box {
  position: absolute; box-sizing: border-box;
  border: 1.5px solid #fff; cursor: move;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .5);
}
.crop-box::before, .crop-box::after {
  content: ''; position: absolute; background: rgba(255, 255, 255, .35);
}
.crop-box::before { left: 33.33%; right: 33.33%; top: 0; bottom: 0; border-left: 1px solid rgba(255,255,255,.35); border-right: 1px solid rgba(255,255,255,.35); background: none; }
.crop-box::after  { top: 33.33%; bottom: 33.33%; left: 0; right: 0; border-top: 1px solid rgba(255,255,255,.35); border-bottom: 1px solid rgba(255,255,255,.35); background: none; }
.crop-handle {
  position: absolute; width: 14px; height: 14px; z-index: 2;
  background: var(--accent); border: 2px solid #fff; border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.crop-handle[data-h="nw"] { left: -8px; top: -8px; cursor: nwse-resize; }
.crop-handle[data-h="ne"] { right: -8px; top: -8px; cursor: nesw-resize; }
.crop-handle[data-h="sw"] { left: -8px; bottom: -8px; cursor: nesw-resize; }
.crop-handle[data-h="se"] { right: -8px; bottom: -8px; cursor: nwse-resize; }

/* ---- Utility ----------------------------------------------------------- */
.grid-bg {
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 40%, transparent 100%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 40%, transparent 100%);
}
.gradient-text {
  background: linear-gradient(120deg, var(--accent), #a855f7 60%, #ec4899);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.divider { height: 1px; background: var(--border); }
.kbd {
  font-family: 'JetBrains Mono', monospace; font-size: .72rem;
  padding: .1rem .4rem; border-radius: 6px;
  border: 1px solid var(--border-strong); background: var(--bg-subtle); color: var(--text-muted);
}

/* dropdown menu (language switcher) */
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); z-index: 50;
  min-width: 220px; max-height: 60vh; overflow-y: auto;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px;
}
.lang-item {
  width: 100%; display: flex; align-items: center; gap: .6rem;
  padding: .5rem .6rem; border-radius: 9px; cursor: pointer;
  color: var(--text); font-size: .875rem; text-align: left;
  transition: background-color .15s ease;
}
.lang-item:hover { background: var(--bg-subtle); }
.lang-item.active { background: var(--accent-soft); }
.lang-code {
  font-family: 'JetBrains Mono', monospace; font-size: .68rem; font-weight: 600;
  width: 30px; text-align: center; padding: .18rem 0; border-radius: 6px;
  background: var(--bg-subtle); border: 1px solid var(--border); color: var(--text-muted); flex-shrink: 0;
}
.lang-item.active .lang-code { color: var(--accent); border-color: transparent; background: var(--accent-soft); }
.lang-native { font-weight: 500; }
[dir="rtl"] .lang-item, [dir="rtl"] .text-left { text-align: right; }
#lang-btn{
  display: none;
}
[aria-label="GitHub"]{
  display: none !important;
}

/* Hide the fourth link in the footer items-center row */
footer .items-center a:nth-child(3), 
footer .items-center a:nth-child(4)
{
  display: none !important;
}

#sidebar .border-app{
  display: none !important;
}

#hero-gh{
  display: none !important;
}