/* モーダル関連スタイル - modal.css */

/* 基本モーダルスタイル */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: none;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  margin-top: -5px;
}

.modal-close:hover,
.modal-close:focus {
  color: #000;
  text-decoration: none;
}

.modal h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #333;
  font-size: 20px;
}

.modal p {
  margin-bottom: 20px;
  line-height: 1.5;
  color: #666;
}

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

.modal-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.modal-buttons button:first-child {
  background-color: #4CAF50;
  color: white;
}

.modal-buttons button:first-child:hover {
  background-color: #45a049;
}

.modal-buttons button:last-child {
  background-color: #2196F3;
  color: white;
}

.modal-buttons button:last-child:hover {
  background-color: #0b7dda;
}

/* 確認モーダル */
.confirm-modal .modal-buttons button:first-child {
  background-color: #f44336;
}

.confirm-modal .modal-buttons button:first-child:hover {
  background-color: #da190b;
}

.confirm-modal .modal-buttons button:last-child {
  background-color: #757575;
}

.confirm-modal .modal-buttons button:last-child:hover {
  background-color: #616161;
}

/* 情報モーダル */
.info-modal .modal-content {
  border-left: 4px solid #2196F3;
}

.info-modal h3 {
  color: #2196F3;
}

/* 警告モーダル */
.warning-modal .modal-content {
  border-left: 4px solid #ff9800;
}

.warning-modal h3 {
  color: #ff9800;
}

/* エラーモーダル */
.error-modal .modal-content {
  border-left: 4px solid #f44336;
}

.error-modal h3 {
  color: #f44336;
}

/* 成功モーダル */
.success-modal .modal-content {
  border-left: 4px solid #4caf50;
}

.success-modal h3 {
  color: #4caf50;
}

/* 大きなモーダル */
.modal-large .modal-content {
  max-width: 800px;
  width: 95%;
}

/* 小さなモーダル */
.modal-small .modal-content {
  max-width: 350px;
}

/* フルスクリーンモーダル */
.modal-fullscreen .modal-content {
  margin: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ショップリンクモーダル専用スタイル */
#shop-link-modal {
  z-index: 2100;
}

#shop-link-modal .modal-content {
  max-width: 450px;
}

#shop-link-modal h3 {
  color: #ff9800;
  margin-bottom: 10px;
}

#shop-link-modal p {
  font-size: 14px;
  margin-bottom: 20px;
  background-color: #fff3cd;
  border: 1px solid #ffeeba;
  padding: 10px;
  border-radius: 4px;
  color: #856404;
}

/* モーダル内のフォーム要素 */
.modal input,
.modal textarea,
.modal select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 15px;
  box-sizing: border-box;
}

.modal input:focus,
.modal textarea:focus,
.modal select:focus {
  outline: none;
  border-color: #2196F3;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.modal label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

/* モーダル内のローディング */
.modal-loading {
  text-align: center;
  padding: 40px 20px;
}

.modal-loading .loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #2196F3;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

/* スマホビュー調整 */
@media screen and (max-width: 500px) {
  .modal-content {
    margin: 10% auto;
    width: 95%;
    padding: 15px;
  }
  
  .modal h3 {
    font-size: 18px;
  }
  
  .modal p {
    font-size: 13px;
  }
  
  .modal-buttons {
    flex-direction: column;
    gap: 8px;
  }
  
  .modal-buttons button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
  }
  
  /* フルスクリーンモーダルはスマホでは少し余白を残す */
  .modal-fullscreen .modal-content {
    margin: 20px;
    width: calc(100% - 40px);
    height: calc(100% - 40px);
    border-radius: 8px;
  }
  
  /* ショップリンクモーダルの調整 */
  #shop-link-modal .modal-content {
    margin: 20% auto;
  }
  
  #shop-link-modal p {
    font-size: 12px;
    padding: 8px;
  }
}