/* ==========================================================================
   Higienizador de Metadados IA — Identidade Visual Xispeh (design.xispeh.com)
   ========================================================================== */

:root {
  /* Xispeh Tokens (design.xispeh.com) */
  --c-bg: #121111;
  --c-black-deep: #0a0a0a;
  --c-black-mid: #161515;

  --c-orange: #FF8D07;
  --c-orange-bright: #FFA033;
  --c-orange-dark: #CC7006;
  --c-orange-glow: rgba(255, 141, 7, 0.16);
  --c-orange-subtle: rgba(255, 141, 7, 0.08);

  --c-white: #F5F5F5;
  --c-white-mid: rgba(245, 245, 245, 0.7);
  --c-white-muted: rgba(245, 245, 245, 0.4);
  --c-white-faint: rgba(245, 245, 245, 0.1);

  --c-surface: rgba(255, 255, 255, 0.03);
  --c-surface-hover: rgba(255, 255, 255, 0.06);
  --c-surface-glass: rgba(255, 255, 255, 0.04);

  --c-border: rgba(255, 141, 7, 0.14);
  --c-border-subtle: rgba(255, 255, 255, 0.08);
  --c-border-strong: rgba(255, 141, 7, 0.35);

  --accent-orange: var(--c-orange);
  --accent-orange-bright: var(--c-orange-bright);
  --accent-orange-subtle: var(--c-orange-subtle);
  --accent-orange-border: rgba(255, 141, 7, 0.32);

  --accent-amber: #f59e0b;
  --accent-amber-subtle: rgba(245, 158, 11, 0.12);
  --accent-amber-border: rgba(245, 158, 11, 0.28);
  --accent-amber-text: #fbbf24;

  --accent-danger: #ef4444;
  --accent-danger-subtle: rgba(239, 68, 68, 0.12);
  --accent-danger-border: rgba(239, 68, 68, 0.28);

  /* Radius & Spacing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  /* Typography */
  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --ls: -0.03em;
  --ls-body: -0.01em;

  /* Shadows */
  --shadow-glow: 0 0 16px rgba(255, 141, 7, 0.15);
  --shadow-glow-strong: 0 0 30px rgba(255, 141, 7, 0.25), 0 0 60px rgba(255, 141, 7, 0.1);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 220ms;

  /* Custom scrollbar tokens */
  --scroll-track: #0a0a0a;
  --scroll-thumb: #ffffff;
  --scroll-width: 8px;
  --scroll-radius: 8px;
}

/* Custom Scrollbar (xsite) */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}
::-webkit-scrollbar {
  width: var(--scroll-width);
  height: var(--scroll-width);
}
::-webkit-scrollbar-track {
  background: var(--scroll-track);
}
::-webkit-scrollbar-thumb {
  background-color: var(--scroll-thumb);
  border-radius: var(--scroll-radius);
  border: 2px solid var(--scroll-track);
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--c-orange);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  letter-spacing: var(--ls-body);
  background-color: var(--c-bg);
  color: var(--c-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Layout */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background-color: var(--c-black-deep);
  border-bottom: 1px solid var(--c-border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 12px;
}

@media (max-width: 640px) {
  .topbar {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
  }
  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--c-orange-subtle);
  border: 1px solid var(--c-border-strong);
  color: var(--c-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.brand-info h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: var(--ls);
  color: var(--c-white);
}

.brand-info h1 span {
  color: var(--c-orange);
  font-weight: 500;
}

.brand-info .subtitle {
  font-size: 12px;
  color: var(--c-white-muted);
  text-wrap: balance;
}

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

.memory-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background-color: var(--c-black-mid);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--c-white-mid);
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--c-orange);
  box-shadow: 0 0 8px var(--c-orange);
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  letter-spacing: var(--ls);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 9px 16px;
  min-height: 40px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  border: 1px solid transparent;
  outline: none;
  user-select: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background-color: var(--c-orange);
  color: #0a0a0a;
  border-color: var(--c-orange-bright);
  box-shadow: 0 0 14px rgba(255, 141, 7, 0.22);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--c-orange-bright);
  color: #000000;
  box-shadow: var(--shadow-glow-strong);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--c-black-mid);
  color: var(--c-white-mid);
  border-color: var(--c-border-subtle);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--c-surface-hover);
  color: var(--c-white);
  border-color: var(--c-border-strong);
}

.btn-ghost {
  background-color: transparent;
  color: var(--c-white-mid);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background-color: var(--c-surface-hover);
  color: var(--c-orange);
}

.btn-sm {
  font-size: 12px;
  padding: 5px 10px;
  min-height: 32px;
  border-radius: var(--radius-sm);
}

.btn-large {
  font-size: 14px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
}

/* Workspace Split */
.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 440px 1fr;
  overflow: hidden;
  height: calc(100vh - 69px);
}

@media (max-width: 1024px) {
  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
}

/* Panels */
.panel {
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
}

.panel-input {
  background-color: var(--c-black-deep);
  border-right: 1px solid var(--c-border-subtle);
  gap: 20px;
}

.panel-output {
  background-color: var(--c-bg);
  gap: 16px;
  position: relative;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: var(--ls);
  color: var(--c-white);
}

.panel-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background-color: var(--c-surface);
  border: 1px solid var(--c-border-subtle);
  color: var(--c-white-muted);
}

.count-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background-color: var(--c-orange-subtle);
  border: 1px solid var(--c-border);
  color: var(--c-orange);
}

/* Dropzone */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  background-color: var(--c-surface);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  outline: none;
}

.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--c-orange);
  background-color: var(--c-surface-hover);
  box-shadow: var(--shadow-glow);
}

.dropzone.drag-active {
  border-color: var(--c-orange);
  background-color: var(--c-orange-subtle);
  box-shadow: var(--shadow-glow-strong);
  transform: scale(0.99);
}

.dropzone-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dropzone-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background-color: var(--c-black-mid);
  border: 1px solid var(--c-border-subtle);
  color: var(--c-white-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  transition: all var(--duration-fast) var(--ease-out);
}

.dropzone:hover .dropzone-icon {
  transform: translateY(-2px);
  color: var(--c-orange);
  border-color: var(--c-border);
  box-shadow: 0 0 12px var(--c-orange-glow);
}

.dropzone-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: var(--ls);
  color: var(--c-white);
}

.dropzone-hint {
  font-size: 12px;
  color: var(--c-white-muted);
}

.paste-indicator {
  margin-top: 10px;
  font-size: 11px;
  color: var(--c-white-mid);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: var(--c-black-deep);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border-subtle);
}

.paste-indicator kbd {
  background-color: var(--c-surface-hover);
  border: 1px solid var(--c-border-subtle);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--c-white);
}

/* Settings Box */
.settings-box {
  background-color: var(--c-surface);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-header h3 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: var(--ls);
  color: var(--c-white);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--c-white-mid);
}

.select-control, .input-control {
  font-family: inherit;
  font-size: 13px;
  letter-spacing: var(--ls);
  background-color: var(--c-black-mid);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--c-white);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}

.select-control:focus, .input-control:focus {
  border-color: var(--c-orange);
  box-shadow: 0 0 10px var(--c-orange-glow);
}

.settings-note {
  font-size: 11px;
  color: var(--c-white-muted);
  line-height: 1.4;
  text-wrap: balance;
}

/* Info Card */
.info-card {
  background-color: var(--c-surface);
  border-left: 3px solid var(--c-orange);
  border-top: 1px solid var(--c-border-subtle);
  border-right: 1px solid var(--c-border-subtle);
  border-bottom: 1px solid var(--c-border-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--c-orange);
}

.info-card-header h4 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: var(--ls);
  color: var(--c-white);
}

.info-card p {
  font-size: 12px;
  color: var(--c-white-mid);
  line-height: 1.5;
  text-wrap: balance;
}

/* Empty State */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--c-white-muted);
  border: 1px dashed var(--c-border-subtle);
  border-radius: var(--radius-lg);
  min-height: 320px;
}

.empty-state-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: var(--c-surface);
  border: 1px solid var(--c-border-subtle);
  color: var(--c-white-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.empty-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: var(--ls);
  color: var(--c-white);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 13px;
  color: var(--c-white-muted);
  max-width: 320px;
  text-wrap: balance;
}

/* Slides List */
.slides-container {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.slides-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Slide Card */
.slide-card {
  display: grid;
  grid-template-columns: 36px 84px 1fr auto;
  align-items: center;
  gap: 16px;
  background-color: var(--c-surface);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
}

.slide-card:hover {
  border-color: var(--c-border-strong);
  background-color: var(--c-surface-hover);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.slide-card.dragging {
  opacity: 0.5;
  border-color: var(--c-orange);
}

.slide-card.drag-over-top {
  border-top: 2px solid var(--c-orange);
}

.slide-card.drag-over-bottom {
  border-bottom: 2px solid var(--c-orange);
}

.slide-order-pill {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background-color: var(--c-black-mid);
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--c-orange);
  cursor: grab;
}

.slide-thumb-wrapper {
  width: 84px;
  height: 84px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--c-black-deep);
  border: 1px solid var(--c-border-subtle);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slide-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.slide-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.slide-output-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--c-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slide-original-name {
  font-size: 11px;
  color: var(--c-white-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slide-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.badge-clean {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background-color: var(--c-orange-subtle);
  border: 1px solid var(--c-border-strong);
  color: var(--c-orange-bright);
}

.badge-original-c2pa {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  background-color: var(--accent-amber-subtle);
  border: 1px solid var(--accent-amber-border);
  color: var(--accent-amber-text);
}

.slide-resolution {
  font-size: 11px;
  color: var(--c-white-muted);
  font-family: var(--font-mono);
}

/* Slide Actions */
.slide-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: var(--c-surface);
  border: 1px solid var(--c-border-subtle);
  color: var(--c-white-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.action-icon-btn:hover {
  background-color: var(--c-surface-hover);
  color: var(--c-orange);
  border-color: var(--c-border-strong);
}

.action-icon-btn.btn-delete:hover {
  background-color: var(--accent-danger-subtle);
  border-color: var(--accent-danger-border);
  color: var(--accent-danger);
}

/* Output Footer */
.output-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--c-border-subtle);
  background-color: var(--c-bg);
  margin-top: auto;
  gap: 16px;
}

.footer-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--c-white-mid);
}

.bullet {
  color: var(--c-white-muted);
}

.text-orange {
  color: var(--c-orange);
  font-weight: 500;
}

/* Toast */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background-color: var(--c-black-mid);
  border: 1px solid var(--c-border-strong);
  color: var(--c-white);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7), var(--shadow-glow);
  transform: translateY(-40px);
  opacity: 0;
  transition: all var(--duration-normal) var(--ease-out);
  pointer-events: none;
  z-index: 100;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}
