/* ImageTools by Ticnob — App Shell Theme (Navy + Electric Green) */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy-900: #00096E;
  --navy-800: #0011B7;
  --navy-700: #0019FF;
  --green:    #00F295;
  --green-d:  #00C778;
  --grey-900: #222325;
  --grey-700: #39455C;
  --grey-300: #CDD5E9;
  --grey-100: #F5F8FF;
  --white:    #ffffff;
  --ink:      var(--grey-900);
  --muted:    var(--grey-700);
  --line:     var(--grey-300);
  --bg:       var(--grey-100);
  --panel:    var(--white);
  --danger:   #dc2626;
  --danger-l: #fef2f2;
  --success:  #16a34a;
  --success-l:#f0fdf4;
  --text-inverse:#ffffff;
  --text-inverse-muted:#D8E2F2;
  --text-inverse-subtle:#BAC7DD;
  --success-text:#055C3E;
  --danger-text:#8F161D;
  --warning-text:#6F4700;
  --shadow-sm:0 1px 3px rgba(0,9,110,.07);
  --shadow:   0 4px 20px rgba(0,9,110,.1),0 2px 6px rgba(0,9,110,.05);
  --shadow-lg:0 20px 60px rgba(0,9,110,.15);
  --radius:   12px;
  --radius-sm:8px;
  --font-head:"Sora",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --font:     "Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --ease:     0.15s cubic-bezier(.4,0,.2,1);
}

*,*::before,*::after { box-sizing: border-box }
html { scroll-behavior: smooth }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none }
img { max-width: 100%; display: block }
button, input, select, textarea { font-family: inherit; font-size: inherit }
h1,h2,h3,h4 { font-family: var(--font-head); letter-spacing: -.02em }

/* ── APP SHELL ── */
.it-shell {
  display: grid;
  grid-template-rows: 60px 1fr;
  min-height: 100vh;
}

/* ── TOPBAR (deep navy) ── */
.it-topbar {
  background: var(--navy-900);
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center;
  padding: 0 20px; gap: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,.4);
}
.it-topbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 15px; color: var(--white);
  flex-shrink: 0; font-family: var(--font-head);
}
.it-topbar-icon {
  width: 32px; height: 32px; border-radius: 7px;
  background: var(--green); color: var(--navy-900);
  display: grid; place-items: center; font-size: 15px; flex-shrink: 0;
}
.it-topbar-brand em {
  font-style: normal; color: var(--text-inverse-subtle);
  font-size: 12px; font-weight: 500;
}
.it-topbar-sep { flex: 1 }
.it-topbar-nav { display: flex; gap: 4px; align-items: center }
.it-topbar-nav a {
  color: var(--text-inverse-muted); font-size: 13px;
  font-weight: 600; padding: 5px 11px; border-radius: 6px;
  transition: color var(--ease), background var(--ease); white-space: nowrap;
}
.it-topbar-nav a:hover { color: var(--white); background: rgba(255,255,255,.1) }

/* ── TOOL LAYOUT ── */
.it-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 60px);
}

/* ── SIDEBAR (deeper navy) ── */
.it-sidebar {
  background: var(--navy-900);
  border-right: 1px solid rgba(255,255,255,.06);
  padding: 14px 8px;
  overflow-y: auto;
}
.it-sidebar-section {
  font-size: 10px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-inverse-subtle);
  padding: 10px 12px 6px;
}
.it-sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-inverse-muted); font-size: 13px; font-weight: 600;
  transition: background var(--ease), color var(--ease); margin-bottom: 2px;
}
.it-sidebar a:hover { color: var(--white); background: rgba(255,255,255,.08) }
.it-sidebar a.active { color: var(--navy-900); background: var(--green); font-weight: 700 }
.it-sidebar-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0 }
.it-sidebar-badge {
  margin-left: auto; font-size: 10px; font-weight: 700;
  background: rgba(255,255,255,.15); color: var(--text-inverse-muted);
  border-radius: 999px; padding: 1px 7px;
}
.it-sidebar-badge.live { background: var(--green); color: var(--navy-900) }
.it-sidebar a.active .it-sidebar-badge { background: var(--navy-900); color: var(--green) }

/* ── MAIN CONTENT ── */
.it-main { padding: 24px 28px; overflow: auto }
.it-page-title { display: flex; align-items: center; gap: 12px; margin: 0 0 20px }
.it-page-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: rgba(0,17,183,.08); color: var(--navy-800);
  display: grid; place-items: center; font-size: 22px; flex-shrink: 0;
}
.it-page-title h1 { margin: 0; font-size: 22px; font-weight: 800 }
.it-page-title p { margin: 3px 0 0; font-size: 13px; color: var(--muted) }

/* ── TOOL GRID ── */
.it-tool-grid {
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  gap: 20px; align-items: start;
}

/* ── PANELS ── */
.it-panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
}
.it-panel-title { font-size: 14px; font-weight: 700; color: var(--ink); margin: 0 0 16px; display: flex; align-items: center; gap: 8px }

/* ── DROP ZONE ── */
.it-drop {
  position: relative; border: 2px dashed var(--grey-300);
  border-radius: var(--radius-sm); padding: 28px 20px;
  text-align: center; background: var(--grey-100);
  transition: border-color var(--ease), background var(--ease); cursor: pointer;
}
.it-drop:hover, .it-drop.drag-over {
  border-color: var(--navy-800); background: rgba(0,17,183,.04);
}
.it-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer }
.it-drop-icon { font-size: 36px; margin-bottom: 8px }
.it-drop h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700 }
.it-drop p { margin: 0; font-size: 12px; color: var(--muted) }
.it-drop-preview { margin-top: 12px; border-radius: var(--radius-sm); overflow: hidden; max-height: 140px; display: flex; align-items: center; justify-content: center }
.it-drop-preview img { max-height: 140px; max-width: 100%; object-fit: contain }

/* ── CONTROLS ── */
.it-controls { display: grid; gap: 12px; margin-top: 16px }
.it-controls-2 { grid-template-columns: 1fr 1fr }
.it-field { display: grid; gap: 5px }
.it-field label { font-size: 12px; font-weight: 700; color: var(--ink); display: flex; justify-content: space-between; align-items: center }
.it-field label output { font-weight: 600; color: var(--navy-800); font-size: 12px }
.it-field input[type=text],
.it-field input[type=number],
.it-field select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--white); color: var(--ink);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.it-field input:focus, .it-field select:focus {
  outline: none; border-color: var(--navy-800);
  box-shadow: 0 0 0 3px rgba(0,17,183,.1);
}
.it-field input[type=range] { width: 100%; accent-color: var(--navy-800); cursor: pointer }

/* ── BUTTONS ── */
.it-btn, .it-btn-alt, .it-btn-green, .it-btn-danger {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 14px; border: 2px solid transparent;
  cursor: pointer; transition: all var(--ease);
  font-family: var(--font); text-decoration: none; white-space: nowrap;
}
/* Primary: navy */
.it-btn { background: var(--navy-800); color: var(--white); border-color: var(--navy-800) }
.it-btn:hover { background: var(--navy-900); border-color: var(--navy-900); transform: translateY(-1px) }
/* Download: electric green */
.it-btn-green { background: var(--green); color: var(--navy-900); border-color: var(--green) }
.it-btn-green:hover { background: var(--green-d); border-color: var(--green-d); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,242,149,.35) }
/* Secondary: outline */
.it-btn-alt { background: var(--panel); border-color: var(--line); color: var(--ink) }
.it-btn-alt:hover { border-color: var(--navy-800); color: var(--navy-800) }
/* Danger */
.it-btn-danger { background: var(--danger-l); border-color: #fca5a5; color: var(--danger) }
.it-btn-danger:hover { background: #fee2e2 }
.it-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px }

/* ── NOTICES ── */
.it-notice { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: flex-start; gap: 10px }
.it-notice.error { background: var(--danger-l); color: var(--danger-text); border-left: 3px solid var(--danger) }
.it-notice.ok { background: #e6fbf2; color: var(--success-text); border-left: 3px solid var(--green) }
.it-notice.info { background: rgba(0,17,183,.06); color: var(--navy-800); border-left: 3px solid var(--navy-800) }

/* ── RESULT AREA ── */
.it-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px }
.it-preview-label { font-size: 11px; font-weight: 700; color: var(--muted); margin: 0 0 6px; text-transform: uppercase; letter-spacing: .06em }
.it-preview {
  border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); min-height: 200px; display: grid; place-items: center;
  background-image: linear-gradient(45deg,#f1f5f9 25%,transparent 25%),linear-gradient(-45deg,#f1f5f9 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#f1f5f9 75%),linear-gradient(-45deg,transparent 75%,#f1f5f9 75%);
  background-size: 20px 20px; background-position: 0 0,0 10px,10px -10px,-10px 0;
}
.it-preview img { max-width: 100%; max-height: 400px; object-fit: contain }
.it-meta-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 16px }
.it-meta-item { background: var(--grey-100); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px }
.it-meta-item b { display: block; font-size: 15px; font-weight: 800; font-family: var(--font-head) }
.it-meta-item span { font-size: 11px; color: var(--muted) }
.it-saving-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: var(--navy-900);
  background: var(--green); border-radius: 999px; padding: 2px 10px; margin-left: 10px;
}
.it-empty { min-height: 320px; display: grid; place-items: center; text-align: center; color: var(--muted) }
.it-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .3 }
.it-privacy-note { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 14px }

/* ── AUTH PAGE ── */
.it-auth-wrap {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 40px 20px;
  background: var(--navy-900);
}
.it-auth-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 20px; padding: 40px;
  box-shadow: var(--shadow-lg); width: 100%; max-width: 420px;
}
.it-auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px }
.it-auth-logo-mark {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  background: var(--green); color: var(--navy-900);
  display: grid; place-items: center; font-size: 22px;
  box-shadow: 0 4px 16px rgba(0,242,149,.4);
}
.it-auth-logo strong { display: block; font-size: 18px; font-weight: 800; font-family: var(--font-head) }
.it-auth-logo small { display: block; color: var(--muted); font-size: 12px }
.it-auth-card h1 { margin: 0 0 6px; font-size: 24px; font-weight: 800 }
.it-auth-card > p { margin: 0 0 24px; color: var(--muted); font-size: 14px }
.it-field-auth { display: grid; gap: 5px; margin-bottom: 14px }
.it-field-auth label { font-size: 13px; font-weight: 600 }
.it-field-auth input {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.it-field-auth input:focus {
  outline: none; border-color: var(--navy-800);
  box-shadow: 0 0 0 3px rgba(0,17,183,.1);
}
/* Auth submit button = green */
.it-btn-full { width: 100%; justify-content: center; min-height: 46px; margin-top: 4px }
.it-auth-card .it-btn-full {
  background: var(--green); color: var(--navy-900); border-color: var(--green);
}
.it-auth-card .it-btn-full:hover {
  background: var(--green-d); border-color: var(--green-d);
}

/* ── RESPONSIVE ── */
@media(max-width:900px) {
  .it-body { grid-template-columns: 1fr }
  .it-sidebar { display: none }
  .it-tool-grid { grid-template-columns: 1fr }
  .it-result-grid { grid-template-columns: 1fr }
  .it-meta-grid { grid-template-columns: repeat(2,1fr) }
  .it-controls-2 { grid-template-columns: 1fr }
}
@media(max-width:560px) {
  .it-main { padding: 16px }
  .it-meta-grid { grid-template-columns: 1fr 1fr }
  .it-topbar-nav a { font-size: 12px; padding: 4px 8px }
}
