/* Image Color Extractor – UI polish (v0.1.x)
   Goal: clean, modern “tool” feel inside WordPress pages. */

.ice-tool{
  --ice-bg:#ffffff;
  --ice-panel:#ffffff;
  --ice-muted:#5b6472;
  --ice-text:#0b1220;
  --ice-border:rgba(11,18,32,.10);
  --ice-shadow:0 14px 45px rgba(11,18,32,.10);
  --ice-shadow2:0 2px 14px rgba(11,18,32,.08);
  --ice-accent:#2563eb;
  --ice-accent2:#7c3aed;
  --ice-good:#16a34a;
  --ice-warn:#b45309;

  max-width:1100px;
  margin:0 auto;
  padding:14px;
  color:var(--ice-text);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

@media (max-width:600px){
  .ice-tool{padding:10px;}
}

.ice-title{
  margin:0 0 6px 0;
  font-size:30px;
  line-height:1.12;
  letter-spacing:-.03em;
}

.ice-subtitle{
  margin:0 0 16px 0;
  color:var(--ice-muted);
  max-width:72ch;
  font-size:15px;
  line-height:1.5;
}

@media (max-width:600px){
  .ice-title{font-size:22px;}
  .ice-subtitle{font-size:14px;}
}

.ice-grid{
  display:grid;
  grid-template-columns:1.1fr .9fr;
  gap:18px;
  align-items:start;
}
@media (max-width:980px){
  .ice-grid{grid-template-columns:1fr;}
}
@media (max-width:600px){
  .ice-grid{gap:12px;}
}

/* Panels */
.ice-upload,
.ice-results{
  background:var(--ice-panel);
  border:1px solid var(--ice-border);
  border-radius:16px;
  box-shadow:var(--ice-shadow2);
}

.ice-upload{padding:14px;}
.ice-results{padding:14px;}

/* Drop zone */
.ice-drop{
  display:block;
  border:1.5px dashed rgba(11,18,32,.26);
  border-radius:18px;
  padding:18px;
  cursor:pointer;
  background:
    radial-gradient(1200px 240px at 20% 0%, rgba(37,99,235,.12), transparent 60%),
    radial-gradient(900px 220px at 80% 0%, rgba(124,58,237,.12), transparent 60%),
    #fbfbfd;
  transition:transform .08s ease, border-color .15s ease, box-shadow .15s ease;
}
.ice-drop:hover{
  border-color:rgba(37,99,235,.60);
  box-shadow:0 0 0 4px rgba(37,99,235,.10);
}
.ice-drop:active{transform:translateY(1px);}
.ice-drop input{display:none;}
.ice-drop-inner{text-align:center;}
.ice-drop-big{font-size:16px;font-weight:800; letter-spacing:-.01em;}
.ice-drop-small{margin-top:6px;color:var(--ice-muted);font-size:13px;}

@media (max-width:600px){
  .ice-drop{padding:14px;}
  .ice-drop-big{font-size:15px;}
}

/* Controls */
.ice-controls{
  display:flex;
  gap:10px;
  align-items:center;
  margin:12px 0 10px 0;
  flex-wrap:wrap;
}
.ice-controls label{display:flex;gap:8px;align-items:center;font-size:13px;color:var(--ice-muted);}
.ice-controls select{
  border:1px solid var(--ice-border);
  border-radius:12px;
  padding:7px 12px;
  background:#fff;
  color:var(--ice-text);
}

@media (max-width:600px){
  .ice-controls{gap:8px;}
  .ice-controls label{flex:1 1 100%; justify-content:space-between;}
  .ice-controls select{width:100%;}
}

/* WP “button” class exists; we enhance locally */
.ice-tool .button{
  border-radius:12px !important;
  padding:8px 12px !important;
  border:1px solid var(--ice-border) !important;
  background:#fff !important;
  color:var(--ice-text) !important;
  box-shadow:0 1px 0 rgba(0,0,0,.03) !important;
  transition:transform .08s ease, box-shadow .15s ease, border-color .15s ease;
}
.ice-tool .button:hover{
  border-color:rgba(37,99,235,.40) !important;
  box-shadow:0 0 0 4px rgba(37,99,235,.10) !important;
}
.ice-tool .button:active{transform:translateY(1px);}
.ice-tool .button[disabled]{
  opacity:.55;
  cursor:not-allowed;
  box-shadow:none !important;
}

/* Primary action button (Extract) */
#ice-run.button{
  background:linear-gradient(135deg, var(--ice-accent), var(--ice-accent2)) !important;
  border-color:transparent !important;
  color:#fff !important;
}
#ice-run.button:hover{
  box-shadow:0 0 0 4px rgba(124,58,237,.16) !important;
}

@media (max-width:600px){
  #ice-run.button, #ice-reset.button{
    flex:1 1 calc(50% - 8px);
    justify-content:center;
  }
}

/* Preview */
.ice-preview-wrap{margin-top:10px;}
#ice-canvas{
  width:100%;
  max-height:280px;
  border-radius:16px;
  border:1px solid var(--ice-border);
  background:#fff;
  box-shadow:var(--ice-shadow2);
}
.ice-meta{margin-top:8px;color:var(--ice-muted);font-size:12.5px;}

/* Actions */
.ice-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px;}

/* Mobile: keep export actions accessible (sticky) */
@media (max-width:600px){
  .ice-actions{
    position:sticky;
    bottom:8px;
    background:rgba(255,255,255,.86);
    backdrop-filter:saturate(140%) blur(10px);
    border:1px solid rgba(11,18,32,.10);
    border-radius:16px;
    padding:10px;
    box-shadow:0 18px 40px rgba(11,18,32,.12);
    z-index:5;
  }
  .ice-actions .button{flex:1 1 100%;}
}

/* Status */
.ice-status{
  margin-top:10px;
  font-size:13px;
  color:#0f172a;
  background:rgba(15,23,42,.04);
  border:1px solid rgba(15,23,42,.08);
  border-radius:12px;
  padding:10px 12px;
  min-height:18px;
}

/* Results */
.ice-results h3{margin:6px 0 10px 0;font-size:15px;}

.ice-palette{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:10px;
}
@media (max-width:980px){
  .ice-palette{grid-template-columns:repeat(3,1fr);}
}
@media (max-width:600px){
  .ice-palette{grid-template-columns:repeat(2,1fr); gap:8px;}
}

.ice-swatch{
  border-radius:16px;
  min-height:74px;
  border:1px solid rgba(0,0,0,0.08);
  position:relative;
  overflow:hidden;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(0,0,0,.08);
  transform:translateZ(0);
}
.ice-swatch:hover{
  box-shadow:0 12px 26px rgba(0,0,0,.12);
}
.ice-swatch::after{
  content:"Click to copy";
  position:absolute;
  top:10px;
  right:10px;
  font-size:11px;
  padding:3px 8px;
  border-radius:999px;
  background:rgba(255,255,255,.88);
  color:#0f172a;
  opacity:0;
  transform:translateY(-2px);
  transition:opacity .15s ease, transform .15s ease;
}
.ice-swatch:hover::after{opacity:1; transform:translateY(0);}

.ice-swatch .ice-swatch-label{
  position:absolute;
  left:10px;
  bottom:10px;
  background:rgba(255,255,255,.90);
  padding:3px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  letter-spacing:.02em;
}

.ice-table{margin-top:12px;font-size:13px;}
.ice-row{
  display:grid;
  grid-template-columns:28px 110px 1fr 70px;
  gap:10px;
  align-items:center;
  padding:10px 0;
  border-bottom:1px solid rgba(17,24,39,.08);
  cursor:pointer;
}
.ice-row:hover{background:rgba(37,99,235,.04);}
.ice-dot{width:18px;height:18px;border-radius:7px;border:1px solid rgba(0,0,0,0.10);}

@media (max-width:600px){
  .ice-row{
    grid-template-columns:22px 1fr;
    grid-template-areas:
      "dot hex"
      "dot rgb"
      "dot w";
    gap:6px 10px;
    padding:12px 8px;
    border-radius:12px;
  }
  .ice-row > :nth-child(1){grid-area:dot;}
  .ice-row > :nth-child(2){grid-area:hex;}
  .ice-row > :nth-child(3){grid-area:rgb; color:var(--ice-muted); font-size:12.5px;}
  .ice-row > :nth-child(4){grid-area:w; justify-self:start; color:var(--ice-muted);}
}

.ice-note{margin-top:10px;color:var(--ice-muted);font-size:13px;}

/* FAQ */
.ice-faq{margin-top:18px;}
.ice-faq details{margin:10px 0; border:1px solid rgba(17,24,39,.10); border-radius:14px; padding:10px 12px; background:#fff;}
.ice-faq summary{cursor:pointer; font-weight:700;}
.ice-faq p{margin:8px 0 0 0; color:var(--ice-muted);} 
