/* ========== Pünkösdölő Practice Plugin Styles ========== */
/* すべてのセレクタに .pnk- プレフィックスを付けてWordPressとの競合を回避 */

.pnk-container {
  max-width: 700px;
  margin: 0 auto 40px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  color: #222;
  box-sizing: border-box;
}
.pnk-container *, .pnk-container *::before, .pnk-container *::after {
  box-sizing: border-box;
}

.pnk-header {
  background: #2c5f8a;
  color: #fff;
  padding: 16px 20px;
}
.pnk-header h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  padding: 0;
  border: none;
  color: #fff;
}
.pnk-header p {
  font-size: 12px;
  opacity: 0.75;
  margin: 3px 0 0;
}

.pnk-body { padding: 18px 20px; }

/* セクションタイトル */
.pnk-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #555;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pnk-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #eee;
}

/* 使い方 */
.pnk-howto {
  background: #f0f6ff;
  border: 1px solid #c5d9f0;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12px;
  color: #3a6090;
  margin-bottom: 14px;
  line-height: 1.7;
}

/* 歌詞一覧 */
.pnk-lyrics-panel {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}
.pnk-lyrics-header {
  display: grid;
  grid-template-columns: 28px 1fr 1fr 72px;
  background: #f0f0f0;
  border-bottom: 1px solid #ddd;
  font-size: 11px;
  font-weight: 700;
  color: #666;
  padding: 6px 10px;
  gap: 8px;
}
.pnk-lyric-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr 72px;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid #f0f0f0;
  align-items: center;
  cursor: pointer;
  transition: background 0.1s;
}
.pnk-lyric-row:last-child { border-bottom: none; }
.pnk-lyric-row:hover { background: #f8f8f8; }
.pnk-lyric-row.in-range { background: #e8f0fd; }
.pnk-lyric-row.range-start { background: #c5d8f8; border-top: 2px solid #2c5f8a; }
.pnk-lyric-row.range-end   { background: #c5d8f8; border-bottom: 2px solid #2c5f8a; }
.pnk-row-num { font-size: 11px; color: #aaa; text-align: center; }
.pnk-lyric-row.range-start .pnk-row-num,
.pnk-lyric-row.range-end .pnk-row-num,
.pnk-lyric-row.in-range .pnk-row-num { color: #2c5f8a; font-weight: 700; }
.pnk-lyric-hu { font-family: Georgia, serif; font-size: 13px; color: #222; }
.pnk-lyric-jp { font-size: 11px; color: #666; }
.pnk-sec-badge {
  font-size: 10px;
  background: #eee;
  color: #666;
  border-radius: 3px;
  padding: 2px 5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pnk-sep-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr 72px;
  gap: 8px;
  padding: 5px 10px;
  background: #eef3f8;
  border-bottom: 1px solid #d5e0ec;
  border-top: 1px solid #d5e0ec;
}
.pnk-sep-label { font-size: 11px; font-weight: 700; color: #2c5f8a; letter-spacing: 0.05em; }

/* 範囲選択 */
.pnk-range-control {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}
.pnk-range-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.pnk-range-row:last-child { margin-bottom: 0; }
.pnk-range-label { font-size: 12px; font-weight: 500; color: #555; width: 60px; flex-shrink: 0; }
.pnk-range-select {
  flex: 1;
  min-width: 200px;
  border: 1px solid #bbb;
  border-radius: 5px;
  padding: 7px 8px;
  font-size: 13px;
  font-family: Georgia, serif;
  background: #fff;
  color: #222;
  outline: none;
  cursor: pointer;
}
.pnk-range-select:focus { border-color: #2c5f8a; box-shadow: 0 0 0 2px rgba(44,95,138,0.12); }

.pnk-rbtn {
  padding: 7px 12px;
  border-radius: 5px;
  border: 1px solid #ccc;
  background: #fff;
  font-size: 12px;
  color: #444;
  cursor: pointer;
  transition: background 0.1s;
  font-family: 'Noto Sans JP', sans-serif;
}
.pnk-rbtn:hover { background: #eee; }
.pnk-rbtn.pnk-primary { background: #2c5f8a; color: #fff; border-color: #2c5f8a; }
.pnk-rbtn.pnk-primary:hover { background: #235078; }

/* プレビュー */
.pnk-preview-box {
  background: #e8f0fd;
  border: 1px solid #b0c8ee;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.pnk-preview-head { font-size: 11px; font-weight: 700; color: #2c5f8a; margin-bottom: 6px; }
.pnk-prev-line { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.pnk-prev-hu { font-family: Georgia, serif; font-size: 13px; color: #1a3a60; }
.pnk-prev-jp { font-size: 11px; color: #557; }

/* 入力支援 */
.pnk-assist-panel {
  background: #f7f9fd;
  border: 1px solid #d0daea;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.pnk-assist-title { font-size: 11px; color: #777; margin-bottom: 7px; font-weight: 500; }
.pnk-assist-rows { display: flex; flex-direction: column; gap: 5px; }
.pnk-assist-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pnk-assist-row-label { font-size: 10px; color: #999; width: 60px; flex-shrink: 0; }
.pnk-char-btn {
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 15px;
  cursor: pointer;
  color: #222;
  transition: background 0.1s, color 0.1s;
  font-family: Georgia, serif;
  min-width: 30px;
  text-align: center;
}
.pnk-char-btn:hover { background: #2c5f8a; color: #fff; border-color: #2c5f8a; }

/* テキストエリア */
.pnk-field-label { font-size: 12px; font-weight: 700; color: #555; margin-bottom: 5px; }
#pnk-practiceText {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px 12px;
  font-family: Georgia, serif;
  font-size: 16px;
  line-height: 1.75;
  color: #222;
  resize: vertical;
  min-height: 90px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-bottom: 12px;
  display: block;
}
#pnk-practiceText:focus { border-color: #2c5f8a; box-shadow: 0 0 0 2px rgba(44,95,138,0.12); }
#pnk-practiceText::placeholder { color: #bbb; font-style: italic; font-size: 13px; }

/* 練習行 */
.pnk-prac-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid #eee;
  font-family: Georgia, serif;
  font-size: 15px;
  color: #333;
  transition: background 0.2s;
}
.pnk-prac-line:last-child { border-bottom: none; }
.pnk-prac-line .line-num { font-size: 11px; color: #bbb; min-width: 20px; text-align: right; flex-shrink: 0; }
.pnk-prac-line .line-text { flex: 1; }
.pnk-prac-line.active { background: #fff3cd; color: #222; font-weight: 700; }
.pnk-prac-line.active .line-num { color: #c87800; font-weight: 700; }
.pnk-prac-line.done { color: #aaa; }
.pnk-prac-line.done .line-text { text-decoration: line-through; text-decoration-color: #ccc; }

/* 訳ボックス */
.pnk-translation-box {
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 12px;
  min-height: 60px;
  font-size: 14px;
  line-height: 1.85;
  color: #444;
  margin-bottom: 12px;
  position: relative;
}
.pnk-placeholder-text { color: #bbb; font-style: italic; font-size: 12px; }

/* ボタン行 */
.pnk-btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pnk-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
}
.pnk-btn:active { transform: scale(0.97); }
.pnk-btn-play { background: #2c5f8a; color: #fff; flex: 1; justify-content: center; }
.pnk-btn-play:hover { background: #235078; }
.pnk-btn-play:disabled { opacity: 0.4; cursor: not-allowed; }
.pnk-btn-translate { background: #f0f4fa; color: #2c5f8a; border: 1px solid #b0c8ee; }
.pnk-btn-translate:hover { background: #dce8f7; }
.pnk-btn-clear { background: #f5f5f5; color: #777; border: 1px solid #ddd; }
.pnk-btn-clear:hover { background: #eee; }

/* 速度 */
.pnk-speed-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 7px 12px;
  margin-bottom: 12px;
}
.pnk-speed-row label { font-size: 12px; color: #666; white-space: nowrap; }
.pnk-speed-row input[type=range] { flex: 1; accent-color: #2c5f8a; cursor: pointer; }
.pnk-speed-val { font-size: 13px; color: #2c5f8a; font-weight: 700; min-width: 36px; text-align: right; }

/* ステータスバー */
.pnk-status-bar {
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}
.pnk-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #ccc; flex-shrink: 0; }
.pnk-status-dot.ready { background: #4caf88; }
.pnk-status-dot.speaking { background: #2c5f8a; animation: pnkBlink 1s ease-in-out infinite; }
.pnk-status-dot.error { background: #e05050; }
@keyframes pnkBlink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ===== 歌詞編集エリア ===== */
.pnk-edit-panel {
  background: #fafcff;
  border: 1px solid #d0daea;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 16px;
}
.pnk-edit-notice {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 12px;
  color: #5a4000;
  line-height: 1.7;
  margin-bottom: 12px;
}

/* 編集テーブル */
.pnk-edit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 10px;
}
.pnk-edit-table th {
  background: #f0f0f0;
  border: 1px solid #ddd;
  padding: 6px 8px;
  font-weight: 700;
  color: #555;
  text-align: left;
}
.pnk-edit-table td {
  border: 1px solid #eee;
  padding: 4px 6px;
  vertical-align: middle;
}
.pnk-edit-table tr:nth-child(even) td { background: #f9f9f9; }
.pnk-edit-table tr:hover td { background: #eef4ff; }
.pnk-edit-num { font-size: 11px; color: #aaa; text-align: center; width: 28px; }
.pnk-edit-sec { width: 60px; }
.pnk-edit-input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 3px 5px;
  font-family: Georgia, serif;
  font-size: 13px;
  color: #222;
  background: transparent;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.pnk-edit-input:focus {
  border-color: #2c5f8a;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(44,95,138,0.1);
}
.pnk-edit-input.pnk-changed {
  background: #fff9e0;
  border-color: #e6c200;
}

/* 保存確認バー */
.pnk-save-bar {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.pnk-save-msg { font-size: 13px; font-weight: 500; color: #5a4000; }
.pnk-save-actions { display: flex; gap: 8px; }
.pnk-btn-save {
  background: #2c5f8a;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  font-family: 'Noto Sans JP', sans-serif;
  transition: background 0.15s;
}
.pnk-btn-save:hover { background: #235078; }
.pnk-btn-discard {
  background: #f5f5f5;
  color: #555;
  border: 1px solid #ccc;
  padding: 8px 14px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  font-family: 'Noto Sans JP', sans-serif;
  transition: background 0.15s;
}
.pnk-btn-discard:hover { background: #eee; }

/* 保存結果メッセージ */
.pnk-save-result {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
}
.pnk-save-result.success { background: #e8f5e9; border: 1px solid #a5d6a7; color: #1b5e20; }
.pnk-save-result.error   { background: #ffebee; border: 1px solid #ef9a9a; color: #b71c1c; }

/* セクション区切り行 */
.pnk-edit-sep td {
  background: #eef3f8 !important;
  border-top: 1px solid #d5e0ec !important;
  border-bottom: 1px solid #d5e0ec !important;
  font-size: 11px;
  font-weight: 700;
  color: #2c5f8a;
  padding: 4px 8px;
}

/* スピナー */
.pnk-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid #ddd;
  border-top-color: #2c5f8a;
  border-radius: 50%;
  animation: pnkSpin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes pnkSpin { to { transform: rotate(360deg); } }
