/* ════════════════════════════════════════════════════════════════
   ZIKANI IMAGE POLISH — modal styles
   ════════════════════════════════════════════════════════════════ */

body.ipolish-open { overflow: hidden; }

.ipolish-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15, 18, 22, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: ipolishFade 0.18s ease;
}
@keyframes ipolishFade { from { opacity: 0; } to { opacity: 1; } }

.ipolish-modal {
  background: #fff;
  border-radius: 16px;
  width: min(1000px, 100%);
  max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  overflow: hidden;
  animation: ipolishPop 0.22s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes ipolishPop {
  from { transform: translateY(8px) scale(0.98); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* Header */
.ipolish-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #eee;
  background: linear-gradient(180deg, #fafbfc, #fff);
}
.ipolish-head h3 {
  margin: 0; font-size: 16px; font-weight: 800; color: #1a2026;
  display: flex; align-items: center; gap: 8px;
}
.ipolish-head ion-icon { color: #8DC63F; font-size: 20px; }
.ipolish-close {
  background: transparent; border: 0; cursor: pointer;
  padding: 6px; border-radius: 8px; color: #555;
  display: flex; align-items: center;
}
.ipolish-close:hover { background: #f1f3f5; color: #000; }
.ipolish-close ion-icon { font-size: 22px; }

/* Body — split into preview (left) and controls (right) */
.ipolish-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0;
  flex: 1; min-height: 0;
}
.ipolish-preview {
  background: repeating-conic-gradient(#f6f7f8 0% 25%, #fff 0% 50%) 0 0/24px 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px;
  min-height: 420px;
  border-right: 1px solid #eee;
}
.ipolish-preview-canvas {
  width: 100%;
  max-width: 480px;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  background: #fff;
}
.ipolish-quality {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 14px; justify-content: center;
}
.ipq {
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  background: #fff; border: 1px solid #ddd;
}
.ipq.ok   { background: #e8f5e9; color: #1B5E20; border-color: #a5d6a7; }
.ipq.warn { background: #fff3e0; color: #E65100; border-color: #ffcc80; }

/* Side panel */
.ipolish-side {
  padding: 18px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  background: #fcfcfd;
}
.ipolish-toggle {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e6e6e6; border-radius: 10px;
  background: #fff; cursor: pointer;
}
.ipolish-toggle input { width: 18px; height: 18px; cursor: pointer; }
.ipolish-toggle span  { font-weight: 700; font-size: 13px; color: #1a2026; }
.ipolish-toggle small {
  grid-column: 2; font-size: 11px; color: #666; line-height: 1.4;
  font-weight: 400;
}

.ipolish-section-title {
  font-size: 11px; font-weight: 800; color: #555;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-top: 4px;
}
.ipolish-bg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ipolish-bg-chip {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 6px;
  background: #fff;
  border: 2px solid #e6e6e6;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  font: inherit;
}
.ipolish-bg-chip:hover { border-color: #b9d97a; transform: translateY(-2px); }
.ipolish-bg-chip.on {
  border-color: #8DC63F;
  box-shadow: 0 0 0 3px rgba(141, 198, 63, 0.18);
}
.ipolish-bg-chip.is-auto {
  background: linear-gradient(135deg, #f0faff, #fff);
}
.ipolish-bg-thumb {
  width: 56px; height: 56px;
  border-radius: 8px;
  background-size: cover; background-position: center;
  border: 1px solid #ddd;
}
.ipolish-bg-label {
  font-size: 11px; font-weight: 700; color: #1a2026;
  display: flex; align-items: center; gap: 3px;
  text-align: center;
}
.ipolish-bg-label ion-icon { font-size: 13px; color: #555; }
.ipolish-bg-chip.on .ipolish-bg-label ion-icon { color: #8DC63F; }

.ipolish-sampled {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #555;
  padding: 8px 10px;
  background: #fff; border: 1px solid #eee; border-radius: 8px;
}
.ipolish-swatch {
  width: 22px; height: 22px; border-radius: 5px;
  border: 1px solid #ccc; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5);
}
.ipolish-sampled code {
  font-family: 'SFMono-Regular', Menlo, monospace;
  font-size: 11px; color: #333;
}

.ipolish-auto-hint {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #555;
  padding: 10px 12px;
  background: #fff8e1; border: 1px solid #ffe082; border-radius: 8px;
}
.ipolish-auto-hint ion-icon { color: #FF9800; font-size: 18px; }
.ipolish-auto-hint strong { color: #1a2026; }

/* Footer */
.ipolish-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #eee;
  background: #fafbfc;
}
.ipolish-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ipolish-btn-secondary {
  background: #fff; color: #555;
  border: 1px solid #ddd;
}
.ipolish-btn-secondary:hover { background: #f1f3f5; }
.ipolish-btn-primary {
  background: linear-gradient(135deg, #8DC63F, #6fa030);
  color: #fff;
  box-shadow: 0 2px 8px rgba(141, 198, 63, 0.4);
}
.ipolish-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(141, 198, 63, 0.55); }
.ipolish-btn-primary ion-icon { font-size: 16px; }

/* Mobile */
@media (max-width: 760px) {
  .ipolish-body { grid-template-columns: 1fr; }
  .ipolish-preview { border-right: 0; border-bottom: 1px solid #eee; min-height: 320px; }
  .ipolish-side { max-height: 50vh; }
  .ipolish-bg-grid { grid-template-columns: repeat(4, 1fr); }
}
