/**
 * メインスタイルシート（軽量化版）
 * 臨地実習における情報モラル学習システム
 *
 * 注意：CSS変数はvariables.cssから読み込まれます
 */

/* ===========================
   ベーススタイル（Tailwindと共存用）
   =========================== */
/* フォント指定（管理者ページ用） */
html,
html body,
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic",
    "Meiryo", sans-serif !important;
}

/* グローバルリセットは削除（Tailwindが提供） */

/* リンクのデフォルトスタイル */
a.custom-link {
  color: var(--medical-blue);
  text-decoration: none;
  transition: color 0.3s ease;
}

a.custom-link:hover {
  color: var(--medical-dark);
}

/* ナビゲーションリンクの反応性向上 */
.nav-link {
  transition: all 0.15s ease-out;
  position: relative;
}

.nav-link:hover {
  transform: translateY(-1px);
  color: var(--medical-blue);
}

.nav-link:active {
  transform: translateY(0);
  transition-duration: 0.05s;
}

/* アンカーリンクの視覚的フィードバック */
a[href^="#"]:not(.btn) {
  transition: all 0.15s ease-out;
}

a[href^="#"]:not(.btn):hover {
  opacity: 0.8;
}

a[href^="#"]:not(.btn):active {
  opacity: 0.6;
  transform: scale(0.98);
}

/* ===========================
   カスタムユーティリティクラス
   =========================== */
.custom-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* margin/paddingクラスはTailwindを使用するため削除 */

/* ===========================
   コンポーネント - ボタン
   =========================== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--medical-blue);
  color: white;
}

.btn-primary:hover {
  background-color: var(--medical-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background-color: transparent;
  color: var(--medical-blue);
  border: 2px solid var(--medical-blue);
}

.btn-outline:hover {
  background-color: var(--medical-blue);
  color: white;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* ===========================
   ヘッダー
   =========================== */
.header {
  background-color: white;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--medical-blue);
  transition: opacity 0.3s ease;
}

.logo:hover {
  opacity: 0.7;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  color: var(--gray-600);
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--medical-blue);
}

/* ===========================
   ヒーローセクション
   =========================== */
.hero {
  background: linear-gradient(135deg, var(--medical-light) 0%, white 100%);
  padding: 4rem 0;
}

.hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-title .highlight {
  color: var(--medical-blue);
  position: relative;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--gray-700);
  margin-bottom: 2rem;
  line-height: 1.8;
}

/* ===========================
   動画プレビュー
   =========================== */
.video-preview {
  margin: 3rem 0;
  padding: 2rem;
  background: white;
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-md);
}

.video-preview-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 アスペクト比 */
  height: 0;
  overflow: hidden;
  border-radius: var(--border-radius-lg);
  background: var(--gray-900);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-caption {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--gray-600);
  text-align: center;
}

/* ===========================
   ヒーローアクション
   =========================== */
.hero-actions {
  margin-top: 2rem;
}

.hero-note {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
  line-height: 1.8;
}

/* ===========================
   セクション共通
   =========================== */
section {
  padding: 4rem 0;
}

.section-title {
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--gray-900);
}

.section-description {
  text-align: center;
  font-size: 1.125rem;
  color: var(--gray-600);
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===========================
   About セクション
   =========================== */
.about {
  background-color: white;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.about-item {
  text-align: center;
  padding: 2rem;
}

.about-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.about-item h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--gray-900);
}

.about-item p {
  color: var(--gray-600);
  line-height: 1.8;
}

/* ===========================
   コンテンツカード
   =========================== */
.contents {
  display: block !important; /* Tailwind の display: contents を上書き */
  background-color: var(--gray-100);
  padding: 4rem 0; /* 適切な余白を追加 */
}

.contents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.content-card {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.content-number {
  display: inline-block;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background: var(--medical-blue);
  color: white;
  border-radius: 50%;
  font-weight: bold;
  margin-bottom: 1rem;
}

.content-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--gray-900);
}

.content-card p {
  color: var(--gray-600);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.content-card ul {
  list-style: none;
  padding-left: 0;
}

.content-card li {
  padding: 0.5rem 0;
  color: var(--gray-700);
  padding-left: 1.5rem;
  position: relative;
}

.content-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success-green);
  font-weight: bold;
}

/* ===========================
   クイズ情報
   =========================== */
.quiz-info {
  background: linear-gradient(
    135deg,
    var(--medical-blue),
    var(--medical-accent)
  );
  color: white;
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  display: flex;
  align-items: center;
  gap: 2rem;
}

.quiz-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.quiz-info h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.quiz-info p {
  opacity: 0.95;
  line-height: 1.6;
}

/* ===========================
   関連教材セクション
   =========================== */
.related-materials {
  background-color: var(--gray-100);
  padding: 4rem 0;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.product-card {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--gray-200);
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.product-image {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 100%; /* 正方形のアスペクト比 1:1 */
  overflow: hidden;
  background-color: #f8f9fa;
}

.product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* 画像全体を表示、正方形に合わせる */
  transition: transform 0.3s ease;
}

.product-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--medical-blue);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 600;
}

.product-featured {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--warning-yellow);
  color: var(--gray-900);
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 600;
}

.product-info {
  padding: 1.5rem;
}

.product-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  color: var(--gray-900);
}

.product-price {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--medical-blue);
  margin-bottom: 1rem;
}

.product-description {
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.materials-note {
  background: white;
  border: 1px solid var(--medical-blue);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  text-align: center;
}

.materials-note strong {
  color: var(--medical-blue);
  font-size: 1.125rem;
}

.materials-note p {
  margin-bottom: 0.5rem;
}

.materials-note small {
  color: var(--gray-500);
  font-size: 0.75rem;
}

/* ===========================
   価格セクション
   =========================== */
.pricing {
  background-color: white;
}

.pricing-card {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  border: 2px solid var(--medical-blue);
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.pricing-header {
  background: var(--medical-blue);
  color: white;
  padding: 2rem;
  text-align: center;
  position: relative;
}

.pricing-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--warning-yellow);
  color: var(--gray-900);
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: bold;
}

.pricing-header h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.pricing-price {
  margin-top: 1rem;
}

.price-amount {
  font-size: 3rem;
  font-weight: bold;
}

.price-note {
  display: block;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  opacity: 0.9;
}

.pricing-features {
  padding: 2rem;
}

.feature-item {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-700);
}

.feature-item:last-child {
  border-bottom: none;
}

.pricing-action {
  padding: 2rem;
  text-align: center;
  background: var(--gray-100);
}

.pricing-note {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* 団体プラン専用スタイル */
.pricing-card.group-plan {
  border-color: var(--success-green);
  margin-top: 2rem;
}

.pricing-card.group-plan .pricing-header {
  background: linear-gradient(135deg, var(--success-green), #45a049);
}

.group-badge {
  background: var(--warning-yellow);
  color: var(--gray-900);
}

.price-comparison {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
}

.savings {
  color: var(--warning-yellow);
  font-weight: bold;
}

.group-info {
  padding: 1.5rem 2rem;
  background: #f8f9fa;
  border-top: 1px solid var(--gray-200);
}

.group-info h4 {
  margin-bottom: 1rem;
  color: var(--gray-900);
  font-size: 1rem;
}

.group-info ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.group-info li {
  padding: 0.5rem 0;
  color: var(--gray-700);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.group-info li:last-child {
  border-bottom: none;
}

.group-info li:before {
  content: "🏫 ";
  margin-right: 0.5rem;
}

/* ===========================
   監修者セクション
   =========================== */
.authority {
  background-color: white;
  padding: 4rem 0;
}

.authority-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.authority-card {
  background: var(--gray-100);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  text-align: center;
  border: 1px solid var(--gray-200);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.authority-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.authority-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.authority-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--medical-blue);
}

.authority-card p {
  color: var(--gray-700);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.authority-card strong {
  color: var(--gray-900);
  font-weight: 600;
}

.certification-note {
  background: linear-gradient(135deg, var(--medical-light), white);
  border: 1px solid var(--medical-blue);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  text-align: center;
}

.certification-note h4 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--medical-blue);
}

.certification-note p {
  color: var(--gray-700);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.certification-note small {
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* ===========================
   信頼指標
   =========================== */
.trust-indicators {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--gray-200);
}

.trust-item {
  text-align: center;
}

.trust-item strong {
  display: block;
  font-size: 1.125rem;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.trust-item p {
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* ===========================
   フッター
   =========================== */
.footer {
  background: var(--gray-900);
  color: white;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-info h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.footer-info p {
  color: var(--gray-400);
  line-height: 1.8;
}

.footer-links h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--gray-400);
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: white;
}

.footer-contact h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.footer-contact p {
  color: var(--gray-400);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-700);
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* ===========================
   レスポンシブデザイン
   =========================== */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .nav {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .contents-grid {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .quiz-info {
    flex-direction: column;
    text-align: center;
  }

  .trust-indicators {
    grid-template-columns: 1fr;
  }

  .video-wrapper {
    padding-bottom: 75%; /* モバイルでは少し高めのアスペクト比 */
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.75rem;
  }

  .btn-large {
    width: 100%;
    display: block;
  }

  .pricing-price .price-amount {
    font-size: 2rem;
  }
}

/* ===========================
   アニメーション
   =========================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* ===========================
   ローディング
   =========================== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--gray-300);
  border-radius: 50%;
  border-top-color: var(--medical-blue);
  animation: spin 1s ease-in-out infinite;
}

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

/* ===========================
   アラート
   =========================== */
.alert-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
}

.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.alert.alert-show {
  opacity: 1;
  transform: translateX(0);
}

.alert.alert-hide {
  opacity: 0;
  transform: translateX(100%);
}

.alert-success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.alert-error {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.alert-warning {
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
}

.alert-info {
  background-color: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
}

.alert-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  margin-left: 1rem;
  padding: 0;
  line-height: 1;
}

.alert-close:hover {
  opacity: 1;
}

/* ===========================
   進捗バー
   =========================== */
.progress {
  width: 100%;
  height: 8px;
  background-color: var(--gray-200);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--medical-blue);
  transition: width 0.3s ease;
  border-radius: var(--border-radius);
}

.progress-text {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-top: 0.25rem;
}

/* ===========================
   フォームエラー
   =========================== */
.form-control.error {
  border-color: var(--danger-red);
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.error:focus {
  border-color: var(--danger-red);
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* ===========================
   クイズ機能
   =========================== */
.quiz-overview {
  padding: 4rem 0;
  background-color: var(--gray-100);
}

.page-title {
  font-size: 2.5rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--gray-900);
}

.page-description {
  text-align: center;
  font-size: 1.125rem;
  color: var(--gray-600);
  margin-bottom: 3rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.user-status {
  margin-bottom: 3rem;
}

.status-card {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
  max-width: 600px;
  margin: 0 auto;
}

.status-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.status-info h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--gray-900);
}

.status-info p {
  margin-bottom: 0.5rem;
  color: var(--gray-600);
}

.score-highlight {
  color: var(--medical-blue);
  font-weight: bold;
  font-size: 1.125rem;
}

.pass-badge {
  display: inline-block;
  background: var(--success-green);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.quiz-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--medical-blue);
  display: block;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--gray-600);
  font-size: 0.875rem;
}

.quiz-actions {
  text-align: center;
  margin-bottom: 3rem;
}

.quiz-note {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
  line-height: 1.6;
}

.quiz-history {
  padding: 4rem 0;
  background-color: white;
}

.history-table-container {
  overflow-x: auto;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.history-table th,
.history-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.history-table th {
  background: var(--gray-100);
  font-weight: 600;
  color: var(--gray-900);
}

.score-cell {
  text-align: center;
}

.score-percentage {
  font-weight: bold;
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius);
}

.score-percentage.passed {
  background: var(--success-green);
  color: white;
}

.score-percentage.failed {
  background: var(--danger-red);
  color: white;
}

.result-badge {
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 600;
}

.result-badge.passed {
  background: #d4edda;
  color: #155724;
}

.result-badge.failed {
  background: #f8d7da;
  color: #721c24;
}

.quiz-guidelines {
  padding: 4rem 0;
  background-color: var(--gray-100);
}

.guidelines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.guideline-card {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.guideline-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.guideline-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--medical-blue);
}

.guideline-card ul {
  list-style: none;
  padding: 0;
}

.guideline-card li {
  padding: 0.5rem 0;
  color: var(--gray-700);
  padding-left: 1.5rem;
  position: relative;
}

.guideline-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success-green);
  font-weight: bold;
}

.quiz-container {
  padding: 2rem 0;
  background-color: white;
  min-height: 80vh;
}

.quiz-progress {
  margin-bottom: 3rem;
}

.quiz-progress .progress-bar {
  width: 100%;
  height: 10px;
  background-color: var(--gray-200);
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--medical-blue),
    var(--medical-accent)
  );
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  color: var(--gray-600);
  font-weight: 500;
}

.question-container {
  margin-bottom: 3rem;
}

.question-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  max-width: 800px;
  margin: 0 auto;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.question-category {
  background: var(--medical-blue);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 600;
}

.question-difficulty {
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 600;
}

.question-difficulty.basic {
  background: #d4edda;
  color: #155724;
}

.question-difficulty.intermediate {
  background: #fff3cd;
  color: #856404;
}

.question-difficulty.advanced {
  background: #f8d7da;
  color: #721c24;
}

.question-text {
  font-size: 1.25rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  color: var(--gray-900);
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.option-label {
  display: flex;
  align-items: flex-start;
  padding: 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--gray-50);
}

.option-label:hover {
  border-color: var(--medical-blue);
  background: var(--medical-light);
}

.option-input {
  margin-right: 1rem;
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.option-input:checked + .option-text {
  color: var(--medical-blue);
  font-weight: 600;
}

.option-label:has(.option-input:checked) {
  border-color: var(--medical-blue);
  background: var(--medical-light);
}

.option-text {
  line-height: 1.5;
  color: var(--gray-700);
}

.quiz-navigation {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding-top: 2rem;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: var(--border-radius-xl);
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  text-align: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 1rem;
}

.modal-header h2 {
  color: var(--gray-900);
  margin: 0;
}

.modal-body {
  margin-bottom: 2rem;
}

.modal-footer {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

.results-summary {
  text-align: center;
  margin-bottom: 2rem;
}

.result-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.result-icon.passed {
  color: var(--success-green);
}

.result-icon.failed {
  color: var(--warning-yellow);
}

.result-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--gray-900);
}

.score-display {
  margin-bottom: 1rem;
}

.score-number {
  font-size: 3rem;
  font-weight: bold;
  display: block;
  margin-bottom: 0.5rem;
}

.score-number.passed {
  color: var(--success-green);
}

.score-number.failed {
  color: var(--danger-red);
}

.score-detail {
  color: var(--gray-600);
  font-size: 1.125rem;
}

.results-details {
  background: var(--gray-100);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 600;
  color: var(--gray-700);
}

.detail-value {
  color: var(--gray-900);
}

.certificate-info,
.retry-info {
  background: linear-gradient(135deg, var(--medical-light), white);
  border: 1px solid var(--medical-blue);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  text-align: center;
}

.certificate-info p:first-child,
.retry-info p:first-child {
  color: var(--medical-blue);
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-300);
  border-top: 4px solid var(--medical-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

/* ===========================
   アニメーション - スクロール時
   =========================== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================
   印刷ボタン
   =========================== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.print-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .action-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }

  .action-buttons .btn {
    width: 100%;
  }
}

/* ===========================
   印刷用スタイル
   =========================== */
@media print {
  /* ページ設定 */
  @page {
    margin: 1cm;
    size: A4;
  }

  /* 印刷時に非表示にする要素 */
  .header,
  .nav,
  .btn,
  .quiz-actions,
  .action-buttons,
  .loading-overlay,
  .print-btn {
    display: none !important;
  }

  /* 印刷用のスタイル調整 */
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: white;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  /* クイズ結果の印刷用スタイル */
  .quiz-result-card {
    border: 2px solid #000;
    margin-bottom: 1cm;
    padding: 1cm;
    page-break-inside: avoid;
  }

  .score-display {
    font-size: 16pt;
    font-weight: bold;
  }

  .certificate-info {
    border: 2px solid #000;
    background: white;
    margin: 1cm 0;
    padding: 1cm;
    text-align: center;
  }

  .quiz-question {
    page-break-inside: avoid;
    margin-bottom: 0.5cm;
    padding: 0.5cm;
    border: 1px solid #ccc;
  }

  .question-title {
    font-weight: bold;
    margin-bottom: 0.3cm;
  }

  .answer-option {
    margin: 0.2cm 0;
  }

  .correct-answer {
    font-weight: bold;
    background: #f0f0f0;
  }

  .user-answer.incorrect {
    text-decoration: line-through;
    color: #666;
  }

  /* 改ページ制御 */
  .page-break-before {
    page-break-before: always;
  }

  .page-break-after {
    page-break-after: always;
  }
}

/* ===========================
   管理者ページ用スタイル
   =========================== */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.5;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--medical-dark);
  color: white;
}

.btn-secondary {
  background-color: var(--gray-500);
  color: white;
}

.btn-secondary:hover {
  background-color: var(--gray-600);
  color: white;
}

.btn-danger {
  background-color: var(--danger-red);
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
  color: white;
}

.btn-success {
  background-color: var(--success-green);
  color: white;
}

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

.btn-warning {
  background-color: var(--warning-color);
  color: var(--gray-900);
}

.btn-warning:hover {
  background-color: #e0a800;
  color: var(--gray-900);
}

.btn-info {
  background-color: var(--info-color);
  color: white;
}

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

.btn-outline {
  background-color: transparent;
  border: 1px solid currentColor;
  color: inherit;
}

.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: inherit;
}
/* Amazon商品リンクボタン */
.product-link {
  display: inline-block;
  background: linear-gradient(135deg, #ff9800, #ff5722);
  color: white !important;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 3px 10px rgba(255, 152, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.product-link::before {
  content: "🛒";
  margin-right: 8px;
}

.product-link:hover {
  background: linear-gradient(135deg, #f57c00, #d84315);
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 152, 0, 0.4);
}

.product-link:active {
  transform: translateY(0);
}

/* Amazon商品カード内のボタンスタイル調整 */
.product-card .product-link {
  width: 100%;
  margin-top: 12px;
}

/* Amazon商品カード */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.product-image {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 100%; /* 正方形のアスペクト比 1:1 */
  overflow: hidden;
  background-color: #f8f9fa;
}

.product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* 画像全体を表示、正方形に合わせる */
  transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--medical-blue);
  color: white;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
}

.product-featured {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #ff4444;
  color: white;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
}

.product-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-info {
  padding: 20px;
  flex: 1;
}

.product-action {
  padding: 0 20px 20px 20px;
  margin-top: auto;
  display: flex;
  justify-content: center;
}

.product-action .product-link {
  display: inline-block;
  width: auto;
  min-width: 160px;
  max-width: 200px;
  box-sizing: border-box;
  text-align: center;
}

.product-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
  line-height: 1.4;
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--medical-blue);
  margin-bottom: 12px;
}

.product-description {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 0;
}

/* 関連教材セクション */
.related-materials {
  background-color: #f8f9fa;
  padding: 60px 0;
}

.materials-note {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-top: 32px;
  border-left: 4px solid var(--medical-blue);
}

.materials-note p {
  margin-bottom: 12px;
}

.materials-note strong {
  color: var(--medical-blue);
}

.materials-note small {
  color: #666;
  font-size: 12px;
}

/* 正方形画像用の追加スタイル */
.product-card {
  max-width: 320px;
  margin: 0 auto;
}

.product-image {
  border-radius: 12px 12px 0 0;
}

/* モバイル表示での調整 */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
  }

  .product-card {
    max-width: 100%;
  }
}

/* ===========================
   管理者レイアウト
   =========================== */

/* 管理者ヘッダー */
.admin-header {
  background: var(--medical-blue);
  color: white;
  padding: 1rem 0;
  margin-bottom: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.admin-title {
  font-size: 1.5rem;
  font-weight: bold;
}

.admin-title a {
  color: white;
  text-decoration: none;
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-username {
  font-weight: 600;
}

.admin-role {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
}

/* 管理者メインレイアウト */
.admin-layout {
  display: flex;
  min-height: calc(100vh - 80px);
  background: var(--gray-100);
}

/* サイドバー */
.admin-sidebar {
  width: 280px;
  background: white;
  border-right: 1px solid var(--gray-200);
  padding: 2rem 0;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.sidebar-card {
  padding: 0 1.5rem;
}

.sidebar-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--medical-blue);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--gray-700);
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
  font-weight: 500;
}

.sidebar-item:hover {
  background: var(--gray-100);
  color: var(--medical-blue);
  transform: translateX(4px);
}

.sidebar-icon {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

.sidebar-label {
  flex: 1;
}

/* メインコンテンツエリア */
.admin-main {
  flex: 1;
  padding: 1rem;
  overflow-x: auto;
}

/* パンくずナビゲーション */
.breadcrumb {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 1rem 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.breadcrumb-nav a {
  color: var(--medical-blue);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb-nav a:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--gray-400);
  margin: 0 0.25rem;
}

.breadcrumb-nav span:last-child {
  color: var(--gray-600);
  font-weight: 600;
}

/* モバイル対応 */
@media (max-width: 1024px) {
  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    padding: 1rem 0;
  }

  .sidebar-menu {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1rem;
  }

  .sidebar-item {
    flex: 1;
    min-width: 120px;
    justify-content: center;
    text-align: center;
    padding: 0.5rem;
  }

  .admin-main {
    padding: 1rem;
  }
}

@media (max-width: 768px) {
  .admin-nav {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .admin-title {
    font-size: 1.25rem;
  }

  .sidebar-item {
    font-size: 0.875rem;
  }
}
