/* ==================== */
/* ベーススタイル */
/* ==================== */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-color: #f5f5f5;
  color: #202124;
  font-size: 14px;
  line-height: 1.5;
}

/* Material Symbols */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.material-symbols-outlined.filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* モーダル時スクロール停止 */
body.modal-open {
  overflow: hidden;
}

/* ==================== */
/* レイアウト */
/* ==================== */

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
}

.app-header {
  flex-shrink: 0;
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  z-index: 100;
}

.app-main {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ==================== */
/* サイドバー - Firebase風 */
/* ==================== */

.app-sidebar {
  flex-shrink: 0;
  width: 256px;
  min-width: 256px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #1a1a1a;
  color: #ffffff;
  z-index: 90;
  transition: width 0.3s ease, min-width 0.3s ease;
}

/* サイドバー折りたたみ状態 */
.app-sidebar.collapsed {
  width: 90px;
  min-width: 90px;
}

.app-sidebar::-webkit-scrollbar {
  width: 8px;
}

.app-sidebar::-webkit-scrollbar-track {
  background: #2a2a2a;
}

.app-sidebar::-webkit-scrollbar-thumb {
  background: #404040;
  border-radius: 4px;
}

.app-sidebar::-webkit-scrollbar-thumb:hover {
  background: #505050;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin: 4px 8px;
  border-radius: 4px;
  color: #ffffff;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

.sidebar-link:hover {
  background: #bddeff;
}

.sidebar-link.active {
  background: #1976d2;
}

/* サイドバーのテキスト部分 */
.sidebar-text {
  opacity: 1;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

/* 折りたたみ時はテキストを非表示 */
.app-sidebar.collapsed .sidebar-text {
  opacity: 0;
  width: 0;
  display: none;
}

/* 折りたたみ時のアイコン中央配置 */
.app-sidebar.collapsed .sidebar-link {
  justify-content: center;
  padding: 12px 0;
  border-left: none !important; /* 左ボーダーを非表示 */
}

/* 折りたたみ時のアクティブ状態は背景色のみで表示 */
.app-sidebar.collapsed .sidebar-link.bg-primary-50,
.app-sidebar.collapsed .sidebar-link.active {
  background: #bddeff;
  border-left: none !important;
}

/* 折りたたみ時のアイコンマージン削除 */
.app-sidebar.collapsed .sidebar-link .material-symbols-outlined {
  margin-right: 0;
}

/* ツールチップ表示（折りたたみ時） */
.app-sidebar.collapsed .sidebar-link::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 70px;
  background: #2a2a2a;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.app-sidebar.collapsed .sidebar-link:hover::after {
  opacity: 1;
}

/* ==================== */
/* コンテンツエリア */
/* ==================== */

.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #f5f5f5;
  transition: all 0.3s ease;
}

.app-content.expanded {
  flex: 1;
}

.app-content::-webkit-scrollbar {
  width: 12px;
}

.app-content::-webkit-scrollbar-track {
  background: #f5f5f5;
}

.app-content::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 6px;
  border: 3px solid #f5f5f5;
}

.app-content::-webkit-scrollbar-thumb:hover {
  background: #b0b0b0;
}

/* ==================== */
/* ボタン - Firebase風 */
/* ==================== */

button {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* プライマリボタン */
.bg-primary-600,
.bg-primary-500 {
  background: #1976d2;
  color: #ffffff;
}

.bg-primary-600:hover,
.bg-primary-500:hover {
  background: #1565c0;
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.bg-primary-700 {
  background: #1565c0;
}

.bg-primary-700:hover {
  background: #0d47a1;
}

/* セカンダリボタン */
.border-gray-300 {
  background: #ffffff;
  border: 1px solid #dadce0 !important;
  color: #5f6368;
}

.border-gray-300:hover {
  background: #f8f9fa;
  border-color: #c5c7ca !important;
}

/* 削除ボタン */
.bg-red-600 {
  background: #d32f2f;
  color: #ffffff;
}

.bg-red-600:hover {
  background: #c62828;
}

.bg-red-700 {
  background: #c62828;
}

.bg-red-700:hover {
  background: #b71c1c;
}

/* 表示切り替えボタン */
.view-mode-btn-active {
  background: #1976d2 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3);
}

.view-mode-btn-inactive {
  background: #ffffff !important;
  color: #5f6368 !important;
  border: 1px solid #dadce0 !important;
}

.view-mode-btn-inactive:hover {
  background: #f8f9fa !important;
}

/* ==================== */
/* フォーム要素 - Firebase風 */
/* ==================== */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-size: 14px;
  color: #202124;
  background: #ffffff;
  transition: all 0.2s ease;
  font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
select:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

input[type="text"]:disabled,
input[type="email"]:disabled,
input[type="tel"]:disabled,
input[type="date"]:disabled,
select:disabled {
  background: #f5f5f5;
  color: #9aa0a6;
  cursor: not-allowed;
}

input[type="text"]:read-only {
  background: #f5f5f5;
  color: #5f6368;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #5f6368;
}

/* ==================== */
/* バッジ - Firebase風 */
/* ==================== */

.inline-flex.items-center {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

/* 所属状態バッジ */
.bg-blue-100 {
  background: #e3f2fd;
  color: #1565c0;
}

.text-blue-800 {
  color: #1565c0;
}

.bg-yellow-100 {
  background: #fff9c4;
  color: #f57f17;
}

.text-yellow-800 {
  color: #f57f17;
}

.bg-gray-100 {
  background: #f5f5f5;
  color: #616161;
}

.text-gray-800 {
  color: #616161;
}

/* 支払状態バッジ */
.bg-green-100 {
  background: #e8f5e9;
  color: #2e7d32;
}

.text-green-800 {
  color: #2e7d32;
}

.bg-red-100 {
  background: #ffebee;
  color: #c62828;
}

.text-red-800 {
  color: #c62828;
}

/* ==================== */
/* モーダル - Firebase風 */
/* ==================== */

.modal-content {
  max-height: 85vh;
  overflow-y: auto;
}

.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: #f5f5f5;
}

.modal-content::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: #b0b0b0;
}

/* モーダルヘッダー */
#newMemberModal .bg-primary-600,
#memberDetailModal .bg-primary-600 {
  background: #1976d2;
  padding: 20px 24px;
}

/* ==================== */
/* ヘッダー - Firebase風 */
/* ==================== */

h1 {
  font-size: 24px;
  font-weight: 400;
  color: #202124;
  margin: 0;
}

h2 {
  font-size: 20px;
  font-weight: 400;
  color: #202124;
  margin: 0;
}

h3 {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
  margin: 0;
}

/* ==================== */
/* ロイヤリティ星 */
/* ==================== */

.text-yellow-500 {
  color: #fbc02d;
}

.text-yellow-400 {
  color: #ffeb3b;
}

.text-gray-300 {
  color: #e0e0e0;
}

/* 星評価の表示 */
.star {
  cursor: pointer;
  transition: color 0.2s ease;
}

/* ==================== */
/* プレースホルダー */
/* ==================== */

.placeholder-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

/* ==================== */
/* アイコンカラー */
/* ==================== */

.text-primary-600 {
  color: #1976d2;
}

.text-primary-600:hover {
  color: #1565c0;
}

.text-primary-800 {
  color: #0d47a1;
}

.text-red-600 {
  color: #d32f2f;
}

.text-red-600:hover {
  color: #c62828;
}

.text-red-800 {
  color: #c62828;
}

.text-gray-500 {
  color: #9aa0a6;
}

.text-gray-600 {
  color: #5f6368;
}

.text-gray-700 {
  color: #3c4043;
}

.text-gray-800 {
  color: #202124;
}

/* ==================== */
/* レスポンシブ - ハーフサイズ対応 */
/* ==================== */

@media (max-width: 1280px) {
  html,
  body {
    font-size: 13px;
  }

  .app-sidebar {
    width: 220px;
    min-width: 220px;
  }

  .app-content {
    padding: 16px;
  }

  .member-list-header,
  .member-list-filters {
    padding: 16px 20px;
  }

  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: 18px;
  }

  .table-scroll-container thead th {
    padding: 12px;
    font-size: 11px;
  }

  .table-scroll-container tbody td {
    padding: 12px;
    font-size: 12px;
  }

  .member-card {
    padding: 16px;
  }

  .member-card-title {
    font-size: 15px;
  }
}

@media (max-width: 768px) {
  .app-sidebar {
    width: 180px;
    min-width: 180px;
  }

  .app-content {
    padding: 12px;
  }

  .sidebar-link {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* ==================== */
/* ユーティリティ */
/* ==================== */

.responsive-padding {
  padding: 16px;
}

.responsive-padding-x {
  padding-left: 16px;
  padding-right: 16px;
}

.responsive-padding-y {
  padding-top: 12px;
  padding-bottom: 12px;
}

.table-text {
  font-size: 13px;
}

/* ==================== */
/* ローディング */
/* ==================== */

#loadingIndicator {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

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

/* ==================== */
/* Toast通知 */
/* ==================== */

#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  width: auto;
}

.animate-toast-in {
  animation: toast-in 0.3s ease-out;
}

.animate-toast-out {
  animation: toast-out 0.3s ease-in forwards;
}

@keyframes toast-in {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes toast-out {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

.toast-notification {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: #333;
  background-color: #fff;
  border-left: 5px solid #6c757d;
  pointer-events: auto;
}

.toast-notification.toast-success {
  border-left-color: #28a745;
}

.toast-notification.toast-error {
  border-left-color: #dc3545;
}

.toast-notification.toast-warning {
  border-left-color: #ffc107;
}

/* ==================== */
/* その他の必要なスタイル */
/* ==================== */

.shadow-md {
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.shadow-lg {
  box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
}

.shadow-2xl {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.rounded-full {
  border-radius: 9999px;
}

.rounded-lg {
  border-radius: 8px;
}

.rounded-md {
  border-radius: 6px;
}

/* ==================== */
/* 注意事項 */
/* ==================== */

/*
このstyle.cssはindex.htmlで使用されるグローバルスタイルのみを含みます。
各ページ固有のスタイルは、それぞれのページのCSSファイルに記述してください。

例:
- 党員名簿一覧のスタイル → pages/member/member.css
- 党員MAPのスタイル → pages/map/map.css
- ダッシュボードのスタイル → pages/dashboard/dashboard.css
*/
/* ============================ */
/* ハンバーガーメニューアニメーション */
/* ============================ */

.hamburger-menu {
  width: 28px;
  height: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  /* Reset button styles */
  background: transparent;
  border: none;
  padding: 0;
}

.hamburger-bar {
  width: 100%;
  height: 3px;
  background-color: #5f6368; /* Tailwind gray-600 */
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}

.hamburger-menu:hover .hamburger-bar {
  background-color: #0369a1; /* Tailwind primary-600 */
}

/* Animation to 'X' */
.hamburger-menu.open .hamburger-bar:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}

.hamburger-menu.open .hamburger-bar:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.open .hamburger-bar:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg);
}

/* ========================= */
/* Global Component Styles   */
/* ========================= */

/* App Logo */
#app-logo {
  font-family: 'Noto Serif JP', serif;
  font-weight: 900;
}

/* Page Titles */
.member-list-header h1,
.map-header h1,
.group-header h1,
.notification-header h1 {
    font-family: 'Noto Serif JP', serif;
    font-weight: 700;
    font-size: 26px; /* Slightly larger for a serif font */
    letter-spacing: 0.025em; /* Add some spacing */
}