/* ==========================================
   ICTスキルアップ・ポータル スタイルシート
   ========================================== */

:root {
  /* Colors */
  --bg-color: #f0f7f4;
  --primary-color: #4CAF50; /* 福祉・成長を連想させる爽やかなグリーン */
  --primary-light: #81C784;
  --primary-dark: #388E3C;
  --text-main: #333333;
  --text-sub: #666666;
  --white: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.3);
  
  /* Shadows & Layouts */
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
  --border-radius: 16px;
  --border-radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================
   共通設定
   ========================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'M PLUS Rounded 1c', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ==========================================
   背景装飾 (アブストラクトなシェイプ)
   ========================================== */
.bg-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.6;
}

.shape-1 {
  width: 400px;
  height: 400px;
  background: #a5d6a7;
  top: -100px;
  right: -100px;
}

.shape-2 {
  width: 300px;
  height: 300px;
  background: #fff59d;
  bottom: 20%;
  left: -50px;
}

.shape-3 {
  width: 250px;
  height: 250px;
  background: #bbdefb;
  bottom: -50px;
  right: 15%;
}

/* ==========================================
   レイアウトコンテナ
   ========================================== */
.app-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
}

/* ==========================================
   Glassmorphism ヘッダー
   ========================================== */
.glass-header {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px 28px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 16px;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 28px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.5px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.progress-badge {
  background: rgba(76, 175, 80, 0.1);
  color: var(--primary-dark);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}

.avatar {
  width: 44px;
  height: 44px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

/* ==========================================
   プログレスバー
   ========================================== */
.progress-bar-container {
  height: 8px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%; 
  background: linear-gradient(90deg, var(--primary-color), #2E7D32);
  border-radius: 4px;
  transition: width 0.8s ease-in-out;
}

/* ==========================================
   メインコンテンツ
   ========================================== */
.welcome-section {
  text-align: center;
  padding: 40px 20px;
  margin-bottom: 32px;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.welcome-section h2 {
  font-size: 26px;
  color: var(--primary-dark);
  margin-bottom: 12px;
}

.welcome-section p {
  color: var(--text-sub);
  font-size: 16px;
}

/* ==========================================
   カリキュラムグリッド
   ========================================== */
.curriculum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding-bottom: 60px;
}

/* カリキュラムカード */
.task-card {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.task-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: rgba(76, 175, 80, 0.2);
}

.task-card.completed {
  background: #f8fbf8;
  border-color: rgba(76, 175, 80, 0.4);
}

/* カードヘッダー */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.day-badge {
  background: var(--primary-color);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.task-card.completed .day-badge {
  background: var(--primary-dark);
}

.category-icon {
  width: 32px;
  height: 32px;
  background: #e8f5e9;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* カードボディ */
.task-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.task-desc {
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 24px;
  flex-grow: 1;
}

/* アクションボタン */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-start {
  background: var(--white);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

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

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

.btn-complete:hover {
  background: var(--primary-dark);
}

.btn-completed {
  background: #E0E0E0;
  color: #757575;
  cursor: default;
}

/* 完了マークのアニメーション */
.check-mark {
  position: absolute;
  top: 10px;
  right: -50px;
  font-size: 100px;
  color: rgba(76, 175, 80, 0.1);
  transform: rotate(15deg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.task-card.completed .check-mark {
  opacity: 1;
}

/* ローディングスピナー */
.loading-spinner {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: var(--text-sub);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(76, 175, 80, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

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

/* ==========================================
   モーダル (課題内容表示用)
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  position: relative;
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.modal-overlay.hidden .modal-content {
  transform: translateY(20px);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  color: var(--text-sub);
}

.modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-main);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--glass-border);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: flex-end;
}

/* モーダル内のコンテンツ書式 */
.modal-body h3 {
  font-size: 18px;
  color: var(--primary-dark);
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(76, 175, 80, 0.2);
}
.modal-body h3:first-child { margin-top: 0; }
.modal-body h4 { font-size: 16px; margin: 16px 0 8px; color: var(--text-main); }
.modal-body p { margin-bottom: 16px; }
.modal-body hr { border: none; border-top: 1px dashed #ccc; margin: 24px 0; }
.target-box { background: #e8f5e9; padding: 12px 16px; border-radius: 8px; font-weight: 600; color: #2E7D32; margin-bottom: 20px; }
.code-block { background: #f5f5f5; padding: 16px; border-radius: 8px; font-family: monospace; margin-bottom: 16px; overflow-x: auto; white-space: pre-wrap; border: 1px solid #ddd; }
.data-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; table-layout: fixed; }
.data-table td { border: 1px solid #ddd; padding: 8px 12px; }
.data-table tr:nth-child(even) { background-color: #fcfcfc; }
.list-item { margin-bottom: 8px; padding-left: 8px; border-left: 3px solid var(--primary-light); }

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .app-container {
    padding: 16px;
  }
  
  .glass-header {
    padding: 16px;
    border-radius: 16px;
  }
  
  h1 { margin-top:-5px; font-size: 20px; }
  
  .curriculum-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
