/**
 * dashboard.css - 개인화된 대시보드 스타일
 */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.dashboard-card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid rgba(0,0,0,0.05);
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.card-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-header i {
  color: #667eea;
}

/* 사용자 현황 카드 */
.user-overview .user-stats {
  padding: 1.5rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  font-size: 1rem;
}

.stat-icon.level-1 { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.level-2 { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat-icon.level-3 { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.stat-icon.level-4 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.level-5 { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-icon.level-6 { background: linear-gradient(135deg, #667eea, #764ba2); }

.stat-content .stat-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.2rem;
}

.stat-content .stat-subtitle {
  color: #64748b;
  font-size: 1rem; /* iOS zoom fix */
}

.progress-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.progress-item {
  text-align: center;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 0.8rem;
  border: 1px solid #e2e8f0;
}

.progress-item span {
  display: block;
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 0.5rem;
}

.progress-item strong {
  font-size: 1.1rem;
  color: #1e293b;
}

/* 주간 진행도 차트 */
.weekly-chart {
  padding: 1.5rem;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.5rem;
  height: 150px;
}

.chart-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.bar {
  background: linear-gradient(to top, #667eea, #764ba2);
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: all 0.5s ease;
  transform-origin: bottom;
  transform: scaleY(0);
  position: relative;
  margin-bottom: 0.5rem;
}

.bar:hover::after {
  content: attr(data-value);
  position: absolute;
  top: -2rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

.bar-label {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: auto;
}

/* 최근 활동 */
.recent-activity {
  grid-column: span 2;
}

.activity-list {
  padding: 0 1.5rem 1.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem; /* iOS zoom fix */
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 0.2rem;
}

.activity-meta {
  font-size: 1rem; /* iOS zoom fix */
  color: #64748b;
}

.activity-score {
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 1rem; /* iOS zoom fix */
}

.activity-score.good {
  background: #dcfce7;
  color: #166534;
}

.activity-score.ok {
  background: #fef3c7;
  color: #92400e;
}

.activity-score.poor {
  background: #fecaca;
  color: #991b1b;
}

/* 성취도 */
.achievement-grid {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 0.8rem;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.achievement-item:hover {
  background: #f1f5f9;
  transform: translateX(5px);
}

.achievement-icon {
  font-size: 2rem;
}

.achievement-title {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.2rem;
}

.achievement-desc {
  font-size: 1rem; /* iOS zoom fix */
  color: #64748b;
}

/* 빠른 액션 */
.action-buttons {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-radius: 0.8rem;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.action-btn.primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.action-btn.secondary {
  background: #f1f5f9;
  color: #1e293b;
  border: 1px solid #e2e8f0;
}

.action-btn.tertiary {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.action-btn.primary:hover {
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

/* 학습 목표 */
.goals-list {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.goal-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 0.8rem;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.goal-item.completed {
  background: #dcfce7;
  border-color: #bbf7d0;
}

.goal-item i {
  color: #667eea;
  width: 20px;
  text-align: center;
}

.goal-item.completed i {
  color: #16a34a;
}

.goal-item span {
  flex: 1;
  color: #1e293b;
  font-weight: 500;
}

.goal-progress, .goal-status {
  font-weight: 600;
  color: #64748b;
}

.goal-item.completed .goal-progress,
.goal-item.completed .goal-status {
  color: #16a34a;
}

/* 빈 상태 */
.no-activity, .no-achievements {
  padding: 2rem 1.5rem;
  text-align: center;
  color: #64748b;
  font-style: italic;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    padding: 0.5rem;
    gap: 1rem;
  }
  
  .recent-activity {
    grid-column: span 1;
  }
  
  .progress-stats {
    grid-template-columns: 1fr;
  }
  
  .weekly-chart {
    height: 120px;
    padding: 1rem;
  }
  
  .activity-item {
    padding: 0.75rem 0;
  }
  
  .action-buttons {
    padding: 1rem;
  }
}