/* =====================================================
   ReplyMaker UI Stylesheet - Stable Version (v5.8)
===================================================== */

:root {
  --primary-color: #2563eb;
  --orange-color: #f97316;
  --bg-color: #f9fafb;
  --card-bg: #ffffff;
  --border-color: #e5e7eb;
}

body {
  background-color: var(--bg-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1f2937;
  line-height: 1.5;
}

.rm-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* 🧱 Header */
.rm-header { margin-bottom: 24px; border-bottom: 1px solid var(--border-color); padding-bottom: 12px; }
.rm-title { font-size: 1.5rem; font-weight: 700; color: #111827; margin: 0; }
.rm-status-text { font-size: 0.875rem; color: #6b7280; min-height: 1.25rem; }

/* 🧭 Filter Section */
.rm-filter-section {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 32px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.filter-group { flex: 1; min-width: 240px; }
.filter-group label { display: block; font-size: 0.75rem; font-weight: 600; color: #6b7280; text-transform: uppercase; margin-bottom: 4px; }
.rm-select {
  width: 100%; padding: 8px 12px; border-radius: 6px; border: 1px solid #d1d5db; background-color: #fff; font-size: 0.9375rem;
}

/* 🛠 Toolbar */
.toolbar {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px;
}
.toolbar label { font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 5px; }

/* 🧾 Card Structure */
.review-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.review-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.review-meta { flex: 1; display: flex; align-items: center; gap: 8px; }
.review-author { font-weight: 700; color: #111827; }
.review-rating { color: #fbbf24; font-size: 1.125rem; }
.review-date { font-size: 0.8125rem; color: #9ca3af; }

.review-comment { font-size: 0.9375rem; color: #374151; margin: 8px 0 16px; line-height: 1.6; }

/* 📝 Reply Area */
.reply-box { margin-top: 12px; position: relative; }
.reply-label { font-size: 0.75rem; font-weight: 700; color: #6b7280; display: block; margin-bottom: 6px; }
.reply-text {
  width: 100%; padding: 12px; border-radius: 6px; border: 1px solid #d1d5db; font-size: 0.875rem; line-height: 1.5; min-height: 100px;
}
.reply-text.state-unreplied { background: #fff; border-color: #d1d5db; }
.reply-text.state-draft     { background: #fffbeb; border-color: #fde68a; }
.reply-text.state-done      { background: #f9fafb; color: #9ca3af; border-color: #e5e7eb; }

/* ⚙️ Hamburger & Dropdown (Fixed Implementation) */
#rmMenuWrapper {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  z-index: 5000; /* 最前面に固定 */
}

.hamburger-btn {
  width: 44px;
  height: 44px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
}
.hamburger-btn .dots { font-size: 1.5rem; color: #4b5563; }

.rm-dropdown {
  display: none;
  position: absolute;
  top: 50px; /* ボタンのすぐ下 */
  right: 0;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  min-width: 160px;
  overflow: hidden;
}
.rm-dropdown.show { display: block; }
.rm-dropdown .menu-item {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 0.875rem;
  color: #374151;
}
.rm-dropdown .menu-item:hover { background: #f3f4f6; }

/* 🧾 Buttons & Modal */
button { border-radius: 6px; font-weight: 600; font-size: 0.875rem; padding: 8px 16px; cursor: pointer; border: none; transition: opacity 0.2s; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-blue, .btn-generate { background: var(--primary-color); color: #fff; }
.btn-orange { background: var(--orange-color); color: #fff; }
.btn-gray { background: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db; }

.modal {
  display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.5); z-index: 6000; justify-content: center; align-items: center;
}
.modal.show { display: flex; }
.modal-content {
  background: #fff; padding: 32px; border-radius: 12px; width: 90%; max-width: 440px;
}

@media (max-width: 640px) {
  .rm-filter-section { flex-direction: column; }
  .toolbar { flex-direction: column; align-items: stretch; }
}