/* =====================================
   Gazolab - Image Optimizer 専用CSS
   ・共通スタイル: /assets/css/tool.css
   ・ここには .gz-tool-optimize から始まるルールだけを書く
===================================== */

.gz-tool-optimize {
  /* Optimizer 専用の上書き・調整が必要になったらここに追記 */
}
/* 設定カード */
.gz-settings-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.gz-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.gz-settings-label {
  font-size: 0.95rem;
  font-weight: 500;
}

.gz-settings-control {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.gz-settings-control input[type="range"] {
  flex: 1;
}

.gz-settings-control input[type=range]{
  touch-action: pan-y;
}

.gz-settings-value {
  min-width: 2.5rem;
  text-align: right;
  font-size: 0.9rem;
  color: #374151;
}
.gz-compare-side-label {
  position: absolute;
  bottom: 8px;
  font-size: 0.75rem;
  line-height: 1.3;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  pointer-events: none; /* ドラッグ操作の邪魔をしない */
  z-index: 4;
}

/* 左下：Optimized */
.gz-label-left {
  left: 10px;
}

/* 右下：Original */
.gz-label-right {
  right: 10px;
}

/*EXIF / Auto の行まわり*/

.gz-settings-row--options {
  margin-top: 0.3rem;
}

.gz-settings-control--inline {
  flex: 1;
}

.gz-settings-label-inline {
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.gz-settings-label-inline input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

/*Auto Optimize ボタン*/
.gz-secondary-btn {
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.gz-secondary-btn:hover {
  background: #f3f4f6;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
}

/*結果表示（バー）＋ Download ブロック*/
.gz-result {
  flex: 1;
  font-size: 0.85rem;
}

.gz-bar-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.25rem;
}

.gz-bar-label {
  width: 70px;
  color: #4b5563;
}

.gz-bar {
  flex: 1;
  height: 6px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.gz-bar-inner {
  height: 100%;
  border-radius: 4px;
  background: #10b981;
  width: 0;
  transition: width 0.25s ease;
}

.gz-bar-size {
  min-width: 70px;
  text-align: right;
  color: #111827;
}

.gz-diff {
  margin-top: 1.35rem;
  font-size: 18px;
  color: #059669;
  font-weight: 600;
}

.gz-download-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  min-width: 170px;
}

.gz-settings-label-small {
  font-size: 0.8rem;
  color: #4b5563;
}

.gz-filename-input {
  width: 100%;
  max-width: 200px;
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
}
@media (max-width: 768px) {
  .gz-download-block {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

 /* ラベル + input を1行目で横並びに */
  .gz-settings-label-small {
    flex: 0 0 auto;           /* 必要な分だけ幅を取る */
    margin: 0;
  }
.gz-filename-input {
    flex: 1 1 0;
    min-width: 0;             /* はみ出し防止 */
  }

  .gz-download-block .gz-primary-btn {
flex: 0 0 100%;
    align-self: flex-end;
  }
}

/* EXIF 行の揃え（テキストとアイコンの高さを中央揃え） */
.gz-settings-exif {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ラベルの高さ・行間を揃える */
.gz-settings-exif .gz-settings-label-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  line-height: 1;
}

/* i アイコン＋ツールチップの基準になるラッパー */
.gz-help-wrap {
  position: relative;
  display: inline-block;
}

/* EXIF 行の中だけ、iボタンの余計なマージンを消す */
.gz-settings-exif .gz-help-icon {
  margin: 0 0 0 4px !important;  /* ← ここで 20px を上書き */
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: #fff;
  font-size: 0.65rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  color: #1f2933;
}


/* ツールチップ本体（幅広で、アイコン直下に表示） */
.gz-help-tooltip {
  position: absolute;
  z-index: 50;
  min-width: 260px;
  max-width: 320px;
  padding: 0.7rem 0.9rem;
  border-radius: 6px;
  background: #333;
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);

  opacity: 0;
  pointer-events: none;
  text-align: left;

  /* アイコンの少し下に表示 */
  top: 140%;
  left: 0;
  transform: none;

  transition: opacity 0.15s ease;
}

/* ツールチップ表示状態 */
.gz-help-tooltip.is-visible {
  opacity: 1;
  pointer-events: auto;
}
/* EXIF + Auto optimize 行の高さを揃える */
.gz-settings-row--options {
  align-items: center;     /* 行全体の縦位置を中央揃え */
}

/* Auto optimize ボタンの余計なマージンを打ち消す */
.gz-settings-row--options .gz-secondary-btn {
  margin-top: 0 !important;
}
* カードの横幅をディスプレイいっぱいにしない */
.gz-compare-card,
.gz-settings-card {
  max-width: 1100px;      /* 好きな数値に。MAX_DISPLAY_WIDTH(900)＋左右padding分くらい */
  margin-left: auto;
  margin-right: auto;
}


.gz-compare-card {
  text-align: center;
}

/* 外枠：幅は JS 側で固定。画面幅に追従させない */
.gz-compare-inner {
  position: relative;
  margin: 0.5rem auto 1rem;
  display: block;
  overflow: hidden;
  border-radius: 14px;
}

/* 2枚の画像共通 */
.gz-compare-img {
  display: block;
  height: auto;
  margin: 0 auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* ベース側 (Original) */
.gz-compare-img--base {
  position: relative;
  z-index: 1;
}

/* 上にかぶせる側 (Optimized) */
.gz-compare-overlay {
  position: absolute;
  inset: 0;
  overflow: hidden;
  width: 50%;          /* 初期は 50% */
  z-index: 2;
}

.gz-compare-img--top {
  position: absolute;
  top: 0;
  left: 0;
}

/* ハンドル */
.gz-compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 3;
  touch-action: none;

  /* ▼ ノブの“基準枠”を追加：幅を固定して中央寄せを強制 */
  width: 0;
}

@media (max-width: 768px) {
  .gz-compare-handle::before {
    content: "";
    position: absolute;
    top: -12px;
    left: -12px;
    width: 36px;
    height: 36px;
  }
}

/* 縦線：少し細く＆淡く */
.gz-compare-handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;                    /* ← ここ重要：常に基準枠の中央 */
  transform: translateX(-50%);
  width: 2px;                 /* 2px → 1px に */
  background: rgba(255,255,255,0.85);
  box-shadow: 0 0 0 1px rgb(31 41 55 / 7%);
}

/* ノブ本体：枠だけの透明コンテナに（pill感を消す） */
.gz-compare-handle-knob {
  position: absolute;
  top: 50%;
  left: 0;                    /* ← 線と同じ位置 */
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;                 /* 5px → 0 */
  border-radius: 999px;
  background: transparent;    /* 青背景をやめる */
  box-shadow: none;           /* 影もノブ側は無し */
  pointer-events: auto;
}

/* 白丸：ここに質感を集中させる */
.gz-compare-knob-dot {
  width: 25px;
  height: 25px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d7d7d7;
  box-shadow: 0 1px 4px rgba(0,0,0,0.16);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* ちょっとだけリッチなホバー */
.gz-compare-handle-knob:hover .gz-compare-knob-dot {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0,0,0,0.20);
}

/* ラベルテキスト */
.gz-compare-label {
  white-space: nowrap;
  opacity: 0.9;
}

/* スマホではラベルを隠して丸だけにする */
@media (max-width: 480px) {
  .gz-compare-label {
    display: none;
  }
}

/* 補助用（もし残しているならそのまま） */
.gz-compare-range {
  width: 100%;
  margin-top: 0.8rem;
}
@media (max-width: 768px) {
  .gz-card.gz-settings-card[style] {
    margin-top: 0 !important;
  }
}
