/* ========================================
   ImageTools — Convert HEIC to PNG Styles
   ======================================== */

/* --- Tool Header --- */
.tool-header { text-align: center; padding: 48px 0 32px; position: relative; z-index: 1; }
.tool-header .section-label { margin-left: auto; margin-right: auto; }
.tool-header .section-title { margin-left: auto; margin-right: auto; }
.tool-header .section-subtitle { margin-left: auto; margin-right: auto; margin-bottom: 24px; }

.formats-bar { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.format-badge { padding: 4px 12px; background: var(--color-bg-tertiary); border: 1px solid var(--color-border); border-radius: 100px; font-size: 0.75rem; font-weight: 500; color: var(--color-text-secondary); }

/* --- Upload Zone --- */
.upload-zone { border: 2px dashed var(--color-border); border-radius: var(--radius-xl); padding: 48px 24px; text-align: center; cursor: pointer; transition: all var(--transition-normal); background: var(--color-glass); }
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--color-border-accent); background: rgba(var(--glow-rgb), 0.03); }
.upload-zone-icon { width: 48px; height: 48px; margin: 0 auto 16px; color: var(--color-accent); }
.upload-zone-icon i { width: 48px; height: 48px; }
.upload-zone-text { font-size: 1rem; font-weight: 500; color: var(--color-text); margin-bottom: 8px; }
.upload-zone-subtext { font-size: 0.875rem; color: var(--color-text-muted); }
.upload-zone input[type="file"] { display: none; }

/* --- Main Workspace --- */
.workspace { margin-top: 32px; display: none; flex-direction: column; background: var(--color-bg-secondary); border: 1px solid var(--color-border); border-radius: var(--radius-xl); position: relative; overflow: hidden; }
.workspace.active { display: flex; }

/* --- Workspace Controls --- */
.workspace-controls { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--color-border); background: var(--color-bg); flex-wrap: wrap; gap: 16px; position: sticky; top: 0; z-index: 20; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.controls-left { display: flex; align-items: center; gap: 12px; }
.controls-right { display: flex; align-items: center; gap: 12px; }

.sort-btn { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--color-glass); border: 1px solid var(--color-border); border-radius: var(--radius-sm); color: var(--color-text-secondary); font-family: var(--font-sans); font-size: 0.8125rem; cursor: pointer; transition: all var(--transition-fast); }
.sort-btn:hover { border-color: var(--color-border-accent); color: var(--color-text); }
.sort-btn i { width: 14px; height: 14px; }

.add-more-btn { position: relative; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--color-border); background: var(--color-glass); color: var(--color-text-secondary); cursor: pointer; transition: all var(--transition-fast); }
.add-more-btn:hover { border-color: var(--color-border-accent); color: var(--color-accent); background: rgba(var(--glow-rgb), 0.08); }
.add-more-btn i { width: 18px; height: 18px; }

.tooltip { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%) scale(0.9); background: var(--color-bg-tertiary); color: var(--color-text); font-size: 0.75rem; padding: 6px 10px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0; transition: all var(--transition-fast); border: 1px solid var(--color-border); box-shadow: var(--shadow-md); z-index: 999; }
.add-more-btn:hover .tooltip { opacity: 1; transform: translateX(-50%) scale(1); }

/* --- Images Grid --- */
.images-scroll-area { 
  flex: 1; 
  min-height: 0; 
  max-height: 60vh; 
  overflow-y: auto; 
  padding: 24px; 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); 
  gap: 16px; 
  align-content: start; 
  align-items: start; 
}

/* --- Image Card --- */
.img-card { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; transition: all var(--transition-normal); display: flex; flex-direction: column; align-self: start; }
.img-card:hover { border-color: var(--color-border-accent); box-shadow: var(--shadow-sm); }
.img-card-thumb { width: 100%; height: 140px; object-fit: cover; background: var(--color-bg-tertiary); border-bottom: 1px solid var(--color-border-subtle); }
.img-card-body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.img-card-name { font-size: 0.8125rem; font-weight: 500; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.img-card-info { font-size: 0.75rem; color: var(--color-text-muted); display: flex; justify-content: space-between; align-items: center; }
.img-card-info .status-pending { color: var(--color-text-muted); }
.img-card-info .status-done { color: var(--color-accent); font-weight: 600; }
.img-card-info .status-error { color: #ef4444; font-weight: 600; }

.img-card-actions { margin-top: auto; display: flex; gap: 8px; }
.img-card-actions .btn { flex: 1; padding: 6px 0; font-size: 0.75rem; }

.img-card-status { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 140px; color: var(--color-text-dim); font-size: 0.8125rem; gap: 8px; }

.spinner { width: 16px; height: 16px; border: 2px solid var(--color-border); border-top-color: var(--color-accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Sticky Bottom Bar --- */
.workspace-bottom-bar { padding: 16px 24px; border-top: 1px solid var(--color-border); background: var(--color-bg); display: flex; align-items: center; justify-content: space-between; gap: 16px; position: sticky; bottom: 0; z-index: 20; border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.summary-text { font-size: 0.875rem; color: var(--color-text-secondary); display: flex; align-items: center; gap: 8px; }
.summary-text strong { color: var(--color-accent); }
.bottom-actions { display: flex; align-items: center; gap: 12px; }

.btn-convert { min-width: 180px; padding: 14px 32px; font-size: 1rem; font-weight: 600; box-shadow: 0 0 20px rgba(var(--glow-rgb), 0.2); animation: btn-pulse 2.5s ease-in-out infinite; }
@keyframes btn-pulse { 0%, 100% { box-shadow: 0 0 15px rgba(var(--glow-rgb), 0.15); } 50% { box-shadow: 0 0 30px rgba(var(--glow-rgb), 0.35); } }
.btn-convert.loading { pointer-events: none; opacity: 0.8; animation: none; }

/* --- Social Share Section --- */
.share-section { margin-top: 32px; padding: 32px; background: var(--color-glass); border: 1px solid var(--color-border); border-radius: var(--radius-lg); text-align: center; display: none; }
.share-section.active { display: block; }
.share-title { font-size: 1rem; font-weight: 500; margin-bottom: 6px; }
.share-subtitle { font-size: 0.875rem; color: var(--color-text-muted); margin-bottom: 20px; }
.share-buttons { display: flex; align-items: center; justify-content: center; gap: 12px; }
.share-btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--color-border); background: var(--color-bg); color: var(--color-text-secondary); transition: all var(--transition-fast); }
.share-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.share-btn.twitter:hover { background: #000; color: #fff; border-color: #000; }
.share-btn.facebook:hover { background: #1877F2; color: #fff; border-color: #1877F2; }
.share-btn.linkedin:hover { background: #0A66C2; color: #fff; border-color: #0A66C2; }
.share-btn.whatsapp:hover { background: #25D366; color: #fff; border-color: #25D366; }
.share-btn svg { width: 20px; height: 20px; fill: currentColor; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .images-scroll-area { max-height: 50vh; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); padding: 16px; }
  .workspace-bottom-bar { flex-direction: column; text-align: center; }
  .bottom-actions { width: 100%; flex-direction: column; }
  .btn-convert, .btn-secondary { width: 100%; }
}