/* =========================================================
   Imagesmint — Design System
   Brand: electric blue (#2451FF)
   Fonts: Sora + Inter (Latin) / Cairo (Arabic)
   ========================================================= */

:root {
  --bg: #FAFBFC;
  --surface: #FFFFFF;
  --text: #14171F;
  --text-muted: #5B6270;
  --border: #E6E9EF;
  --brand: #2451FF;
  --brand-dark: #1638C4;
  --brand-light: #6C8CFF;

  --cat-convert: #2451FF;
  --cat-convert-soft: #EAF0FF;
  --cat-compress: #00A676;
  --cat-compress-soft: #E5F8F1;
  --cat-edit: #FF6B35;
  --cat-edit-soft: #FFEEE6;
  --cat-create: #A855F7;
  --cat-create-soft: #F6ECFF;
  --cat-tools: #0EA5A5;
  --cat-tools-soft: #E4F8F8;

  --radius-s: 10px;
  --radius-m: 16px;
  --shadow-sm: 0 1px 2px rgba(20,23,31,.04), 0 4px 12px -8px rgba(20,23,31,.08);
  --shadow-md: 0 4px 8px rgba(20,23,31,.04), 0 12px 28px -12px rgba(20,23,31,.12);
  --shadow-brand: 0 8px 24px -8px rgba(36,81,255,.35);

  --font-latin: 'Sora', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-arabic: 'Cairo', 'Tahoma', system-ui, sans-serif;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .logo, .btn {
  font-family: var(--font-latin);
  font-weight: 700;
  letter-spacing: -0.015em;
}
h1, h2, h3, h4 { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img, svg { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Arabic typography ---------- */
body.lang-ar,
body.lang-ar h1, body.lang-ar h2, body.lang-ar h3, body.lang-ar h4,
body.lang-ar .logo, body.lang-ar .btn, body.lang-ar .main-nav a,
body.lang-ar .mega-trigger, body.lang-ar .lang-trigger {
  font-family: var(--font-arabic);
}
body.lang-ar { letter-spacing: 0; }
body.lang-ar h1, body.lang-ar h2, body.lang-ar h3 { font-weight: 800; }

/* ---------- Soft background ---------- */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 500px;
  background: radial-gradient(ellipse 70% 50% at 50% 0%,
              rgba(99,132,255,0.10) 0%,
              rgba(99,132,255,0.02) 45%,
              transparent 75%);
  pointer-events: none;
  z-index: 0;
}
.site-header, main, .site-footer-pro, .breadcrumbs { position: relative; z-index: 1; }

/* ---------- Layout ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 72px;
}

/* ---------- Logo ---------- */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-end: auto;
  font-weight: 800;
  font-size: 1.22rem;
  color: var(--text);
  letter-spacing: -0.03em;
  transition: transform .2s;
}
.logo:hover { transform: translateY(-1px); }

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand) 100%);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(36,81,255,.5);
  flex-shrink: 0;
}
.logo-mark svg { width: 22px; height: 22px; }
.logo-text { line-height: 1; }

/* ---------- Main nav ---------- */
.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.main-nav > a {
  color: var(--text);
  position: relative;
  padding: 8px 0;
  transition: color .18s;
}
.main-nav > a::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
  border-radius: 2px;
}
.main-nav > a:hover { color: var(--brand); }
.main-nav > a:hover::after { transform: scaleX(1); }

/* ---------- Mega menu ---------- */
.mega-wrap { position: relative; }
.mega-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  letter-spacing: inherit;
  text-transform: inherit;
  transition: color .18s;
}
.mega-trigger:hover,
.mega-wrap.open .mega-trigger { color: var(--brand); }
.mega-trigger .chev {
  width: 13px; height: 13px;
  transition: transform .25s;
  color: var(--text-muted);
}
.mega-wrap.open .chev { transform: rotate(180deg); color: var(--brand); }

.mega-panel {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 20px 40px -20px rgba(20,23,31,.15);
  padding: 36px 0 40px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  z-index: 90;
}
.mega-wrap.open .mega-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px;
}
.mega-col h4 {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.mega-col-optimize h4 { color: var(--cat-compress); }
.mega-col-create h4   { color: var(--cat-create); }
.mega-col-edit h4     { color: var(--cat-edit); }
.mega-col-convert h4  { color: var(--cat-convert); }
.mega-col-tools h4    { color: var(--cat-tools); }

.mega-col ul li { margin-bottom: 8px; }
.mega-col ul li a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text);
  padding: 4px 0;
  transition: color .18s, transform .18s;
}
.mega-col ul li a:hover { color: var(--brand); transform: translateX(3px); }
.mega-col ul li a.disabled { opacity: .45; cursor: default; }
.mega-col ul li a.disabled:hover { color: var(--text); transform: none; }

.mega-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mega-col-optimize .mega-dot { background: var(--cat-compress); }
.mega-col-create   .mega-dot { background: var(--cat-create); }
.mega-col-edit     .mega-dot { background: var(--cat-edit); }
.mega-col-convert  .mega-dot { background: var(--cat-convert); }
.mega-col-tools    .mega-dot { background: var(--cat-tools); }

/* ---------- Language dropdown ---------- */
.lang-dropdown { position: relative; }
.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 10px;
  border: none;
  background: var(--cat-convert-soft);
  color: var(--brand);
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  transition: background .18s;
}
.lang-trigger:hover { background: #dbe6ff; }
.lang-trigger .chev {
  width: 12px; height: 12px;
  transition: transform .25s;
}
.lang-dropdown.open .lang-trigger .chev { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 28px -10px rgba(20,23,31,.18);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s, transform .2s, visibility .2s;
  z-index: 95;
}
.lang-dropdown.open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lang-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text);
  transition: background .15s, color .15s;
}
.lang-menu a:hover { background: var(--bg); }
.lang-menu a.active { background: var(--cat-convert-soft); color: var(--brand); }
.lang-menu a strong {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  min-width: 24px;
}
.lang-menu a span { color: var(--text-muted); }
.lang-menu a.active span { color: var(--brand); opacity: .75; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 24px;
  padding-bottom: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}
.breadcrumbs a {
  color: var(--text-muted);
  transition: color .18s;
}
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs .sep { opacity: .5; }
.breadcrumbs .current {
  color: var(--text);
  font-weight: 600;
}

/* =========================================================
   HERO + DROPZONE
   ========================================================= */
.hero { padding: 68px 0 52px; text-align: center; }
.hero-title {
  font-size: clamp(2rem, 4.6vw, 3.15rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  max-width: 820px;
  margin: 0 auto 20px;
  color: var(--text);
}
.subtitle {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 44px;
  font-size: 1.06rem;
  line-height: 1.65;
}

.dropzone {
  max-width: 660px;
  margin: 0 auto;
  padding: 52px 32px;
  border: 2px dashed #C7D2FE;
  border-radius: 22px;
  background: linear-gradient(180deg, #FAFBFF 0%, #FFFFFF 100%);
  transition: all .22s ease;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--brand);
  background: linear-gradient(180deg, #F0F4FF 0%, #FAFBFF 100%);
  transform: translateY(-2px);
  box-shadow: 0 20px 44px -20px rgba(36,81,255,.25);
}
.dropzone .dz-icon {
  width: 46px; height: 46px;
  margin: 0 auto 14px;
  color: var(--brand);
}
.dropzone p {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 0.98rem;
}
.dropzone input[type=file] { display: none; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 11px;
  border: none;
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand) 100%);
  color: #fff;
  box-shadow: var(--shadow-brand);
  transition: transform .18s, box-shadow .18s, background .18s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -8px rgba(36,81,255,.5); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn.secondary:hover {
  background: var(--bg);
  border-color: #d4d9e3;
  transform: translateY(-1px);
}
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* =========================================================
   TABS + TOOL GRID
   ========================================================= */
.tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 44px 0 12px;
}
.tabs button {
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.87rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .2s;
}
.tabs button:hover { border-color: var(--brand); color: var(--brand); }
.tabs button.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 36px 0 80px;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all .22s ease;
  position: relative;
}
.tool-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: transparent;
}
.tool-card .icon-box {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tool-card .icon-box svg { width: 22px; height: 22px; }
.tool-card h3 {
  font-size: 1.02rem;
  font-weight: 700;
  font-family: var(--font-latin);
}
.tool-card p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.tool-card .badge-soon {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: #F1F2F5;
  color: var(--text-muted);
}

.icon-convert  { background: var(--cat-convert-soft);  color: var(--cat-convert); }
.icon-compress { background: var(--cat-compress-soft); color: var(--cat-compress); }
.icon-edit     { background: var(--cat-edit-soft);     color: var(--cat-edit); }
.icon-create   { background: var(--cat-create-soft);   color: var(--cat-create); }
.icon-tools    { background: var(--cat-tools-soft);    color: var(--cat-tools); }

.section-label {
  text-align: center;
  font-weight: 700;
  font-size: 1.3rem;
  margin: 48px 0 4px;
}

/* =========================================================
   TOOL PAGE
   ========================================================= */
.tool-page-header {
  text-align: center;
  padding: 40px 0 12px;
}
.tool-page-header h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.025em;
}
.tool-page-header p {
  color: var(--text-muted);
  font-size: 1.04rem;
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.65;
}
.tool-page-header p a {
  color: var(--brand);
  font-weight: 700;
  border-bottom: 2px solid rgba(36,81,255,.2);
  transition: border-color .18s;
}
.tool-page-header p a:hover { border-bottom-color: var(--brand); }

.tool-app {
  max-width: 680px;
  margin: 32px auto 90px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 30px;
  box-shadow: var(--shadow-sm);
}
.tool-app .preview { text-align: center; margin-bottom: 22px; }
.tool-app .preview img,
.tool-app .preview canvas {
  max-height: 380px;
  margin: 0 auto;
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
  display: block;
}
.tool-app .controls { display: flex; flex-direction: column; gap: 16px; }
.tool-app label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}
.tool-app input[type=range] { width: 100%; accent-color: var(--brand); }
.tool-app input[type=number],
.tool-app input[type=text] {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font: inherit;
  font-size: 0.92rem;
  transition: border-color .18s, box-shadow .18s;
}
.tool-app input[type=number]:focus,
.tool-app input[type=text]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(36,81,255,.12);
}
.tool-app .row { display: flex; gap: 12px; }
.tool-app .row > div { flex: 1; }
.tool-app .actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.tool-app .file-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}
.tool-app textarea {
  width: 100%;
  min-height: 90px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font: inherit;
  resize: vertical;
}
.tool-app select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font: inherit;
  background: var(--surface);
  cursor: pointer;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text);
}
.checkbox-row label { margin: 0; font-weight: 500; color: var(--text); }

/* =========================================================
   CROPPER
   ========================================================= */
.crop-wrap { position: relative; display: inline-block; max-width: 100%; user-select: none; }
.crop-wrap img { display: block; max-width: 100%; max-height: 440px; }
.crop-box {
  position: absolute;
  border: 2px solid var(--brand);
  background: rgba(36,81,255,.15);
  cursor: move;
  touch-action: none;
}
.crop-box.crop-circle { border-radius: 50%; }
.crop-handle {
  position: absolute;
  width: 16px; height: 16px;
  right: -8px; bottom: -8px;
  background: var(--brand);
  border-radius: 4px;
  cursor: nwse-resize;
  touch-action: none;
}

/* =========================================================
   FOOTER (Dark)
   ========================================================= */
.site-footer-pro {
  background: #0F1218;
  color: #9BA1A6;
  font-size: 14px;
  padding: 50px 0 20px;
  margin-top: 40px;
}
.footer-badges-bar {
  border-bottom: 1px solid #1E232C;
  padding-bottom: 28px;
  margin-bottom: 40px;
}
.badges-flex {
  display: flex;
  justify-content: center;
  gap: 44px;
  align-items: center;
  color: #fff;
  flex-wrap: wrap;
}
.badge-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.badge-item svg { width: 17px; height: 17px; color: #7DA0FF; }

.footer-main-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  max-width: 900px !important;
  margin: 0 auto 44px !important;
}
.footer-col { text-align: center; }
.footer-col h4 {
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
  font-weight: 800;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a {
  color: #9BA1A6;
  font-size: 0.88rem;
  transition: color .18s;
}
.footer-col ul li a:hover { color: #fff; }

.footer-divider {
  border: none;
  border-top: 1px solid #1E232C;
  margin: 20px 0;
}
.footer-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-lang-selector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #181C24;
  border: 1px solid #232832;
  padding: 7px 12px;
  border-radius: 8px;
  color: #fff;
}
.footer-lang-selector svg { width: 15px; height: 15px; color: #7DA0FF; }
.footer-lang-selector select {
  background: transparent;
  color: #fff;
  border: none;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  padding-inline-end: 4px;
}
.footer-lang-selector select option { background: #0F1218; color: #fff; }

.footer-social-icons { display: flex; gap: 10px; }
.footer-social-icons a {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #181C24;
  color: #fff;
  transition: background .18s, transform .18s;
}
.footer-social-icons a:hover {
  background: var(--brand);
  transform: translateY(-2px);
}
.footer-social-icons svg { width: 16px; height: 16px; }

.footer-copyright {
  margin: 0;
  font-size: 0.82rem;
  color: #6B7280;
}

/* =========================================================
   RTL ADJUSTMENTS
   ========================================================= */
html[dir="rtl"] .main-nav > a::after { transform-origin: right; }
html[dir="rtl"] .mega-col ul li a:hover { transform: translateX(-3px); }
html[dir="rtl"] .breadcrumbs .sep { transform: rotate(180deg); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1000px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .mega-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}
@media (max-width: 900px) {
  .footer-main-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}
@media (max-width: 860px) {
  .main-nav { display: none; }
  .header-inner { height: 64px; gap: 16px; }
  .mega-panel { top: 64px; }
}
@media (max-width: 768px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .mega-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 44px 0 36px; }
  .tool-app { padding: 22px; margin-bottom: 60px; }
  .footer-main-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom-bar { justify-content: center; text-align: center; }
}
@media (max-width: 480px) {
  .tool-grid { grid-template-columns: 1fr; }
  .mega-grid { grid-template-columns: 1fr; gap: 20px; }
  .badges-flex { gap: 22px; }
  .dropzone { padding: 36px 20px; }
  .tool-app .row { flex-direction: column; }
}

/* =========================================================
   TOOL PAGES — I❤️IMG Style
   ========================================================= */

/* منطقة الأداة: نظيفة، بدون صندوق داخلي */
.tool-app {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* منطقة الرفع: بدون حدود، فقط مساحة بسيطة */
.tool-app .dropzone {
  background: transparent !important;
  border: none !important;
  padding: 20px 0 40px !important;
  max-width: 560px !important;
  margin: 0 auto !important;
}

.tool-app .dropzone:hover,
.tool-app .dropzone.dragover {
  background: transparent !important;
  border: none !important;
  transform: none !important;
  box-shadow: none !important;
}

/* إخفاء الأيقونة السهمية والنص العلوي */
.tool-app .dropzone .dz-icon {
  display: none !important;
}

.tool-app .dropzone > p:first-of-type {
  display: none !important;
}

/* الزر: كبير، عريض، مثل I❤️IMG */
.tool-app .dropzone .btn {
  display: flex !important;
  width: 100% !important;
  max-width: 460px !important;
  margin: 0 auto !important;
  padding: 20px 32px !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #4A90FF 0%, #2E7BFF 100%) !important;
  box-shadow: 0 10px 24px -8px rgba(36,81,255,.5) !important;
  text-align: center !important;
  justify-content: center !important;
  transition: all .25s ease !important;
}

.tool-app .dropzone .btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 16px 32px -10px rgba(36,81,255,.6) !important;
}

/* نص "or drop images here" أسفل الزر */
.tool-app .dropzone .btn::after {
  content: "";
}

/* إخفاء صندوق الملف الأصلي */
.tool-app .dropzone input[type="file"] {
  display: none !important;
}

/* إضافة النص أسفل الزر عند الحاجة */
.tool-app .dropzone::after {
  content: "";
  display: block;
  margin-top: 16px;
  text-align: center;
  font-size: 0.9rem;
  color: #9CA3AF;
  font-weight: 500;
}

body.lang-en .tool-app .dropzone::after { content: "or drop images here"; }
body.lang-fr .tool-app .dropzone::after { content: "ou déposez les images ici"; }
body.lang-ar .tool-app .dropzone::after { content: "أو أسقط الصور هنا"; }

/* إصلاح لون نص الزر */
.tool-app .dropzone .btn,
.tool-app .dropzone .btn:visited,
.tool-app .dropzone label.btn {
  color: #FFFFFF !important;
}
/* ===== Format badges in tool descriptions (iLoveIMG style) ===== */
.tool-page-header p .fmt {
  color: var(--brand);
  font-weight: 700;
  border-bottom: 2px solid rgba(36,81,255,.2);
  transition: border-color .18s;
  padding-bottom: 1px;
}
.tool-page-header p .fmt:hover {
  border-bottom-color: var(--brand);
}
/* تباعد خاص للعربية — أوسع من الإنجليزية */
body.lang-ar .main-nav {
  gap: 26px !important;
  font-size: 0.82rem !important;
  letter-spacing: 0 !important;
}

/* تكبير بسيط لنص الروابط العربية */
body.lang-ar .main-nav > a,
body.lang-ar .mega-trigger {
  font-weight: 700;
}
/* نقل الروابط لتكون ملاصقة للشعار (مثل iLoveIMG) */
.logo {
  margin-inline-end: 0 !important;
}

.lang-dropdown {
  margin-inline-start: auto !important;
}

/* الرابط النشط في القائمة العلوية */
.main-nav > a.active {
  color: var(--brand) !important;
}
.main-nav > a.active::after {
  transform: scaleX(1) !important;
}
/* =========================================================
   MOBILE MENU (Hamburger)
   ========================================================= */

/* إخفاء زر الهامبرغر على الكمبيوتر */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  border-radius: 10px;
  transition: background .18s;
  flex-shrink: 0;
}
.mobile-menu-toggle:hover { background: var(--bg); }
.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
  margin: 0 auto;
}
.mobile-menu-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-menu-toggle.open span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =========================================================
   MOBILE NAVIGATION PANEL
   ========================================================= */
.mobile-nav {
position: fixed;
top: 64px;
left: 0;
right: 0;
bottom: 0;
background: #fff;
overflow-y: auto;
z-index: 99;
padding: 24px 20px 40px;
border-top: 1px solid var(--border);
opacity: 0;
visibility: hidden;
transform: translateY(-8px);
transition: opacity .22s, transform .22s, visibility .22s;
pointer-events: none;
}

.mobile-nav.open {
opacity: 1;
visibility: visible;
transform: translateY(0);
pointer-events: auto;
}
}
.mobile-nav h5 {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 20px 0 10px;
  padding: 0 4px;
}
.mobile-nav h5:first-child { margin-top: 0; }
.mobile-nav a {
  display: block;
  padding: 12px 12px;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text);
  border-radius: 10px;
  transition: background .15s, color .15s;
}
.mobile-nav a:hover,
.mobile-nav a.active {
  background: var(--cat-convert-soft);
  color: var(--brand);
}
.mobile-nav .mobile-cat-convert  { color: var(--cat-convert); }
.mobile-nav .mobile-cat-compress { color: var(--cat-compress); }
.mobile-nav .mobile-cat-edit     { color: var(--cat-edit); }
.mobile-nav .mobile-cat-create   { color: var(--cat-create); }
.mobile-nav .mobile-cat-tools    { color: var(--cat-tools); }

.mobile-nav hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* عند فتح القائمة، منع التمرير في الخلفية */
body.mobile-nav-open {
  overflow: hidden;
}

/* تفعيل القائمة على الجوال */
@media (max-width: 860px) {
  .mobile-menu-toggle { display: flex; }
  .header-inner { height: 64px; }
  .mega-panel { display: none !important; }
  .lang-dropdown {
    margin-inline-start: auto;
  }
  .logo {
    margin-inline-end: 0 !important;
  }
}

/* =========================================================
   ضبط نهائي لمسافات قائمة الجوال
   ========================================================= */
@media (max-width: 860px) {
  .mobile-nav {
    padding: 12px 14px 24px !important;
  }
  .mobile-nav h5 {
    font-size: 0.68rem !important;
    margin: 14px 0 4px 0 !important;
    padding: 0 8px !important;
    line-height: 1.2 !important;
  }
  .mobile-nav h5:first-child {
    margin-top: 0 !important;
  }
  .mobile-nav a {
    display: block !important;
    padding: 6px 10px !important;
    margin: 0 !important;
    font-size: 0.9rem !important;
    line-height: 1.25 !important;
    font-weight: 600 !important;
  }
  .mobile-nav hr {
    margin: 8px 0 !important;
  }
}
/* ===== الروابط الملونة للصيغ (JPG, PNG, WebP) ===== */
.tool-page-header p .fmt,
.tool-card p .fmt {
  color: var(--brand);
  font-weight: 700;
  border-bottom: 1.5px solid rgba(36,81,255,.25);
  padding-bottom: 1px;
  transition: border-color .18s;
}
.tool-page-header p .fmt:hover,
.tool-card p .fmt:hover {
  border-bottom-color: var(--brand);
}
/* تقليل فراغ hero في الصفحة الرئيسية (بعد إزالة صندوق الرفع) */
.hero {
  padding: 44px 0 12px !important;
}
.hero-title {
  margin-bottom: 12px !important;
}
.subtitle {
  margin-bottom: 24px !important;
}

/* ===== Blog Articles ===== */
.article-wrap {
  max-width: 780px !important;
  margin: 40px auto 100px !important;
}
.article-header {
  margin-bottom: 40px;
  text-align: center;
}
.article-header h1 {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}
.article-meta { color: var(--text-muted); font-size: 0.88rem; }
.article-body { font-size: 1.05rem; line-height: 1.75; color: var(--text); }
.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 40px 0 16px;
  letter-spacing: -0.02em;
}
.article-body h3 { font-size: 1.15rem; font-weight: 700; margin: 28px 0 12px; }
.article-body p { margin: 0 0 18px; }
.article-body ul, .article-body ol { margin: 0 0 20px; padding-inline-start: 24px; }
.article-body li { margin-bottom: 8px; }
.article-body a {
  color: var(--brand);
  font-weight: 600;
  border-bottom: 1.5px solid rgba(36,81,255,.25);
  transition: border-color .18s;
}
.article-body a:hover { border-bottom-color: var(--brand); }
.article-body strong { font-weight: 700; color: var(--text); }



/* =========================================================
   New components: SEO content, FAQ, palette, contact form
   ========================================================= */
.seo-content { max-width: 860px; }
.seo-block { margin-bottom: 40px; }
.seo-block h2 { font-size: 1.45rem; margin-bottom: 14px; color: var(--text); }
.seo-text p { margin: 0 0 12px; color: var(--text-muted); line-height: 1.7; }
.seo-text a { color: var(--brand); font-weight: 600; }
.seo-intro { background: var(--cat-tools-soft); border: 1px solid var(--border); border-radius: var(--radius-m); padding: 16px 20px; margin-bottom: 32px; color: var(--text); font-weight: 500; }
.seo-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 720px) { .seo-grid-2 { grid-template-columns: 1fr; } }
.seo-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 14px; }
.seo-steps li { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m); padding: 14px 18px; }
.step-num { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
.seo-steps li div { color: var(--text-muted); line-height: 1.6; }
.seo-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.seo-features li { display: flex; gap: 10px; color: var(--text-muted); }
.seo-features .check { color: #00A676; font-weight: 700; }
.faq-list { display: grid; gap: 10px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--surface); overflow: hidden; }
.faq-item summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--text); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.3rem; color: var(--brand); font-weight: 400; }
.faq-item[open] summary::after { content: '−'; }
.faq-a { padding: 0 18px 16px; color: var(--text-muted); line-height: 1.7; }
.related-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Tool UI additions */
.status-line { margin: 10px 0; font-weight: 600; color: var(--brand); min-height: 1.4em; }
.target-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.target-controls label { font-weight: 600; }
.target-controls select, .target-controls input[type=number] { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-s); font: inherit; background: var(--surface); color: var(--text); }
.file-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0; font-size: 0.9rem; color: var(--text-muted); }
.meta-heading { font-size: 1rem; margin: 8px 0; color: var(--text); }
.meta-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 12px 14px; margin-bottom: 12px; }
.meta-row { font-size: 0.9rem; padding: 4px 0; color: var(--text-muted); }
.meta-row strong { color: var(--text); }

/* Palette generator */
.palette-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 720px) { .palette-layout { grid-template-columns: 1fr; } }
.palette-side h3 { margin-bottom: 10px; font-size: 1.1rem; }
.palette-grid { display: grid; gap: 8px; }
.swatch { border-radius: var(--radius-m); padding: 16px; min-height: 74px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.swatch-hex { font-family: 'Sora', monospace; font-weight: 700; font-size: 1.05rem; letter-spacing: 0.02em; }
.swatch-rgb { font-size: 0.8rem; opacity: 0.85; }
.swatch-actions { display: flex; gap: 6px; margin-top: 4px; }
.copy-btn { background: rgba(255,255,255,0.25); border: 1px solid rgba(0,0,0,0.15); color: inherit; padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.copy-btn:hover { background: rgba(255,255,255,0.45); }
.copy-msg { font-size: 0.85rem; color: #00A676; font-weight: 600; min-height: 1.2em; margin-bottom: 8px; }

/* Contact form */
.contact-form { max-width: 560px; }
.form-row { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-weight: 600; font-size: 0.92rem; }
.form-row input, .form-row textarea { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-s); font: inherit; background: var(--surface); color: var(--text); width: 100%; }
.form-row textarea { resize: vertical; min-height: 120px; }
.form-error { color: #dc2626; font-weight: 600; margin: 8px 0; }
.form-success { color: #00A676; font-weight: 600; margin: 12px 0; }
.form-note { font-size: 0.82rem; color: var(--text-muted); margin-top: 10px; }
/* رابط "عرض الكل" في Mega Menu */
.mega-view-all {
  margin-top: 10px !important;
  padding-top: 10px !important;
  border-top: 1px solid var(--border);
}
.mega-view-all a {
  color: var(--brand) !important;
  font-weight: 700 !important;
  font-size: 0.82rem !important;
  padding: 4px 0 !important;
}
.mega-view-all a:hover {
  transform: translateX(4px) !important;
}
/* رابط "عرض الكل" في قائمة الجوال */
.mobile-view-all {
  color: var(--brand) !important;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  padding: 8px 10px !important;
  margin-top: 4px !important;
  border-top: 1px solid var(--border) !important;
}
.mobile-view-all:hover {
  background: var(--cat-convert-soft) !important;
}
/* عنوان التصنيف القابل للنقر في قائمة الجوال */
.mobile-nav .mobile-cat-title {
  display: inline-block !important;
  color: var(--text) !important;
  font-weight: 800 !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
  transition: background .15s, color .15s !important;
}
.mobile-nav .mobile-cat-title:hover {
  background: var(--cat-convert-soft) !important;
  color: var(--brand) !important;
}
.mobile-nav .mobile-cat-all {
  color: var(--brand) !important;
  font-weight: 700 !important;
}

/* =========================================================
   APPEND 13.0 — SIZE WARNING + COLOR PICKER + DRAG HINT + BIG DOWNLOAD
   (added 2024-11: bugfix batch — append-only, existing rules untouched)
   ========================================================= */

/* "Size increased by X%" notice shown above the action buttons */
.size-warning {
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  padding: 8px 12px;
  border-radius: 8px;
  color: #92400E !important;
  font-weight: 500;
  font-size: 0.85rem;
  margin-top: 8px;
}

/* Text tools: native color input + quick swatch palette */
.color-picker-wrap { display: flex; gap: 12px; align-items: center; }
.color-picker-wrap input[type=color] { width: 48px; height: 42px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; padding: 2px; background: var(--surface); }
.quick-colors { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-colors button { width: 32px; height: 32px; border-radius: 8px; border: 2px solid var(--border); cursor: pointer; transition: transform .15s; }
.quick-colors button:hover { transform: scale(1.15); }

/* Text tools: drag-to-position hint under the canvas */
.drag-hint {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* More prominent primary download button in tool apps */
.tool-app .actions .btn:not(.secondary) {
  min-width: 220px;
  font-size: 1rem;
  padding: 14px 32px;
}

@media (max-width: 480px) {
  .tool-app .actions { flex-direction: column; }
  .tool-app .actions .btn { width: 100%; }
}
