/* =====================================================================
   Favicon Generator Pro — app.css
   Extends the shared design system (base.css). Colors derive ONLY from
   base.css CSS variables so dark + light themes both work.
   ===================================================================== */

/* ---- Theme toggle icon swap (sun in dark, moon in light) ---- */
[data-theme="light"] .icon-sun { display: none; }
.icon-moon { display: none; }

/* ===================== Shared panel head row ===================== */
.panel-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.panel-head-row h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ===================== Checkerboard (transparency) ===================== */
.checker {
  background-image:
    linear-gradient(45deg, var(--surface-3) 25%, transparent 25%),
    linear-gradient(-45deg, var(--surface-3) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--surface-3) 75%),
    linear-gradient(-45deg, transparent 75%, var(--surface-3) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  background-color: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* ===================== Upload / dropzone ===================== */
.upload-panel { padding: var(--space-6); }

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-dragover {
  border-color: var(--brand-500);
  background: var(--gradient-brand-soft);
}
.dropzone svg { width: 40px; height: 40px; color: var(--text-muted); margin-bottom: var(--space-3); }
.dropzone-title { font-weight: 700; font-size: 16px; margin: 0 0 4px; }
.dropzone p { margin: 0 0 4px; }
.dropzone p:last-child { margin-bottom: 0; }

/* ===================== Source preview ===================== */
.source-preview {
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
  flex-wrap: wrap;
}
.source-preview-img-wrap {
  width: 180px;
  height: 180px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.source-preview-img-wrap img { max-width: 100%; max-height: 100%; display: block; border-radius: var(--radius-sm); }
.source-meta { min-width: 220px; flex: 1; justify-content: center; }

/* ===================== Generated sizes grid ===================== */
.sizes-panel { margin-top: var(--space-5); }
.sizes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--space-4);
}
.size-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.size-preview {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.size-canvas { max-width: 100%; max-height: 100%; display: block; }
.size-title { font-weight: 700; font-size: 14px; }
.size-info { font-size: 12px; }

/* ===================== Export snippets ===================== */
.export-grid {
  grid-template-columns: 1fr 1fr;
  margin-top: var(--space-5);
}
.export-panel { min-width: 0; }
.code-block {
  margin: 0;
  padding: var(--space-4);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  line-height: 1.6;
  overflow: auto;
  max-height: 280px;
  white-space: pre;
  color: var(--text-secondary);
}

/* ===================== Empty hint ===================== */
#emptyHint { margin-top: var(--space-2); }
#emptyHint.is-hidden { display: none; }

/* ===================== Shortcuts modal table ===================== */
.shortcut-table { width: 100%; border-collapse: collapse; }
.shortcut-table td {
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.shortcut-table tr:last-child td { border-bottom: none; }
.shortcut-table td:last-child { text-align: right; white-space: nowrap; }
.shortcut-table kbd + kbd { margin-left: 4px; }

/* ===================== Responsive ===================== */
@media (max-width: 860px) {
  .export-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .source-preview { flex-direction: column; align-items: center; text-align: center; }
  .source-preview-img-wrap { width: 140px; height: 140px; }
  .source-meta { align-items: center; }
}

@media (max-width: 460px) {
  .dropzone { padding: var(--space-8) var(--space-4); }
  .sizes-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .size-preview { height: 110px; }
}
