/* お問い合わせモーダル */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 30px;
  border: none;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  position: relative;
  animation: fadeIn 0.3s ease-out;
  line-height: 1.6;
}

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

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  position: absolute;
  right: 15px;
  top: 10px;
  cursor: pointer;
  transition: color 0.2s ease;
}

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

.modal h2 {
  color: #333;
  font-size: 1.5rem;
  margin-bottom: 20px;
  text-align: center;
  border-bottom: 2px solid #007bff;
  padding-bottom: 10px;
}

.contact-info {
  text-align: center;
  color: #495057;
}

.contact-info p {
  margin-bottom: 15px;
  font-size: 1rem;
}

.email-address {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #007bff;
  margin: 20px 0;
}

.email-address strong {
  font-size: 1.1rem;
  color: #007bff;
  word-break: break-all;
  display: inline-block;
}

.contact-note {
  font-size: 0.9rem;
  color: #6c757d;
  margin-top: 20px;
  padding: 15px;
  background-color: #fff3cd;
  border-radius: 6px;
  border-left: 4px solid #ffc107;
  line-height: 1.5;
}

/* 画像拡大モーダル */
.image-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  animation: fadeIn 0.3s ease;
}

.image-modal-content {
  position: relative;
  max-width: 80%;
  max-height: 80%;
  margin: auto;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
}

.image-modal img {
  max-width: 100%;
  max-height: 100vh;
  object-fit: contain;
  border-radius: 8px;
}

.image-modal-close {
  position: absolute;
  top: 10px;
  right: 25px;
  color: white;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
}

.image-modal-close:hover,
.image-modal-close:focus {
  color: #ccc;
}

/* 削除キー表示モーダル */
.delete-key-modal {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.delete-key-modal.modal-hidden {
  display: none !important;
}

.delete-key-modal-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.delete-key-title {
  color: #333;
  margin-bottom: 20px;
  font-size: 24px;
}

.delete-key-display {
  background: #f8f9fa;
  border: 2px solid #333;
  padding: 20px;
  border-radius: 4px;
  margin: 20px 0;
}

.delete-key-label {
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 10px;
}

.delete-key-value {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  letter-spacing: 2px;
  word-break: break-all;
}

.delete-key-copy-btn {
  background: #007bff;
  color: white;
  padding: 12px 20px;
  margin: 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

.delete-key-warning {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  padding: 15px;
  border-radius: 4px;
  margin: 20px 0;
  text-align: left;
}

.delete-key-warning-text {
  margin: 0;
  color: #856404;
  font-size: 14px;
  line-height: 1.5;
}

.delete-key-close-btn {
  background: #6c757d;
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

/* 通報モーダル */
.report-modal {
  display: none;
}

.report-modal-content {
  background: white;
  border-radius: 8px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
}

.report-modal-close {
  color: #333;
  cursor: pointer;
  font-size: 24px;
  position: absolute;
  right: 15px;
  top: 10px;
}

.report-modal-title {
  margin-bottom: 20px;
  color: #333;
}

.report-modal-textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: vertical;
}

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

/* ルール表示モーダル */
.rules-modal {
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.rules-modal-content {
  background: white;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
}

.rules-modal-header {
  background: #153D4C;
  color: white;
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
}

.rules-modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: bold;
  color: white;
}

.rules-modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.rules-content h3 {
  color: #333;
  margin: 20px 0 10px 0;
  font-size: 18px;
  border-bottom: 2px solid #153D4C;
  padding-bottom: 5px;
}

.rules-content h3:first-child {
  margin-top: 0;
}

.rules-content p {
  margin: 10px 0;
  line-height: 1.6;
  color: #555;
}

.rules-content ul {
  margin: 10px 0;
  padding-left: 20px;
}

.rules-content li {
  margin: 8px 0;
  line-height: 1.5;
  color: #555;
}

.rules-modal-footer {
  padding: 20px;
  text-align: center;
  border-top: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.rules-modal-footer .btn {
  padding: 12px 30px;
  font-size: 16px;
  font-weight: bold;
  min-width: 120px;
  background: #153D4C;
}

.rules-modal-close-btn:hover {
  background: #153D4C !important;
}

.rules-modal-footer .btn:hover {
  background: #0f2a35;
}

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

/* 削除確認モーダル */
.delete-modal {
  display: none;
}

.delete-modal-content {
  background: white;
  border-radius: 8px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
}

.delete-modal-close {
  color: #333;
}

.delete-modal-title {
  margin-bottom: 20px;
  color: #333;
}

.delete-modal-message {
  margin-bottom: 20px;
  color: #666;
}

.delete-modal-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: monospace;
}

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

/* Cookie同意バナー */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.95);
  color: white;
  z-index: 1001;
  padding: 15px 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
}

.cookie-text {
  flex: 1;
  min-width: 300px;
}

.cookie-text p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.cookie-text p:first-child {
  margin-bottom: 5px;
}

.cookie-buttons {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.accept-btn {
  background-color: #28a745;
  color: white;
}

.accept-btn:hover {
  background-color: #218838;
}

.decline-btn {
  background-color: #6c757d;
  color: white;
}

.decline-btn:hover {
  background-color: #5a6268;
}

.settings-btn {
  background-color: #17a2b8;
  color: white;
}

.settings-btn:hover {
  background-color: #138496;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .modal-content {
    margin: 100px auto;
    padding: 20px;
    width: 85%;
  }

  .modal h2 {
    font-size: 1.3rem;
  }

  .email-address strong {
    font-size: 1rem;
  }

  .contact-info p {
    font-size: 0.95rem;
  }

  .cookie-banner-content {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .cookie-text {
    min-width: auto;
  }

  .cookie-text p {
    font-size: 0.85rem;
  }

  .cookie-buttons {
    justify-content: center;
  }

  .cookie-btn {
    padding: 10px 25px;
    font-size: 0.9rem;
  }

  /* 画像拡大モーダルの調整 */
  .image-modal-content {
    max-width: 98% !important;
    max-height: 95% !important;
    padding: 5px !important;
    margin: 5px auto !important;
  }

  .image-modal-close {
    font-size: 30px;
    top: 5px;
    right: 15px;
  }

  .image-modal img {
    max-width: 100% !important;
    max-height: 90vh !important;
  }

  /* ルールモーダルの調整 */
  .rules-modal-content {
    width: 95%;
    max-height: 85vh;
  }
  
  .rules-modal-header {
    padding: 15px;
  }
  
  .rules-modal-header h2 {
    font-size: 20px;
  }
  
  .rules-modal-body {
    padding: 15px;
    max-height: 65vh;
  }
  
  .rules-content h3 {
    font-size: 16px;
  }
  
  .rules-modal-footer {
    padding: 15px;
  }
  
  .rules-modal-footer .btn {
    padding: 10px 25px;
    font-size: 15px;
    min-width: 100px;
  }
}

@media (max-width: 480px) {
  .cookie-banner {
    padding: 12px 0;
  }

  .cookie-banner-content {
    padding: 0 15px;
  }

  .cookie-text p {
    font-size: 0.8rem;
  }

  .cookie-btn {
    padding: 8px 20px;
    font-size: 0.85rem;
  }

  /* より小さな画面での画像拡大モーダル調整 */
  .image-modal-content {
    max-width: 99% !important;
    max-height: 98% !important;
    padding: 2px !important;
    margin: 2px auto !important;
  }

  .image-modal-close {
    font-size: 28px;
    top: 3px;
    right: 10px;
  }

  .image-modal img {
    max-width: 100% !important;
    max-height: 95vh !important;
  }

  /* より小さな画面でのルールモーダル調整 */
  .rules-modal-content {
    width: 98%;
    max-height: 90vh;
  }
  
  .rules-modal-header {
    padding: 12px;
  }
  
  .rules-modal-header h2 {
    font-size: 18px;
  }
  
  .rules-modal-body {
    padding: 12px;
    max-height: 70vh;
  }
  
  .rules-content h3 {
    font-size: 15px;
  }
  
  .rules-modal-footer {
    padding: 12px;
  }
  
  .rules-modal-footer .btn {
    padding: 8px 20px;
    font-size: 14px;
    min-width: 80px;
  }
}
