/* 共通: practice 問題ページ用 基本スタイル */

/* カード系 */
.problem-card {
  margin-bottom: 20px;
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.problem-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.explanation-card {
  display: none;
  margin-top: 20px;
  margin-bottom: 20px;
  background-color: #f8f9fa;
}

.explanation-card .card-header {
  background-color: #e9ecef;
  color: #495057;
}

/* 解説本文（共通タイポ・情報ブロック） */
.explanation-text {
  line-height: 1.7;
  font-size: 1.02rem;
  color: #333;
  padding: 12px;
}

.explanation-text p {
  margin: 0.6rem 0;
}

.explanation-text .step {
  background: #f6fafe;
  border-left: 4px solid #2b6cb0;
  padding: 0.5rem 0.75rem;
  margin: 0.8rem 0 0.4rem;
  font-weight: 600;
  color: #244f90;
}

/* 数式: デフォルトは枠なし（統一方針） */
.explanation-text .formula {
  margin: 0.6rem 0;
  padding: 0;
  background: transparent;
  border: none;
  text-align: center;
}

/* 枠付き数式を使いたい時のみオプトイン */
.explanation-text .formula-box {
  background: #fff;
  border: 1px solid #e3eefb;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
}

.explanation-text .key-point {
  background: linear-gradient(135deg, #eef5fd 0%, #e7f0fb 100%);
  border: 1px solid #d6e6fb;
  border-left: 4px solid #2b6cb0;
  border-radius: 6px;
  padding: 0.8rem 0.9rem;
  margin: 1rem 0;
}

.explanation-text .key-point-title {
  font-weight: 700;
  color: #244f90;
  margin-bottom: 0.4rem;
}

.explanation-text .note {
  background: #fff8e6;
  border: 1px solid #ffe8b2;
  border-left: 4px solid #ffc107;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  margin: 0.8rem 0;
}

/* 同一セクション問題のハイライト（共通） */
.problem-item.current-problem {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-color: #2196f3;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.problem-item.current-problem .problem-level {
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
  color: #fff;
}

.current-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #4caf50;
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.problem-navigation {
  margin: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.level-badge {
  margin-left: 10px;
  padding: 0.5em 0.7em;
  font-size: 0.85rem;
}

/* ローディングUI（practice-common.js と連携） */
.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #2196f3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.fullscreen-loader {
  position: fixed;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.fullscreen-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.fullscreen-loader .loading-spinner {
  width: 80px;
  height: 80px;
  border-width: 8px;
}

.loading-message {
  margin-top: 20px;
  font-size: 1.1rem;
  color: #2196f3;
  font-weight: 500;
  text-align: center;
}

.loading-progress {
  margin-top: 15px;
  width: 300px;
  max-width: 80%;
  height: 8px;
  background-color: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  background: linear-gradient(to right, #2196f3, #0d47a1);
  width: 0%;
  transition: width 0.3s ease;
}

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

/* モバイル調整 */
@media (max-width: 767.98px) {
  .explanation-text {
    font-size: 0.92rem !important;
    line-height: 1.6 !important;
    padding: 12px !important;
  }
  .explanation-text p { margin-bottom: 12px !important; }
  .explanation-text .step { font-size: 0.95rem !important; margin-top: 14px !important; }
  .explanation-text .note { font-size: 0.88rem !important; padding: 8px !important; margin: 12px 0 !important; }
  .explanation-text .formula { font-size: 0.9rem !important; margin: 12px 0 !important; }
  .current-indicator { font-size: 0.6rem; padding: 1px 4px; top: 6px; right: 6px; }
}

