/* ============================================================
   Favicon Generator — CSS
   Matches the dark-panel aesthetic shown in the reference image.
   ============================================================ */

/* ── CSS Tokens ─────────────────────────────────────────── */
:root {
  --fg-bg: #fff;
  --fg-panel-bg: #1a1f2e;
  --fg-panel-border: rgba(255, 255, 255, 0.07);
  --fg-accent: #6c72f1;
  --fg-accent-hover: #7c83ff;
  --fg-success: #22c55e;
  --fg-success-hover: #16a34a;
  --fg-text: #212529;
  --fg-muted: #8892a4;
  --fg-dropzone-bg: #242a3a;
  --fg-dropzone-border: rgba(108, 114, 241, 0.35);
  --fg-icon-bg: #ffffff;
  --fg-icon-border: rgba(255, 255, 255, 0.12);
  --fg-radius: 8px;
  --fg-radius-sm: 10px;
  --fg-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}
.fg-wrapper {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--fg-text);
  padding: 28px 20px;
  min-height: 100%;
  box-sizing: border-box;
}

/* ── Layout ─────────────────────────────────────────────── */
.fg-wrapper.dwk-container {
  display: block;
}
.fg-layout {
  display: flex;
  gap: 24px;
}

@media (max-width: 700px) {
  .fg-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Panel ──────────────────────────────────────────────── */
.fg-panel {
  border-radius: var(--fg-radius);
  padding: 24px;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  font-family: Arial, sans-serif;
  background: #fff;
  margin: 0;
  padding: 20px;
}

.fg-panel__header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--fg-text);
}

.fg-panel__icon {
  display: flex;
  align-items: center;
  color: var(--fg-accent);
}

/* ── Drop Zone ──────────────────────────────────────────── */
.fg-dropzone {
  border: 2px dashed var(--fg-dropzone-border);
  border-radius: var(--fg-radius-sm);
  background: var(--fg-dropzone-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
  gap: 10px;
  cursor: pointer;
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    transform 0.2s ease;
  position: relative;
  min-height: 200px;
}

.fg-file-hidden {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.fg-dropzone:hover,
.fg-dropzone.fg-dragover {
  border-color: var(--fg-accent);
  background: rgba(108, 114, 241, 0.08);
  transform: translateY(-2px);
}

.fg-dropzone__icon {
  color: var(--fg-accent);
  opacity: 0.85;
  transition: transform 0.3s ease;
}

.fg-dropzone:hover .fg-dropzone__icon {
  transform: translateY(-4px);
}

.fg-dropzone__preview {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
}

.fg-dropzone__preview img {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  border-radius: 8px;
  opacity: 0.85;
}

.fg-dropzone__label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg-text);
  margin: 0;
  pointer-events: none;
}

.fg-dropzone__hint {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin: 0;
  pointer-events: none;
}

/* ── Hover overlay when an image is already loaded ───── */
.fg-dropzone--has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 20, 0.62);
  border-radius: var(--fg-radius-sm);
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 2;
  pointer-events: none;
}

.fg-dropzone--has-image:hover::after {
  opacity: 1;
}

.fg-dropzone--has-image .fg-dropzone__label,
.fg-dropzone--has-image .fg-dropzone__hint {
  position: relative;
  z-index: 3; /* above the ::after overlay */
  opacity: 0;
  transition: opacity 0.25s ease;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.fg-dropzone--has-image:hover .fg-dropzone__label,
.fg-dropzone--has-image:hover .fg-dropzone__hint {
  opacity: 1;
}

/* ── File Badge ─────────────────────────────────────────── */
.fg-file-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--fg-panel-border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--fg-muted);
  word-break: break-all;
}

.fg-file-badge svg {
  flex-shrink: 0;
  color: var(--fg-accent);
}

/* ── Buttons ────────────────────────────────────────────── */
.fg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 13px 18px;
  width: 100%;
  transition:
    background 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
  letter-spacing: 0.01em;
}

.fg-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.fg-btn--generate {
  background: var(--fg-accent);
  color: #fff;
  box-shadow: 0 4px 18px rgba(108, 114, 241, 0.35);
}

.fg-btn--generate:not(:disabled):hover {
  background: var(--fg-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(108, 114, 241, 0.45);
}

.fg-btn--download {
  background: var(--fg-success);
  color: #fff;
  box-shadow: 0 4px 18px rgba(34, 197, 94, 0.3);
  margin-top: auto;
}

.fg-btn--download:not(:disabled):hover {
  background: var(--fg-success-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.4);
}

/* ── Empty State ────────────────────────────────────────── */
.fg-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex: 1;
  min-height: 220px;
  color: var(--fg-muted);
  text-align: center;
}

.fg-empty-state__icon {
  opacity: 0.3;
}

.fg-empty-state p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.fg-empty-state strong {
  color: var(--fg-accent);
}

/* ── Icons Grid ─────────────────────────────────────────── */
.fg-icons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 14px;
  flex: 1;
}

.fg-icon-card {
  background: var(--fg-icon-bg);
  border: 1px solid var(--fg-icon-border);
  border-radius: var(--fg-radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 8px;
  gap: 8px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  min-height: 120px;
}

.fg-icon-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.fg-icon-card canvas {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  image-rendering: auto;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: smooth;
}

.fg-icon-card__label {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  margin-top: auto;
  padding-top: 20px;
}

/* Loading spinner on generate btn */
.fg-btn--loading .fg-spin {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fg-spin 0.7s linear infinite;
}

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

/* Fade-in animation for generated cards */
@keyframes fg-fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fg-icon-card {
  animation: fg-fadeUp 0.35s ease both;
}
