/* ==========================================================
   Lyrics Copier v5.1
   - 幅: テーマ準拠 100%
   - 色: プラグイン独自
   - スマホ: input潰れ修正 / 自動ズーム防止
   ========================================================== */

/* --- Scope Reset --- */
#lc-app,
#lc-app *,
#lc-app *::before,
#lc-app *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#lc-app {
  width: 100%;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
               "Noto Sans JP", "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
}

/* ===================== Header ===================== */
#lc-app .lc-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 28px;
}

#lc-app .lc-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #d0d0d0;
  border-radius: 12px;
  color: #4a5568;
}

#lc-app .lc-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #111;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  line-height: 1.3;
}

#lc-app .lc-desc {
  font-size: 0.85rem;
  color: #777;
  margin-top: 3px;
}

/* =================== Input =================== */
#lc-app .lc-input-group {
  margin-bottom: 24px;
}

#lc-app .lc-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

#lc-app .lc-input-row {
  display: flex;
  gap: 8px;
  width: 100%;
  align-items: stretch;          /* ★ 高さ揃え */
}

/* ★ input: 潰れ防止 — 明示的な height + min-height + flex 制御 */
#lc-app #lc-url {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;                   /* ★ スマホ幅確保 */
  height: 48px;
  min-height: 48px;              /* ★ 潰れ防止 */
  padding: 0 16px;
  font-size: 16px;               /* ★ iOS自動ズーム防止 (16px固定) */
  color: #1a1a1a;
  background: #fff;
  border: 1.5px solid #ccc;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-text-size-adjust: 100%;
  -webkit-appearance: none;      /* ★ iOS装飾リセット */
  appearance: none;
}
#lc-app #lc-url::placeholder { color: #aaa; }
#lc-app #lc-url:focus {
  border-color: #222;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.07);
}

#lc-app #lc-fetch-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 48px;
  min-height: 48px;
  padding: 0 24px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: #111;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}
#lc-app #lc-fetch-btn:hover { background: #333; }
#lc-app #lc-fetch-btn:active { transform: scale(0.97); }
#lc-app #lc-fetch-btn:disabled { opacity: 0.4; cursor: not-allowed; }
#lc-app #lc-fetch-btn .lc-btn-icon { transition: transform 0.3s; }
#lc-app #lc-fetch-btn.is-loading .lc-btn-icon {
  animation: lc-spin 0.8s linear infinite;
}
@keyframes lc-spin { to { transform: rotate(360deg); } }

/* =================== Status =================== */
#lc-app .lc-status {
  padding: 12px 16px;
  font-size: 0.86rem;
  border-radius: 8px;
  margin-bottom: 20px;
}
#lc-app .lc-status[data-type="error"] {
  color: #b91c1c;
  border: 1px solid #f5c6c6;
}
#lc-app .lc-status[data-type="info"] {
  color: #1e5fa6;
  border: 1px solid #b8d4f0;
}

/* =================== Result =================== */
#lc-app #lc-result,
#lc-app #lc-result-trans {
  border-top: 1px solid #e0e0e0;
  padding-top: 24px;
  margin-top: 4px;
}

#lc-app .lc-result-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  min-height: 36px;
  gap: 12px;
}

#lc-app .lc-song-title {
  font-size: 0.82rem;
  color: #555;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

#lc-app #lc-copy-btn,
#lc-app #lc-copy-trans-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #111;
  background: #fff;
  border: 1.5px solid #111;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
#lc-app #lc-copy-btn:hover,
#lc-app #lc-copy-trans-btn:hover {
  background: #111;
  color: #fff;
}
#lc-app #lc-copy-btn.is-copied,
#lc-app #lc-copy-trans-btn.is-copied {
  border-color: #16a34a;
  color: #16a34a;
  background: #fff;
}

/* --- Textarea --- */
#lc-app #lc-lyrics,
#lc-app #lc-lyrics-trans {
  display: block;
  width: 100%;
  min-height: 200px;
  padding: 24px;
  font-family: "Hiragino Mincho ProN", "Noto Serif JP", "Yu Mincho",
               "Times New Roman", serif;
  font-size: 16px;               /* ★ iOS自動ズーム防止 */
  line-height: 2.1;
  color: #1a1a1a;
  background: #fff;
  border: 1.5px solid #d4d4d4;
  border-radius: 12px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-text-size-adjust: 100%;
  -webkit-overflow-scrolling: touch;
  -webkit-appearance: none;
  appearance: none;
}
#lc-app #lc-lyrics:focus,
#lc-app #lc-lyrics-trans:focus {
  border-color: #999;
}

/* --- まとめてコピー --- */
#lc-app #lc-copy-all-wrap {
  margin-top: 20px;
  text-align: center;
}
#lc-app #lc-copy-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 28px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  background: #111;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
#lc-app #lc-copy-all-btn:hover { background: #333; }
#lc-app #lc-copy-all-btn:active { transform: scale(0.97); }
#lc-app #lc-copy-all-btn.is-copied { background: #16a34a; }

/* =================== Details =================== */
#lc-app .lc-sites-details {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #e5e5e5;
}
#lc-app .lc-sites-details summary {
  font-size: 0.79rem;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  letter-spacing: 0.04em;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
}
#lc-app .lc-sites-details summary::-webkit-details-marker { display: none; }
#lc-app .lc-sites-details summary::before { content: "＋"; font-size: 0.85rem; }
#lc-app .lc-sites-details[open] summary::before { content: "−"; }

#lc-app .lc-sites-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  list-style: none;
  padding: 0;
}
#lc-app .lc-sites-list li {
  font-size: 0.73rem;
  color: #666;
  padding: 4px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

/* =================== Responsive =================== */
@media (max-width: 600px) {
  #lc-app .lc-header { gap: 10px; }
  #lc-app .lc-icon { width: 38px; height: 38px; }
  #lc-app .lc-icon svg { width: 22px; height: 22px; }
  #lc-app .lc-title { font-size: 1.1rem; }
  #lc-app .lc-desc { font-size: 0.8rem; }

  /* ★ スマホ: 縦並び + input幅確保 */
  #lc-app .lc-input-row {
    flex-direction: column;
    gap: 10px;
  }
  #lc-app #lc-url {
    width: 100%;
    height: 50px;
    min-height: 50px;
    padding: 0 14px;
    font-size: 16px;
  }
  #lc-app #lc-fetch-btn {
    width: 100%;
    height: 50px;
    min-height: 50px;
    justify-content: center;
    font-size: 0.95rem;
  }

  #lc-app #lc-lyrics,
  #lc-app #lc-lyrics-trans {
    padding: 18px 16px;
    border-radius: 10px;
    line-height: 2;
  }

  #lc-app .lc-result-bar { flex-wrap: wrap; }
  #lc-app .lc-song-title {
    width: 100%;
    max-width: 100%;
    font-size: 0.78rem;
    margin-bottom: 4px;
  }
  #lc-app #lc-copy-btn,
  #lc-app #lc-copy-trans-btn {
    padding: 9px 18px;
    font-size: 0.84rem;
  }

  #lc-app #lc-copy-all-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
  }

  #lc-app .lc-sites-list li {
    font-size: 0.7rem;
    padding: 3px 8px;
  }
}
