/* ===========================================================
   FluxoImg — Design Tokens
   =========================================================== */
:root {
  --bg: #0a0b14;
  --card-bg: rgba(17, 18, 34, 0.5);
  --card-border: #2c2d45;
  --indigo: #4f46e5;
  --indigo-hover: #4338ca;
  --red: #e2504f;
  --green: #3fcf8e;
  --white: #ffffff;
  --text-secondary: #9a9bb0;
  --text-tertiary: #7d7e94;

  --radius-card: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font);
  font-weight: 400;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* ===========================================================
   Header
   =========================================================== */
.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 28px;
}

.app-header__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-header__icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--white);
}

.app-header__title {
  font-size: 17px;
  font-weight: 500;
  color: var(--white);
}

.badge-pro {
  font-size: 11px;
  font-weight: 500;
  color: var(--white);
  background: var(--indigo);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
}

/* ===========================================================
   Page title
   =========================================================== */
.page-title {
  font-size: 26px;
  font-weight: 500;
  color: var(--white);
  margin: 0 0 6px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 28px;
}

/* ===========================================================
   Dropzone
   =========================================================== */
.dropzone {
  border: 1.5px dashed var(--card-border);
  border-radius: var(--radius-card);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
  background: rgba(17, 18, 34, 0.25);
}

.dropzone:hover,
.dropzone--dragover {
  border-color: var(--indigo);
  background: rgba(79, 70, 229, 0.06);
}

.dropzone__icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.dropzone__icon-wrap svg {
  width: 26px;
  height: 26px;
  stroke: var(--text-secondary);
}

.dropzone__title {
  font-size: 15px;
  font-weight: 500;
  color: var(--white);
  margin: 0 0 4px;
}

.dropzone__subtitle {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0;
}

.dropzone__subtitle strong {
  color: var(--indigo);
  font-weight: 500;
}

.dropzone input[type="file"] {
  display: none;
}

/* ===========================================================
   Thumbnails (preview local)
   =========================================================== */
.thumbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}

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

.thumb__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(10, 11, 20, 0.85);
  border: none;
  color: var(--white);
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.thumb__remove:hover {
  background: var(--red);
}

/* ===========================================================
   Seção de efeitos
   =========================================================== */
.section-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  margin: 32px 0 12px;
}

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

@media (max-width: 520px) {
  .effects-grid {
    grid-template-columns: 1fr;
  }
}

.effect-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: border-color 0.15s ease;
  cursor: pointer;
}

.effect-card--active {
  border-color: var(--indigo);
}

.effect-card__icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.effect-card__icon svg {
  width: 19px;
  height: 19px;
}

.effect-card__body {
  flex: 1;
  min-width: 0;
}

.effect-card__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  margin: 0 0 2px;
}

.effect-card__desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0;
  line-height: 1.4;
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--card-border);
  transition: background-color 0.18s ease;
}

.toggle--on {
  background: var(--indigo);
}

.toggle__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  transition: transform 0.18s ease;
}

.toggle--on .toggle__knob {
  transform: translateX(16px);
}

/* ===========================================================
   Botão principal
   =========================================================== */
.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--indigo);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  font-family: var(--font);
  padding: 15px 20px;
  margin-top: 28px;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
  background: var(--indigo-hover);
}

.btn-primary:disabled {
  background: #2c2d45;
  color: var(--text-tertiary);
  cursor: not-allowed;
}

.btn-primary svg {
  width: 18px;
  height: 18px;
}

.btn-primary .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ===========================================================
   Tela de resultado
   =========================================================== */
.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.result-title {
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 4px;
}

.result-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.btn-download-zip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--indigo);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.btn-download-zip:hover {
  background: var(--indigo-hover);
}

.btn-download-zip svg {
  width: 16px;
  height: 16px;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 520px) {
  .results-grid {
    grid-template-columns: 1fr;
  }
}

.result-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.result-card__thumb {
  width: 100%;
  height: 120px;
  background: #07080f;
  display: block;
  object-fit: cover;
}

.result-card__body {
  padding: 12px;
}

.result-card__name {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 8px;
}

.result-card__link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #07080f;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.result-card__link {
  flex: 1;
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-card__copy {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.result-card__copy:hover {
  color: var(--white);
}

.result-card__copy svg {
  width: 15px;
  height: 15px;
}

.result-card__copy--copied svg {
  color: var(--green);
}

/* ===========================================================
   Toast / feedback de erro
   =========================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #16172b;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--white);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
  max-width: 90%;
  text-align: center;
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast--error {
  border-color: var(--red);
}

/* ===========================================================
   Utilitários
   =========================================================== */
.hidden {
  display: none !important;
}

.screen {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
