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

/* モーダル */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

/* モーダル背景 */
.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  cursor: pointer;
}

/* モーダルコンテンツ */
.modal-content {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 15px;
  max-width: 1100px;
  max-height: 80vh;
  width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  z-index: 10001;
  margin: 0 auto;
}

:root[data-theme="light"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.5);
}

:root[data-theme="light"] .modal-content {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* モーダルヘッダー */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px 16px 28px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
  line-height: 1;
}

.modal-close:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

/* モーダルボディ */
.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  flex-grow: 1;
}

/* ヘルプセクション */
.help-section {
  margin-bottom: 32px;
}

.help-section:last-child {
  margin-bottom: 0;
}

.help-section h3 {
  color: var(--accent);
  margin: 0 0 16px 0;
  font-size: 1.2rem;
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px;
}

.help-content h4 {
  color: var(--fg);
  margin: 16px 0 8px 0;
  font-size: 1rem;
  font-weight: 600;
}

.help-content p {
  color: var(--fg);
  line-height: 1.6;
  margin: 8px 0;
}

.help-content ul, .help-content ol {
  color: var(--fg);
  line-height: 1.6;
  margin: 12px 0;
  padding-left: 24px;
}

.help-content li {
  margin: 6px 0;
}

.help-content strong {
  color: var(--accent);
  font-weight: 600;
}

/* 警告ボックス（ヘルプ内） */
.help-content .warning-box {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-left: 4px solid var(--danger);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}

.help-content .warning-box p {
  margin: 8px 0;
}

.help-content .warning-box strong {
  color: var(--danger);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .modal-content {
    width: 95vw;
    max-height: 85vh;
  }
  
  .modal-header,
  .modal-body {
    padding: 20px;
  }
  
  .modal-header h2 {
    font-size: 1.2rem;
  }
  
  .help-section h3 {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .modal-header,
  .modal-body {
    padding: 16px;
  }
  
  .help-content ul, .help-content ol {
    padding-left: 20px;
  }
}