.loading-spinner {
  text-align: center;
  padding: 40px 0;
}

.loading-spinner::after {
  content: "";
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 4px solid #ccc;
  border-top-color: #333;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.wcat-btn-toggle.is-active {
  background-color: #444;
  color: #fff;
}

/* デフォルトではローダーとオーバーレイを非表示 */
.loader, .overlay {
    display: none;
}
/* body の id が "single" のときだけ表示 */
body#single .loader,
body#single .overlay {
    display: block;
}
/* ローダーのスタイル */
.loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #bc2420;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 9999;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* 画面全体を覆う背景（オーバーレイ） */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}
/* ページが読み込み中のときはスクロールを無効に */
body.loading {
    overflow: hidden;
}
.loader-ajax, .overlay-ajax {
  display: none;
}

/* Ajaxローダー */
.loader-ajax {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #bc2420;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 10001;
}

.overlay-ajax {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
  z-index: 10000;
}

/* 共通設定 */
#custom-success,
#custom-alert {
  position: fixed;
  right: -450px; 
  top: 20px;
  z-index: 99999;
  min-width: 320px;
  max-width: 400px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  padding: 1em;
  font-family: sans-serif;
  opacity: 0;
  transition: right 0.4s ease, opacity 0.4s ease;
}

/* 個別色設定 */
#custom-success {
  background: #198754; /* 緑 */
  color: white;
}

#custom-alert {
  background: #a51d2d; /* 赤 */
  color: white;
}

/* 表示状態 */
#custom-success.show,
#custom-alert.show {
  right: 20px;
  opacity: 1;
}

/* レイアウト */
.custom-success-inner,
.custom-alert-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.custom-success-content,
.custom-alert-content {
  flex: 1;
}

#success-title,
#alert-title {
  font-weight: bold;
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
}

#success-message,
#alert-message {
  font-size: 0.9rem;
}

.custom-success-close,
.custom-alert-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
}


@media screen and (max-width: 719px) {
  .ui-dialog {
    width: 100% !important;
  }
}