/* ============================================
   PNG to WebP 変換プラグイン
   すべて .pngwebp- プレフィックスでスコープ化
   （Cocoonテーマとの干渉防止）
   ============================================ */

.pngwebp-root {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
  color: #1e3a5f;
  box-sizing: border-box;
}
.pngwebp-root *,
.pngwebp-root *::before,
.pngwebp-root *::after {
  box-sizing: border-box;
}

/* 表示切り替え用（Cocoon対策で!important） */
.pngwebp-root .hidden {
  display: none !important;
}

/* ===== ヘッダー ===== */
.pngwebp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1e3a5f;
  color: #fff;
  border-radius: 12px;
  padding: 12px 20px;
  margin-bottom: 16px;
}
.pngwebp-title {
  font-size: 20px;
  margin: 0;
  color: #fff;
  border: none;
  padding: 0;
}
.pngwebp-status {
  font-size: 14px;
  background: #d4af37;
  color: #1e3a5f;
  border-radius: 20px;
  padding: 4px 14px;
  font-weight: bold;
  white-space: nowrap;
}

/* ===== ドロップゾーン ===== */
.pngwebp-dropzone {
  border: 3px dashed #1e3a5f;
  border-radius: 16px;
  background: #fff;
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  user-select: none;
  -webkit-user-select: none;
}
.pngwebp-dropzone.pngwebp-dragover {
  background: #eaf2fb;
  border-color: #d4af37;
}
.pngwebp-dropzone p {
  margin: 8px 0;
  font-size: 16px;
}
.pngwebp-icon {
  font-size: 48px;
  line-height: 1;
}
.pngwebp-note {
  font-size: 13px;
  color: #667;
}

/* ===== 品質設定 ===== */
.pngwebp-settings {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 12px 20px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.pngwebp-quality-label {
  font-weight: bold;
  font-size: 15px;
}
.pngwebp-settings input[type="range"] {
  flex: 1;
  min-width: 150px;
  accent-color: #1e3a5f;
}
.pngwebp-quality-value {
  font-weight: bold;
  color: #d4af37;
  background: #1e3a5f;
  border-radius: 8px;
  padding: 4px 12px;
  min-width: 48px;
  text-align: center;
}

/* ===== 結果リスト ===== */
.pngwebp-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pngwebp-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  flex-wrap: wrap;
}
.pngwebp-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background:
    repeating-conic-gradient(#ddd 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
  border-radius: 8px;
  border: 1px solid #ccd;
}
.pngwebp-item-info {
  flex: 1;
  min-width: 160px;
}
.pngwebp-item-name {
  font-weight: bold;
  font-size: 14px;
  word-break: break-all;
}
.pngwebp-item-size {
  font-size: 12px;
  color: #667;
}
.pngwebp-saved {
  color: #2e7d32;
  font-weight: bold;
}
.pngwebp-download-btn {
  background: #1e3a5f;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 14px;
  cursor: pointer;
  font-weight: bold;
}
.pngwebp-download-btn:hover {
  background: #2c4f7c;
  color: #fff;
}

/* ===== 一括ダウンロード ===== */
.pngwebp-download-all {
  display: block;
  width: 100%;
  margin-top: 16px;
  background: #d4af37;
  color: #1e3a5f;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}
.pngwebp-download-all:hover {
  background: #e5c258;
  color: #1e3a5f;
}

/* ===== エラー表示 ===== */
.pngwebp-error {
  background: #fdecea;
  color: #b3261e;
  border-radius: 12px;
  padding: 10px 16px;
  margin-top: 12px;
  font-size: 14px;
}

/* ===== レスポンシブ（タブレット・スマホ） ===== */
@media (max-width: 480px) {
  .pngwebp-title {
    font-size: 16px;
  }
  .pngwebp-dropzone {
    padding: 32px 12px;
  }
}
