/* util.css - 共通ユーティリティスタイル */

/* ダイアログ基本スタイル */
dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  border: none;
  border-radius: 8px;
  padding: 0;
  background-color: #ffffff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 90%;
  margin: 20px auto;
  width: 95%;
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  /*backdrop-filter: blur(2px);*/
}

/* アラートダイアログ */
#error-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0; /* パディングを0にしてヘッダーを配置しやすくする */
  min-width: none;
  max-width: 500px;
  background: white;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 90%;
}
/* backdrop（背景オーバーレイ）のスタイル */
#error-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  /*backdrop-filter: blur(2px);*/
}
/* ダイアログヘッダー */
.dialog-header {
  padding: 12px 20px;
  border-radius: 8px 8px 0 0;
  font-weight: 500;
  color: white;
}
/* ダイアログタイプ別のヘッダースタイル */
.dialog-error .dialog-header {
  background-color: #f44336; /* エラー：赤 */
}

.dialog-warning .dialog-header {
  background-color: orange; /* 警告：オレンジ */
}

.dialog-success .dialog-header {
  background-color: #2196f3; /* 成功：青 */
}

.dialog-info .dialog-header {
  background-color: #757575; /* 情報：グレー */
}

/* ダイアログコンテンツ */
.dialog-content {
  padding: 20px;
}

/* ダイアログメッセージ */
.dialog-message {
  margin: 0 0 20px 0;
  line-height: 1.5;
  color: #333;
}

/* ボタンコンテナ */
.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  padding: 0 20px 20px 20px;
}

/* OKボタン */
.dialog-button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background-color: #2196f3;
  color: white;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.dialog-button:hover {
  background-color: #1976d2;
}

/* confirmダイアログ用の追加スタイル */
.dialog-confirm .dialog-header {
  background-color: #607d8b; /* 確認用：落ち着いたブルーグレー */
}

/* confirmダイアログのボタンコンテナ */
.dialog-buttons.confirm-buttons {
  justify-content: flex-end;
  gap: 12px; /* ボタン間の間隔 */
}

/* はいボタン */
.dialog-button.confirm-yes {
  background-color: #4caf50; /* 緑色 */
  color: white;
}

.dialog-button.confirm-yes:hover {
  background-color: #43a047;
}

/* いいえボタン */
.dialog-button.confirm-no {
  background-color: #757575; /* グレー */
  color: white;
}

.dialog-button.confirm-no:hover {
  background-color: #616161;
}

#error-dialog form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#error-dialog p {
  margin: 0;
  color: #333;
  font-size: 16px;
  line-height: 1.5;
}

/* アラートタイプ別スタイル */
.alert-info {
  border-left: 4px solid #2196f3;
}

.alert-error {
  border-left: 4px solid #f44336;
}

.alert-success {
  border-left: 4px solid #4caf50;
}

.alert-warning {
  border-left: 4px solid #ff9800;
}

/* ボタン基本スタイル */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s ease;
}

/* ボタンバリエーション */
.btn-primary {
  background-color: #2196f3;
  color: white;
}

.btn-primary:hover {
  background-color: #1976d2;
}

.btn-secondary {
  background-color: #757575;
  color: white;
}

.btn-secondary:hover {
  background-color: #616161;
}

.btn-success {
  background-color: #4caf50;
  color: white;
}

.btn-success:hover {
  background-color: #43a047;
}

.btn-danger {
  background-color: #f44336;
  color: white;
}

.btn-danger:hover {
  background-color: #d32f2f;
}

/* レイアウトユーティリティ */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.grid {
  display: grid;
}

/* マージン・パディングユーティリティ */
.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 1rem; }
.m-4 { margin: 1.5rem; }
.m-5 { margin: 3rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

/* テキストユーティリティ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-bold { font-weight: bold; }
.text-normal { font-weight: normal; }

.text-small { font-size: 0.875em; }
.text-large { font-size: 1.25em; }

/* 表示・非表示 */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

/* アニメーション */
.fade {
  transition: opacity 0.3s ease;
}

.fade-enter {
  opacity: 0;
}

.fade-enter-active {
  opacity: 1;
}

/* ローディングスピナー */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #2196f3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* スクロールバーカスタマイズ */
.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: #bdbdbd transparent;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: #bdbdbd;
  border-radius: 4px;
}

/* アクセシビリティ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
