@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --accent: #34a853;
  --accent-dark: #2d8f47;
  --warning: #ea4335;
  --orange: #f9ab00;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #202124;
  --text-secondary: #5f6368;
  --border: #dadce0;
  --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* ヘッダー */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.header h1 .icon {
  font-size: 1.5rem;
}

.header-subtitle {
  font-size: 0.8rem;
  opacity: 0.85;
  font-weight: 300;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-actions .user-info {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-right: 8px;
}

/* ボタン */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:hover { background: var(--accent-dark); }

.btn-outline {
  background: transparent;
  color: white;
  border: 1.5px solid rgba(255,255,255,0.6);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.15);
  border-color: white;
}

.btn-outline-dark {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline-dark:hover {
  background: var(--primary-light);
}

.btn-danger {
  background: var(--warning);
  color: white;
}
.btn-danger:hover { background: #d33426; }

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* メインコンテンツ */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* ヒーローセクション */
.hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, #d2e3fc 100%);
  border-radius: var(--radius);
  padding: 40px;
  margin-bottom: 30px;
  text-align: center;
}

.hero h2 {
  font-size: 1.6rem;
  margin-bottom: 12px;
  color: var(--primary-dark);
}

.hero p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto 20px;
}

/* 統計 */
.stats-bar {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.stat-item {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  box-shadow: var(--shadow);
  text-align: center;
  min-width: 120px;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* フィルター */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.filter-bar label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.filter-bar select {
  width: auto;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  background: white;
  cursor: pointer;
}

/* カテゴリータグ */
.category-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--primary-light);
  color: var(--primary);
}

.category-tag.infrastructure { background: #fce8e6; color: #c5221f; }
.category-tag.welfare { background: #e6f4ea; color: #1e8e3e; }
.category-tag.education { background: #fef7e0; color: #e37400; }
.category-tag.environment { background: #e6f4ea; color: #137333; }
.category-tag.safety { background: #fce8e6; color: #a50e0e; }
.category-tag.economy { background: #e8f0fe; color: #1a73e8; }
.category-tag.culture { background: #f3e8fd; color: #8430ce; }
.category-tag.transport { background: #e0f7fa; color: #00796b; }
.category-tag.community { background: #fff3e0; color: #e65100; }
.category-tag.administration { background: #e8eaf6; color: #283593; }
.category-tag.energy { background: #fff8e1; color: #f57f17; }
.category-tag.peace { background: #e8eaf6; color: #1a237e; }
.category-tag.other { background: #f5f5f5; color: #616161; }

/* ステータスバッジ */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}

.status-badge.open { background: #e8f0fe; color: #1a73e8; }
.status-badge.in_progress { background: #fef7e0; color: #e37400; }
.status-badge.resolved { background: #e6f4ea; color: #1e8e3e; }
.status-badge.closed { background: #f5f5f5; color: #616161; }

/* 意見カード */
.opinion-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.opinion-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
  border-left: 4px solid transparent;
}

.opinion-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
  border-left-color: var(--primary);
}

.opinion-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 12px;
}

.opinion-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.opinion-card-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 12px;
}

.opinion-card-content {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 8px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: white;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.like-btn:hover {
  border-color: var(--warning);
  color: var(--warning);
  background: #fce8e6;
}

.like-btn.liked {
  border-color: var(--warning);
  color: var(--warning);
  background: #fce8e6;
}

.like-count {
  font-weight: 600;
}

/* 意見詳細 */
.opinion-detail {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.opinion-detail h2 {
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.opinion-detail .content {
  font-size: 1rem;
  line-height: 1.8;
  white-space: pre-wrap;
  margin: 16px 0;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 16px;
  cursor: pointer;
}
.back-link:hover { text-decoration: underline; }

/* コメントセクション */
.comments-section {
  margin-top: 24px;
}

.comments-section h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.comment-item {
  padding: 16px;
  border-left: 3px solid var(--border);
  margin-bottom: 12px;
  background: var(--bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.comment-item.admin-response {
  border-left-color: var(--accent);
  background: #f0faf3;
}

.comment-author {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.comment-author .admin-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 6px;
  font-weight: 600;
}

.comment-content {
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.comment-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

.response-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 600;
  margin-left: 6px;
}

.response-type-badge.comment { background: #e8f0fe; color: #1a73e8; }
.response-type-badge.action { background: #fef7e0; color: #e37400; }
.response-type-badge.update { background: #e6f4ea; color: #1e8e3e; }

/* フォーム */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group .hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
  background: white;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* モーダル */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal h2 {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* 通知 */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.9rem;
  z-index: 300;
  animation: slideIn 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.toast.success { background: var(--accent); }
.toast.error { background: var(--warning); }
.toast.info { background: var(--primary); }

@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ローディング */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 空状態 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

/* ページネーション */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination button {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.pagination button:hover {
  background: var(--primary-light);
}

.pagination button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* 管理者ページ */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  min-height: calc(100vh - 72px);
}

.admin-sidebar {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  height: fit-content;
  position: sticky;
  top: 90px;
}

.admin-sidebar .menu-item {
  display: block;
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.admin-sidebar .menu-item:hover { background: var(--bg); }
.admin-sidebar .menu-item.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.admin-stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

.hidden { display: none !important; }

/* レスポンシブ */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .main-content {
    padding: 16px;
  }

  .hero {
    padding: 24px 16px;
  }

  .hero h2 {
    font-size: 1.2rem;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .opinion-card {
    padding: 16px;
  }

  .opinion-card-header {
    flex-direction: column;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .stats-bar {
    gap: 8px;
  }

  .stat-item {
    padding: 8px 16px;
    min-width: 80px;
  }

  .modal {
    padding: 20px;
    margin: 10px;
  }
}
