/* =========================================================
   DevUtils Pro — Tools CSS v3
   Standard light theme component styles
   ========================================================= */

/* ─── Tool Card ──────────────────────────────────────────── */
.tool-card {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 12px;
}

.tool-card:last-child { margin-bottom: 0; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
  min-height: 24px;
}

.card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-label-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ─── Textarea ───────────────────────────────────────────── */
.tool-textarea {
  width: 100%;
  min-height: 120px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  padding: 12px 14px;
  resize: vertical;
  transition: border-color var(--ease), box-shadow var(--ease);
  outline: none;
}

.tool-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(9,105,218,0.1);
  background: var(--bg-base);
}

.tool-textarea::placeholder {
  color: var(--text-3);
  font-family: var(--font);
  font-size: 13px;
}

.tool-textarea.output-area {
  color: var(--text-2);
  background: var(--bg-surface);
  cursor: default;
}

.tool-textarea.output-area:focus {
  border-color: var(--border);
  box-shadow: none;
}

.tool-textarea.error-area {
  border-color: var(--red);
  background: var(--red-bg);
  color: var(--red);
}

/* ─── Input ──────────────────────────────────────────────── */
.tool-input {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 12px;
  transition: border-color var(--ease), box-shadow var(--ease);
  outline: none;
}

.tool-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(9,105,218,0.1);
}

.tool-input::placeholder {
  color: var(--text-3);
  font-family: var(--font);
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--ease);
  white-space: nowrap;
  outline: none;
  user-select: none;
  height: 32px;
  line-height: 1;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Primary — solid black */
.btn-primary {
  background: #1f2328;
  color: #fff;
  border-color: #1f2328;
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
  background: #32383f;
  border-color: #32383f;
}

.btn-primary:active { background: #1f2328; }

/* Secondary — white with border */
.btn-secondary {
  background: var(--bg-base);
  color: var(--text-1);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: #b0b7c1;
}

/* Ghost — no background */
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
  padding: 5px 8px;
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-1);
  border-color: var(--border);
}

/* Danger */
.btn-danger {
  background: var(--bg-base);
  color: var(--red);
  border-color: var(--red-border);
}

.btn-danger:hover {
  background: var(--red-bg);
}

/* Success */
.btn-success {
  background: var(--bg-base);
  color: var(--green);
  border-color: var(--green-border);
  box-shadow: var(--shadow-xs);
}

.btn-success:hover {
  background: var(--green-bg);
}

/* Sizes */
.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  font-size: 15px;
}

.btn-sm {
  height: 28px;
  padding: 4px 10px;
  font-size: 12px;
}

.btn-lg {
  height: 36px;
  padding: 8px 18px;
  font-size: 14px;
}

/* ─── Hash Rows ──────────────────────────────────────────── */
.hash-results {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.hash-row {
  background: var(--bg-base);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--ease);
}

.hash-row:last-child { border-bottom: none; }
.hash-row:hover { background: var(--bg-hover); }

.hash-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.hash-algo {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--mono);
  border: 1px solid;
}

.hash-algo.md5    { background: var(--yellow-bg); color: var(--yellow); border-color: #f0d060; }
.hash-algo.sha1   { background: #dff7ff; color: #0969da; border-color: #9ecfff; }
.hash-algo.sha256 { background: var(--accent-dim); color: var(--accent); border-color: rgba(9,105,218,0.2); }
.hash-algo.sha512 { background: var(--purple-bg); color: var(--purple); border-color: #cfb3f8; }

.hash-value {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-2);
  word-break: break-all;
  line-height: 1.6;
}

/* ─── Two-col ────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.two-col .tool-card { margin-bottom: 0; }

@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }

/* ─── Action bar ─────────────────────────────────────────── */
.action-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 4px;
  flex-wrap: wrap;
}

/* ─── Tab Switcher ───────────────────────────────────────── */
.tab-switcher {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 2px;
  gap: 1px;
}

.tab-btn {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--ease);
  font-family: var(--font);
  height: 26px;
  display: flex;
  align-items: center;
}

.tab-btn.active {
  background: var(--bg-base);
  color: var(--text-1);
  box-shadow: var(--shadow-xs);
}

.tab-btn:hover:not(.active) { color: var(--text-1); }

/* ─── Status Badge ───────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid;
}

.status-badge.valid   { color: var(--green); border-color: var(--green-border); background: var(--green-bg); }
.status-badge.invalid { color: var(--red);   border-color: var(--red-border);   background: var(--red-bg); }
.status-badge.neutral { color: var(--text-3); border-color: var(--border);      background: transparent; }

/* ─── Section Divider ────────────────────────────────────── */
.section-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 10px;
}

.section-row-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}

.section-row-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* ─── Minify Stats ───────────────────────────────────────── */
.minify-stats {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--border);
  margin-bottom: 14px;
}

.minify-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  padding: 12px 8px;
  border-right: 1px solid var(--border);
}
.minify-stat:last-child { border-right: none; }

.minify-stat-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  font-family: var(--mono);
  line-height: 1;
}

.minify-stat-label {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 4px;
}

/* ─── Timestamp Table ────────────────────────────────────── */
.timestamp-table {
  width: 100%;
  border-collapse: collapse;
}

.timestamp-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  vertical-align: middle;
}

.timestamp-table tr:last-child td { border-bottom: none; }

.timestamp-table td:first-child {
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  width: 170px;
  white-space: nowrap;
}

.timestamp-table td:last-child {
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 12.5px;
}

/* ─── UUID List ──────────────────────────────────────────── */
.uuid-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}

.uuid-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-base);
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--ease);
}

.uuid-item:last-child { border-bottom: none; }
.uuid-item:hover { background: var(--bg-hover); }

.uuid-value {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-2);
  letter-spacing: 0.3px;
}

/* ─── Lorem Output ───────────────────────────────────────── */
.lorem-output {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.8;
  min-height: 100px;
  white-space: pre-wrap;
}

/* ─── Color Preview ──────────────────────────────────────── */
.color-preview {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: all var(--ease);
}

.color-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

/* ─── Regex ──────────────────────────────────────────────── */
.regex-flags { display: flex; gap: 3px; }

.flag-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-base);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  cursor: pointer;
  transition: all var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.flag-btn.active {
  background: var(--accent-dim);
  border-color: rgba(9,105,218,0.3);
  color: var(--accent);
}

.flag-btn:hover:not(.active) {
  background: var(--bg-hover);
  color: var(--text-1);
}

.regex-matches-info { display: flex; align-items: center; gap: 8px; }

.match-count {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(9,105,218,0.2);
}

/* ─── Password ───────────────────────────────────────────── */
.strength-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
  margin-top: 8px;
}

.strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
}

.pw-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
}

.pw-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--text-1);
  cursor: pointer;
  user-select: none;
}

.pw-checkbox input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ─── Range Slider ───────────────────────────────────────── */
.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.range-label {
  font-size: 13px;
  color: var(--text-2);
  min-width: 60px;
}

.range-value {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  min-width: 28px;
  text-align: right;
}

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
  transition: transform var(--ease);
}

input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }

/* ─── Char Counter ───────────────────────────────────────── */
.char-counter {
  font-size: 11px;
  color: var(--text-3);
  text-align: right;
  margin-top: 4px;
  font-family: var(--mono);
}

/* ─── Info Box ───────────────────────────────────────────── */
.info-box {
  background: #dff7ff;
  border: 1px solid #9ecfff;
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 13px;
  color: #0550ae;
  line-height: 1.6;
  margin-bottom: 16px;
}

.info-box strong { color: var(--accent); }

/* ─── Select ─────────────────────────────────────────────── */
select.tool-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23656d76' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  appearance: none;
  -webkit-appearance: none;
}
