﻿/* ImageFormatChanger Tools - Interactive Tools Stylesheet */

/* Upload & Dropzone Area */
.tool-upload-zone {
  border: 2px dashed var(--border-glass);
  border-radius: 16px;
  background: rgba(99, 102, 241, 0.02);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tool-upload-zone:hover, .tool-upload-zone.dragover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.06);
}

body.dark-theme .tool-upload-zone:hover, 
body.dark-theme .tool-upload-zone.dragover {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.08);
}

.upload-zone-icon {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  transition: color 0.3s ease;
}

.tool-upload-zone:hover .upload-zone-icon {
  color: var(--accent-color);
}

.upload-zone-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Tool Workspace Panels */
.tool-workspace {
  margin-top: 2rem;
  display: none; /* JS triggers block display */
}

/* Range Sliders */
.slider-container {
  margin: 1.5rem 0;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.custom-range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: var(--border-glass);
  outline: none;
  transition: background 0.3s ease;
}

.custom-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-gradient);
  cursor: pointer;
  transition: transform 0.1s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

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

/* Compare Image Sliders & Preview Panes */
.image-preview-wrapper {
  position: relative;
  max-height: 450px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  display: flex;
  justify-content: center;
  align-items: center;
  background: #1e293b;
}

.image-preview-wrapper canvas,
.image-preview-wrapper img {
  max-width: 100%;
  max-height: 450px;
  object-fit: contain;
}

/* Comparison Info Box */
.compare-info-box {
  background: rgba(99, 102, 241, 0.05);
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid var(--border-glass);
}

/* PDF Files Queue / Selector List */
.pdf-queue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 1.5rem 0;
}

.pdf-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.pdf-queue-item:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.pdf-item-details {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pdf-item-details i {
  color: #ef4444;
  font-size: 1.25rem;
}

.pdf-item-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-queue-action {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.btn-queue-action:hover {
  color: #ef4444;
  transform: scale(1.1);
}

.btn-queue-move {
  color: var(--text-muted);
}
.btn-queue-move:hover {
  color: var(--accent-color);
}

/* Financial Calculator Layouts */
.chart-container {
  position: relative;
  width: 100%;
  height: 250px;
  margin: 1.5rem 0;
}

.financial-results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 1.5rem;
}

.financial-result-card {
  padding: 1.25rem;
  border-radius: 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  text-align: center;
}

.financial-result-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-top: 0.5rem;
}

/* Passport Photo Printable Sheet Grid */
.passport-photo-sheet {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  max-width: 400px;
  margin: 0 auto;
}

.passport-sheet-item {
  width: 100%;
  aspect-ratio: 3.5 / 4.5;
  border: 1px solid #ddd;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

/* Spinner Overlay for Async PDF/Image Compilation */
.tool-spinner-overlay {
  display: none; /* Trigger block with JS */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
}

.tool-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.1);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: rotate-spinner 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes rotate-spinner {
  to { transform: rotate(360deg); }
}

/* Related Tools Widget */
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 2rem;
}

/* Instructions & Sidebar Layout */
.tool-instructions-card {
  padding: 2rem;
}

.instruction-step {
  display: flex;
  gap: 16px;
  margin-bottom: 1.25rem;
}

.instruction-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.instruction-text {
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 0.98rem;
}

/* Accordion FAQ Styling */
.accordion-item-custom {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.accordion-header-custom {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  font-size: 1.05rem;
}

.accordion-icon-custom {
  transition: transform 0.3s ease;
  color: var(--text-muted);
}

.accordion-content-custom {
  max-height: 0;
  overflow: hidden;
  padding: 0 1.5rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.98rem;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-item-custom.open {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: var(--shadow-sm);
}

body.dark-theme .accordion-item-custom.open {
  border-color: rgba(168, 85, 247, 0.3);
}

.accordion-item-custom.open .accordion-icon-custom {
  transform: rotate(180deg);
  color: var(--accent-color);
}

.accordion-item-custom.open .accordion-content-custom {
  padding: 0 1.5rem 1.5rem;
  max-height: 1000px;
}

/* Social Share Row */
.social-share-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 1.5rem;
}

.btn-share {
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  color: white !important;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  transition: transform 0.2s ease;
}

.btn-share:hover {
  transform: translateY(-2px);
}

.btn-share-facebook { background: #1877f2; }
.btn-share-twitter { background: #1da1f2; }
.btn-share-linkedin { background: #0a66c2; }
.btn-share-whatsapp { background: #25d366; }

/* Image Cropper Viewport Box */
.crop-viewport-box {
  width: 100%;
  height: 380px;
  background: #0f172a;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.crop-canvas-wrapper {
  position: relative;
}

.crop-overlay-rect {
  position: absolute;
  border: 2px dashed #38bdf8;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
  cursor: move;
}

.crop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #38bdf8;
  border: 1px solid white;
}

.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; }

/* Word Counter Density Panel */
.keyword-density-list {
  max-height: 200px;
  overflow-y: auto;
}

.keyword-density-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 0.9rem;
  background: var(--bg-primary);
}

/* Amortization Table */
.table-custom-wrapper {
  max-height: 400px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
}

.table-custom {
  width: 100%;
  margin-bottom: 0;
  color: var(--text-primary);
  border-collapse: collapse;
}

.table-custom th {
  background: rgba(99, 102, 241, 0.08);
  padding: 12px;
  font-weight: 700;
  text-align: left;
  border-bottom: 2px solid var(--border-glass);
}

.table-custom td {
  padding: 12px;
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.92rem;
}

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