/* --- SHARED TOOL LAYOUTS --- */
.tool-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
@media (max-width: 992px) {
  .tool-container {
    grid-template-columns: 1fr;
  }
}

.tool-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.tool-panel-title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 8px;
}

/* --- FORMS & INPUTS --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}
.form-input, .form-select, .form-textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 15px;
  transition: all 0.2s ease;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.form-input[type="color"] {
  height: 48px;
  padding: 4px;
  cursor: pointer;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 576px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.input-helper {
  font-size: 12px;
  color: var(--text-muted);
}

/* --- RANGE SLIDERS --- */
.range-slider-container {
  display: flex;
  align-items: center;
  gap: 16px;
}
.range-slider {
  flex-grow: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--border);
  outline: none;
  cursor: pointer;
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: transform 0.1s ease;
}
.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.range-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  min-width: 36px;
  text-align: right;
}

/* --- DRAG & DROP ZONE --- */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  background-color: var(--bg-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.dropzone.dragover, .dropzone:hover {
  border-color: var(--primary);
  background-color: rgba(var(--primary-rgb), 0.03);
}
.dropzone-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background-color: var(--bg-secondary);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.dropzone:hover .dropzone-icon {
  color: var(--primary);
  border-color: var(--primary-hover);
  transform: translateY(-2px);
}
.dropzone-title {
  font-weight: 600;
  font-size: 16px;
}
.dropzone-title span {
  color: var(--primary);
}
.dropzone-desc {
  font-size: 13px;
  color: var(--text-muted);
}
.file-input {
  display: none;
}

/* --- IMAGE PREVIEW & WORKSPACE --- */
.image-preview-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.preview-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--bg-primary);
  min-height: 200px;
  max-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.preview-image {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
}
.image-meta-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  background-color: var(--bg-tertiary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

/* --- RESULTS DISPLAY --- */
.result-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.result-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
}
.result-actions {
  display: flex;
  gap: 8px;
}
.result-value-large {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.results-grid-sm {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}
.result-item-sm {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: var(--radius-sm);
  text-align: center;
}
.result-item-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.result-item-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* --- PASSWORD STRENGTH METER --- */
.strength-meter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.strength-bars {
  display: flex;
  gap: 4px;
  height: 6px;
}
.strength-bar {
  flex-grow: 1;
  background-color: var(--border);
  border-radius: var(--radius-full);
  transition: background-color 0.2s ease;
}
.strength-label {
  font-size: 12px;
  font-weight: 600;
  align-self: flex-end;
}
.strength-very-weak .strength-bar:nth-child(1) { background-color: var(--error); }
.strength-weak .strength-bar:nth-child(1),
.strength-weak .strength-bar:nth-child(2) { background-color: #f97316; }
.strength-medium .strength-bar:nth-child(1),
.strength-medium .strength-bar:nth-child(2),
.strength-medium .strength-bar:nth-child(3) { background-color: var(--warning); }
.strength-strong .strength-bar:nth-child(1),
.strength-strong .strength-bar:nth-child(2),
.strength-strong .strength-bar:nth-child(3),
.strength-strong .strength-bar:nth-child(4) { background-color: #84cc16; }
.strength-very-strong .strength-bar { background-color: var(--success); }

/* --- TEXT AREA DISPLAY --- */
.code-display {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  min-height: 180px;
  max-height: 450px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-primary);
}

/* --- COLOR PICKER UTILITIES --- */
.color-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 10px;
}
.color-swatch-item {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.1s ease;
  position: relative;
}
.color-swatch-item:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-sm);
}

/* --- ACCORDION LISTS (HISTORY/FAVORITES IN TOOLBARS) --- */
.tool-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
}
.tool-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.tool-history-val {
  font-weight: 600;
  color: var(--primary);
}

/* --- BMI BAR METER --- */
.bmi-meter-wrapper {
  margin-top: 10px;
}
.bmi-bar {
  display: flex;
  height: 12px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background-color: var(--border);
  position: relative;
}
.bmi-seg {
  height: 100%;
}
.bmi-underweight { width: 18.5%; background-color: var(--info); }
.bmi-normal { width: 6.5%; background-color: var(--success); }
.bmi-overweight { width: 5%; background-color: var(--warning); }
.bmi-obese { width: 70%; background-color: var(--error); }
.bmi-marker {
  position: absolute;
  top: -4px;
  width: 6px;
  height: 20px;
  background-color: var(--text-primary);
  border-radius: var(--radius-full);
  border: 1px solid #ffffff;
  transform: translateX(-50%);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- SHARE BUTTONS --- */
.share-links-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.share-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--primary);
  transform: translateY(-2px);
}
.share-btn svg {
  width: 24px;
  height: 24px;
}

/* Tool page details article style */
.tool-details-article {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 0;
  color: var(--text-secondary);
}
.tool-details-article h2 {
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 700;
  margin: 32px 0 16px;
}
.tool-details-article h3 {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 12px;
}
.tool-details-article p {
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.7;
}
.tool-details-article ul, .tool-details-article ol {
  margin-bottom: 20px;
  padding-left: 24px;
}
.tool-details-article li {
  margin-bottom: 8px;
  font-size: 15px;
  list-style-type: disc;
}
.tool-details-article ol li {
  list-style-type: decimal;
}
.tool-details-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}
.tool-details-article th, .tool-details-article td {
  border: 1px solid var(--border);
  padding: 12px;
  text-align: left;
}
.tool-details-article th {
  background-color: var(--bg-tertiary);
  font-weight: 600;
}
.tool-details-article blockquote {
  border-left: 4px solid var(--primary);
  padding: 12px 20px;
  background-color: var(--bg-tertiary);
  margin: 24px 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
}
