/* LoveTool.site - Specialized Tool Interface Components */

/* Form Controls & Inputs */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

/* Two Column & Grid Layouts for Workbench */
.workbench-layout-split {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 992px) {
  .workbench-layout-split {
    grid-template-columns: 1fr;
  }
}

.sidebar-controls {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
  color: var(--text-main);
}

/* Slider Controls */
.slider-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.slider-input {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.slider-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider-val-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  min-width: 48px;
  text-align: center;
}

/* Segmented Buttons / Tabs */
.segmented-control {
  display: flex;
  background: var(--bg-surface-elevated);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 0.3rem;
}

.segmented-btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  transition: all var(--transition-fast);
}

.segmented-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Reorderable File Item List (For Merge PDF, JPG to PDF) */
.file-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.file-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.file-item-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-elevated);
}

.file-item-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  overflow: hidden;
}

.file-icon-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.file-item-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}

.file-item-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.file-item-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* PDF Page Thumbnails Grid (For Split, Rotate, Editor) */
.pdf-pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.pdf-page-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: all var(--transition-fast);
}

.pdf-page-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.pdf-page-card.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.pdf-thumbnail-canvas {
  width: 100%;
  max-width: 160px;
  height: auto;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
  background: #fff;
}

.pdf-page-info {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.page-select-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* PDF Live Viewer & Interactive Editor Canvas */
.pdf-editor-workspace {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 600px;
  position: relative;
  overflow: auto;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 0.5rem 0.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 50;
}

.tool-action-btn {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all var(--transition-fast);
}

.tool-action-btn:hover {
  background: var(--border-subtle);
  color: var(--text-main);
}

.tool-action-btn.active {
  background: var(--primary);
  color: #fff;
}

.pdf-canvas-container {
  position: relative;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  display: inline-block;
  user-select: none;
}

.pdf-canvas-container canvas {
  display: block;
}

/* Overlay elements on canvas (Text boxes, signatures, highlights) */
.annotation-element {
  position: absolute;
  cursor: move;
  border: 1px dashed transparent;
  transition: border-color var(--transition-fast);
}

.annotation-element:hover, .annotation-element.selected {
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.annotation-delete-btn {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  cursor: pointer;
  display: none;
}

.annotation-element.selected .annotation-delete-btn {
  display: grid;
}

/* Header & Footer Live Preview Overlay */
.hf-overlay-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  font-weight: 600;
}

.hf-overlay-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  font-weight: 600;
}

/* Signature Modal / Pad */
.signature-pad-wrapper {
  background: #ffffff;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  margin: 1rem 0;
  position: relative;
}

.signature-pad-canvas {
  width: 100%;
  height: 180px;
  cursor: crosshair;
  display: block;
}

/* Image Tool Controls (Compare slider & Cropper) */
.image-preview-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #000;
  display: grid;
  place-items: center;
  min-height: 400px;
}

.image-preview-canvas {
  max-width: 100%;
  max-height: 550px;
  object-fit: contain;
}

.crop-box {
  position: absolute;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  cursor: move;
}

.crop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border: 2px solid #ffffff;
  border-radius: 2px;
}

.crop-handle.tl { top: -6px; left: -6px; cursor: nwse-resize; }
.crop-handle.tr { top: -6px; right: -6px; cursor: nesw-resize; }
.crop-handle.bl { bottom: -6px; left: -6px; cursor: nesw-resize; }
.crop-handle.br { bottom: -6px; right: -6px; cursor: nwse-resize; }

/* Image Comparison Splitter */
.compare-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 450px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  user-select: none;
  border: 1px solid var(--border-subtle);
}

.compare-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-image: linear-gradient(45deg, #1e293b 25%, transparent 25%), linear-gradient(-45deg, #1e293b 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #1e293b 75%), linear-gradient(-45deg, transparent 75%, #1e293b 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.compare-overlay {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  overflow: hidden;
  border-right: 2px solid #ffffff;
}

.compare-slider-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #ffffff;
  left: 50%;
  cursor: ew-resize;
}

.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  color: #000;
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  font-size: 1rem;
}

/* Calculator Result Cards & Visuals */
.calc-result-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(6, 182, 212, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin-top: 2rem;
}

.calc-result-num {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text-main), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
}

.calc-result-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Gauge Meter (BMI / Age / Password) */
.gauge-container {
  width: 100%;
  max-width: 380px;
  margin: 1.5rem auto 1rem;
  position: relative;
}

.gauge-bar-bg {
  height: 14px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #3b82f6 0%, #10b981 30%, #f59e0b 65%, #ef4444 100%);
  position: relative;
}

.gauge-marker {
  position: absolute;
  top: -6px;
  width: 6px;
  height: 26px;
  background: #ffffff;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
  transition: left var(--transition-bounce);
  transform: translateX(-50%);
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
}

/* Data Table (Amortization & Densities) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-top: 1.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: var(--bg-surface-elevated);
  padding: 0.85rem 1rem;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.data-table tr:hover td {
  background: rgba(99, 102, 241, 0.04);
}

/* SERP Previews (Meta Tag Generator) */
.serp-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  color: #202124;
  margin-bottom: 1.5rem;
  font-family: Arial, sans-serif;
}

.serp-url {
  font-size: 0.82rem;
  color: #202124;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.serp-title {
  font-size: 1.25rem;
  color: #1a0dab;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 0.35rem;
  cursor: pointer;
}

.serp-title:hover {
  text-decoration: underline;
}

.serp-desc {
  font-size: 0.88rem;
  color: #4d5156;
  line-height: 1.5;
}

/* Social Card Preview */
.social-preview-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  max-width: 500px;
  margin-bottom: 1.5rem;
}

.social-img-box {
  width: 100%;
  height: 250px;
  background: var(--bg-surface-elevated);
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 1.25rem;
  overflow: hidden;
}

.social-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-meta-box {
  padding: 1rem;
}

.social-domain {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.social-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.social-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* JSON Code Viewer */
.code-editor-box {
  background: #0d1117;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #e6edf3;
  padding: 1rem;
  overflow: auto;
  min-height: 320px;
  line-height: 1.6;
}

/* QR Code Display Canvas */
.qr-preview-box {
  display: grid;
  place-items: center;
  padding: 2rem;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}
