/* ============================================================
   Adawix — tools.css  |  Tool Page Shared Styles
   ============================================================ */

/* ── Tool Page Layout ── */
.tool-page { padding: var(--sp-8) 0 var(--sp-12); }
.tool-header { margin-bottom: var(--sp-8); }
.tool-header h1 { margin-bottom: var(--sp-3); }
.tool-header p   { color: var(--text-muted); font-size: 1.05rem; max-width: 700px; }
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--sp-8);
  align-items: start;
}
.tool-main { min-width: 0; }
.tool-sidebar { display: flex; flex-direction: column; gap: var(--sp-6); }
@media (max-width: 1024px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-sidebar { display: none; }
}

/* ── Tool Card (wrapper) ── */
.tool-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  box-shadow: var(--shadow-sm);
}
html.dark .tool-box { background: var(--bg-card); border-color: var(--border); }

/* ── Textarea / Input ── */
.tool-textarea {
  width: 100%;
  min-height: 200px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--text);
  background: var(--bg);
  resize: vertical;
  transition: border-color var(--transition);
  direction: rtl;
  line-height: 1.7;
}
.tool-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
html.dark .tool-textarea { background: #162032; color: var(--text); border-color: var(--border); }

.tool-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  font-size: .95rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition);
}
.tool-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
html.dark .tool-input { background: #162032; color: var(--text); border-color: var(--border); }

.tool-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-4);
  font-size: .9rem;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
html.dark .tool-select { background: #162032; color: var(--text); border-color: var(--border); }

/* ── Tool Actions Bar ── */
.tool-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin: var(--sp-4) 0;
}
.tool-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}

/* ── Stats Display ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--sp-3);
  margin: var(--sp-4) 0;
}
.stat-box {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-4);
  text-align: center;
  transition: all var(--transition);
}
.stat-box:hover { border-color: var(--primary); }
.stat-box .num {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
}
.stat-box .lbl { font-size: .75rem; color: var(--text-muted); margin-top: var(--sp-1); }
html.dark .stat-box { background: #162032; }

/* ── Output Area ── */
.output-area {
  background: var(--bg-section);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  min-height: 120px;
  font-size: .95rem;
  color: var(--text);
  line-height: 1.7;
  position: relative;
  word-break: break-word;
  white-space: pre-wrap;
}
html.dark .output-area { background: #162032; }

/* ── File Drop Zone ── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-12) var(--sp-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-section);
  position: relative;
}
.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary);
  background: #EFF6FF;
}
html.dark .drop-zone:hover,
html.dark .drop-zone.dragover { background: #1E3A5F; }
.drop-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-zone .drop-icon { font-size: 2.5rem; margin-bottom: var(--sp-3); }
.drop-zone h3 { font-size: 1rem; margin-bottom: var(--sp-2); }
.drop-zone p  { font-size: .85rem; color: var(--text-muted); margin: 0; }

/* ── File List ── */
.file-list { margin-top: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.file-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
}
.file-item .file-name { flex: 1; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .file-size { font-size: .8rem; color: var(--text-muted); flex-shrink: 0; }
.file-item .file-remove { background: none; border: none; color: var(--error); font-size: 1.1rem; flex-shrink: 0; }

/* ── Progress Bar ── */
.progress-wrap { margin: var(--sp-4) 0; }
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: var(--radius-full);
  transition: width .3s ease;
}
.progress-label { font-size: .8rem; color: var(--text-muted); margin-top: var(--sp-2); }

/* ── Strength Meter (password) ── */
.strength-bar { display: flex; gap: 4px; margin: var(--sp-3) 0; }
.strength-segment { flex: 1; height: 6px; border-radius: 3px; background: var(--border); transition: background .3s; }
.strength-label { font-size: .8rem; font-weight: 600; }
.strength-weak   .strength-segment:nth-child(1) { background: var(--error); }
.strength-fair   .strength-segment:nth-child(-n+2) { background: var(--accent); }
.strength-good   .strength-segment:nth-child(-n+3) { background: var(--secondary); }
.strength-strong .strength-segment { background: var(--success); }

/* ── Slider ── */
.range-wrap { display: flex; align-items: center; gap: var(--sp-4); }
input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 6px rgba(37,99,235,.3);
}
.range-value {
  min-width: 40px;
  text-align: center;
  font-weight: 700;
  color: var(--primary);
}

/* ── Options Row ── */
.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin: var(--sp-4) 0;
}
.option-check {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  font-size: .9rem;
}
.option-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ── Table ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.data-table th {
  background: var(--bg-section);
  padding: var(--sp-3) var(--sp-4);
  text-align: right;
  font-weight: 600;
  font-size: .8rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.data-table tbody tr:hover { background: var(--bg-section); }
.data-table tbody tr:last-child td { border-bottom: none; }
html.dark .data-table th { background: #162032; }

/* ── How To Use Section ── */
.how-to { padding: var(--sp-8) 0; }
.steps-list { counter-reset: step; display: flex; flex-direction: column; gap: var(--sp-4); margin-top: var(--sp-6); }
.step-item {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
}
.step-num {
  counter-increment: step;
  min-width: 36px; height: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}
.step-content h4 { font-size: .95rem; margin-bottom: var(--sp-1); }
.step-content p  { font-size: .875rem; color: var(--text-muted); margin: 0; }

/* ── Color Input ── */
.color-wrap { display: flex; align-items: center; gap: var(--sp-3); }
input[type="color"] { width: 40px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; padding: 2px; }

/* ── Result Image ── */
.result-img-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #f0f0f0;
  text-align: center;
}
.result-img-wrap img, .result-img-wrap canvas { max-width: 100%; max-height: 300px; object-fit: contain; }

/* ── JSON Syntax Highlighting ── */
.json-output {
  background: #0F172A;
  color: #E2E8F0;
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  font-family: var(--font-mono);
  font-size: .85rem;
  line-height: 1.6;
  overflow: auto;
  max-height: 500px;
  white-space: pre;
  text-align: left;
  direction: ltr;
}
.json-key    { color: #93C5FD; }
.json-string { color: #86EFAC; }
.json-number { color: #FCA5A5; }
.json-bool   { color: #FDBA74; }
.json-null   { color: #C4B5FD; }

/* ── QR Output ── */
.qr-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
