/* ===================================
   報告一覧ページ専用スタイル
   =================================== */

.reports-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reports-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.reports-loading .typing-indicator {
  display: flex;
  gap: 4px;
}

.reports-loading .typing-dot {
  width: 8px;
  height: 8px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.reports-loading .typing-dot:nth-child(1) { animation-delay: 0s; }
.reports-loading .typing-dot:nth-child(2) { animation-delay: 0.2s; }
.reports-loading .typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.reports-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* 報告カード */
.report-card {
  background-color: var(--card-background);
  border-radius: 12px;
  overflow: hidden;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.report-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.report-card-nickname {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.report-card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.report-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-card-field {
  font-size: 0.85rem;
  line-height: 1.5;
}

.report-card-label {
  color: var(--text-secondary);
  font-weight: 700;
  margin-right: 6px;
}

.report-card-value {
  color: var(--text-primary);
  word-break: break-word;
}

/* 間違い指摘のハイライト */
.report-card-highlight {
  display: flex;
  gap: 10px;
  background-color: rgba(255, 80, 80, 0.1);
  border: 1px solid rgba(255, 80, 80, 0.25);
  border-radius: 8px;
  padding: 12px;
}

.report-card-highlight-icon {
  color: #ff6b6b;
  font-size: 1.1rem;
  flex-shrink: 0;
  line-height: 1.4;
}

.report-card-highlight-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ff6b6b;
  margin-bottom: 4px;
}

.report-card-highlight-text {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.5;
  word-break: break-word;
}

/* 修正版の回答ハイライト */
.report-card-corrected {
  background-color: rgba(78, 205, 196, 0.1);
  border: 1px solid rgba(78, 205, 196, 0.3);
  border-radius: 8px;
  padding: 12px;
}

.report-card-corrected-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.report-card-corrected-text {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.6;
  word-break: break-word;
}

/* 展開式セクション */
.report-card-details {
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}

.report-card-details-toggle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.report-card-details-toggle::-webkit-details-marker {
  display: none;
}

.report-card-details-toggle::before {
  content: '\25B6';
  font-size: 0.6rem;
  transition: transform 0.2s ease;
}

.report-card-details[open] > .report-card-details-toggle::before {
  transform: rotate(90deg);
}

.report-card-details-toggle:hover {
  color: var(--accent);
}

.report-card-details-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 10px;
}

/* 会話ログ */
.report-card-conversation {
  margin-top: 4px;
}

.report-card-conversation-log {
  margin-top: 6px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  max-height: 300px;
  overflow-y: auto;
  font-size: 0.82rem;
  line-height: 1.5;
}

.report-card-conversation-log .report-log-user,
.report-card-conversation-log .report-log-assistant {
  margin-bottom: 6px;
  padding: 2px 0;
}

.report-card-conversation-log .report-log-user {
  color: var(--text-secondary, #a0a0a0);
}

.report-card-conversation-log .report-log-assistant {
  color: var(--text-primary, #e0e0e0);
}

.report-card-conversation-log .report-log-role {
  margin-right: 4px;
}

/* ヘッダー左側（ニックネーム + ステータスバッジ） */
.report-card-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* ステータスバッジ */
.report-card-status.resolved {
  display: inline-block;
  background-color: rgba(78, 205, 196, 0.15);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--accent-dark);
  flex-shrink: 0;
}

/* 対応メモ */
.report-card-admin-note {
  background-color: var(--card-inner);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.8rem;
  line-height: 1.5;
}

.report-card-admin-note-label {
  color: var(--text-secondary);
  font-weight: 700;
  margin-right: 6px;
}

.report-card-admin-note-text {
  color: var(--text-primary);
  word-break: break-word;
}

/* カードフッター */
.report-card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.report-card-edit-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: 'Noto Sans JP', sans-serif;
  padding: 4px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.report-card-edit-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ===================================
   編集モーダル
   =================================== */

.edit-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.edit-overlay.active {
  display: flex;
}

.edit-modal {
  background-color: var(--card-background);
  border-radius: 16px;
  width: 90%;
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}

.edit-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.edit-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.edit-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.edit-modal-close:hover {
  color: var(--text-primary);
}

.edit-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.edit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.edit-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.edit-required {
  color: #ff6b6b;
}

.edit-textarea,
.edit-input {
  background-color: var(--card-inner);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease;
  resize: none;
}

.edit-textarea:focus,
.edit-input:focus {
  border-color: var(--accent);
}

.edit-textarea::placeholder,
.edit-input::placeholder {
  color: var(--text-muted);
}

.edit-select {
  background-color: var(--card-inner);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.edit-select:focus {
  border-color: var(--accent);
}

.edit-submit-btn {
  background-color: var(--accent);
  color: var(--background);
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'Noto Sans JP', sans-serif;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.edit-submit-btn:hover {
  background-color: var(--accent-dark);
}

.edit-submit-btn:disabled {
  background-color: var(--card-inner);
  color: var(--text-muted);
  cursor: not-allowed;
}

.edit-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.edit-note.success {
  color: var(--accent);
}

.edit-note.error {
  color: #ff6b6b;
}

/* 報告の例セクション */
.report-example-section {
  max-width: 640px;
  margin: 0 auto 24px;
  padding: 0 16px;
}

.report-example-details {
  background-color: var(--card-background);
  border-radius: 12px;
  overflow: hidden;
}

.report-example-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.report-example-toggle::-webkit-details-marker {
  display: none;
}

.report-example-toggle::before {
  content: '\25B6';
  font-size: 0.6rem;
  transition: transform 0.2s ease;
}

.report-example-details[open] > .report-example-toggle::before {
  transform: rotate(90deg);
}

.report-example-toggle:hover {
  opacity: 0.8;
}

.report-example-content {
  padding: 0 16px 16px;
}

.report-example-content .report-card {
  border: 1px dashed var(--accent-dark);
}

.report-example-note {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: center;
}

/* 報告履歴タイトル */
.reports-history-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* レスポンシブ */
@media (max-width: 600px) {
  .report-card-header {
    padding: 12px 14px;
  }

  .report-card-body {
    padding: 14px;
  }

  .report-card-nickname {
    font-size: 0.85rem;
  }

  .report-card-footer {
    padding: 8px 14px;
  }
}
