/* ========================================
   PhishShield Premium - 최상급 UI/UX
   우승을 위한 프리미엄 디자인
======================================== */

/* ========== 프리미엄 애니메이션 ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes levelUp {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* ========== 사용자 대시보드 위젯 ========== */
.user-dashboard-widget {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 1.5rem;
  border-radius: 16px;
  color: white;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
  animation: fadeInUp 0.6s ease;
}

.level-badge {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.level-icon {
  font-size: 3rem;
  animation: levelUp 2s infinite;
}

.level-info {
  flex: 1;
}

.level-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.level-score {
  font-size: 1rem;
  opacity: 0.9;
}

.next-level-progress {
  margin-top: 1rem;
}

.progress-label {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
  border-radius: 10px;
  transition: width 0.6s ease;
}

.max-level {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-top: 1rem;
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  margin-top: 1rem;
  animation: pulse 2s infinite;
}

/* ========== 프리미엄 시나리오 카드 ========== */
.scenario-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.scenario-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.scenario-stats span {
  padding: 0.5rem 1rem;
  background: var(--gray-100);
  border-radius: 20px;
  font-weight: 500;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.scenario-card {
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: 16px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.scenario-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.15);
}

.scenario-card.recommended {
  border-color: var(--success);
  background: linear-gradient(135deg, #fdfcfb 0%, #e2d1c3 100%);
}

.scenario-card.recommended::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.recommended-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.completed-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--success);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.scenario-header-card {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.real-case-badge {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

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

.scenario-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.xp-badge {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  color: var(--gray-800);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.scenario-progress {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

.stars {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.best-score {
  font-size: 0.75rem;
  color: var(--gray-600);
  font-weight: 500;
}

/* ========== 난이도 필터 ========== */
.difficulty-filter {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  border: 2px solid var(--gray-300);
  background: white;
  border-radius: 20px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  border-color: var(--primary);
  background: var(--gray-50);
}

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

/* ========== 프리미엄 훈련 UI ========== */
.training-container.premium {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.training-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 2rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.back-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s ease;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.training-title {
  flex: 1;
}

.training-title h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.training-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.training-patterns {
  padding: 1.5rem 2rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.pattern-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.pattern-tag {
  background: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chat-container {
  padding: 2rem;
  min-height: 400px;
  max-height: 500px;
  overflow-y: auto;
}

.chat-message {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.4s ease;
}

.chat-message.phisher {
  flex-direction: row;
}

.chat-message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.message-bubble {
  max-width: 70%;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  position: relative;
}

.chat-message.phisher .message-bubble {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.chat-message.user .message-bubble {
  background: var(--gray-100);
  color: var(--gray-900);
}

.chat-message.user .message-bubble.correct {
  background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
}

.chat-message.user .message-bubble.incorrect {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.message-sender {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.message-text {
  line-height: 1.6;
}

.feedback-badge {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: inline-block;
}

.response-options {
  padding: 0 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--gray-300);
  background: white;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  font-size: 1rem;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--gray-50);
  transform: translateX(5px);
}

.option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.option-btn.correct {
  background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
  border-color: var(--success);
}

.option-btn.incorrect {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  border-color: var(--danger);
}

.option-btn.recommended {
  border-color: var(--success);
  border-width: 3px;
}

.option-num {
  width: 28px;
  height: 28px;
  background: var(--gray-200);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.option-text {
  flex: 1;
  line-height: 1.5;
}

.training-progress {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.progress-steps {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.progress-step {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  transition: all 0.3s ease;
}

.progress-step.completed {
  background: var(--success);
}

.progress-step.active {
  background: var(--primary);
  transform: scale(1.2);
}

/* ========== 훈련 결과 ========== */
.training-result.premium {
  padding: 3rem 2rem;
  text-align: center;
  animation: scaleIn 0.6s ease;
}

.level-up-animation {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  color: white;
  animation: pulse 1s ease;
}

.level-up-badge {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.new-level {
  font-size: 1.5rem;
  font-weight: 600;
}

.result-score {
  margin: 2rem 0;
}

.score-circle {
  width: 200px;
  height: 200px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.result-score.excellent .score-circle {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.result-score.good .score-circle {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  color: var(--gray-800);
}

.result-score.poor .score-circle {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  color: var(--gray-800);
}

.score-value {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
}

.score-label {
  font-size: 1.25rem;
  font-weight: 500;
}

.xp-earned {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
}

.result-message {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--gray-700);
  margin: 1.5rem 0;
}

.new-achievements {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  padding: 1.5rem;
  border-radius: 16px;
  margin: 2rem 0;
}

.new-achievements h4 {
  margin-bottom: 1rem;
}

.achievement-list {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.achievement-item {
  background: white;
  padding: 0.75rem 1.25rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.achievement-icon {
  font-size: 1.5rem;
}

.achievement-name {
  font-weight: 600;
  color: var(--gray-800);
}

.training-analysis {
  background: var(--gray-50);
  padding: 1.5rem;
  border-radius: 16px;
  margin: 2rem 0;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.analysis-item {
  background: white;
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
}

.analysis-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.analysis-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.tips-section {
  background: white;
  border: 2px solid var(--gray-200);
  padding: 1.5rem;
  border-radius: 16px;
  margin: 2rem 0;
  text-align: left;
}

.tips-list {
  margin-top: 1rem;
  padding-left: 1.5rem;
}

.tips-list li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
  color: var(--gray-700);
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* ========== AI 분석 결과 (프리미엄) ========== */
.analysis-result.premium {
  animation: scaleIn 0.6s ease;
}

.result-header {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  color: white;
}

.risk-gauge {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.risk-gauge.high {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.risk-gauge.medium {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.risk-gauge.low {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.risk-gauge.safe {
  background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
}

.gauge-value {
  font-size: 2.5rem;
  font-weight: 700;
}

.gauge-label {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.9;
}

.risk-info {
  flex: 1;
}

.risk-level-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.2);
}

.personalized-warning {
  font-size: 1.125rem;
  line-height: 1.6;
  margin: 0;
}

.detected-patterns {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--gray-50);
  border-radius: 16px;
}

.pattern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.pattern-card {
  background: white;
  padding: 1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.pattern-icon {
  font-size: 1.5rem;
}

.pattern-name {
  flex: 1;
  font-weight: 600;
  color: var(--gray-800);
}

.confidence-badge {
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.ai-insight-box {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  padding: 1.5rem;
  border-radius: 16px;
  margin: 2rem 0;
}

.ai-insight-box h4 {
  margin-bottom: 1rem;
}

.ai-insight-box p {
  line-height: 1.6;
  color: var(--gray-800);
}

.action-recommendations {
  background: white;
  border: 2px solid var(--gray-200);
  padding: 1.5rem;
  border-radius: 16px;
  margin: 2rem 0;
}

.action-recommendations ul {
  margin-top: 1rem;
  padding-left: 1.5rem;
}

.action-recommendations li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
  color: var(--gray-700);
}

/* ========== 로딩 애니메이션 ========== */
.result-placeholder.loading {
  position: relative;
  overflow: hidden;
}

.loading-bar {
  width: 100%;
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  margin-top: 1rem;
  overflow: hidden;
}

.loading-progress {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
  animation: shimmer 1.5s infinite;
}

/* ========== 진단 결과 (프리미엄) ========== */
.diagnosis-result.premium {
  animation: fadeInUp 0.6s ease;
}

.immunity-level {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  color: white;
  margin-bottom: 2rem;
}

.level-badge-large {
  font-size: 5rem;
  margin-bottom: 1rem;
}

.immunity-level h3 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.level-description {
  font-size: 1.125rem;
  line-height: 1.6;
  opacity: 0.95;
}

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

.stat-card {
  background: white;
  border: 2px solid var(--gray-200);
  padding: 1.5rem;
  border-radius: 16px;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.15);
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

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

.weakness-analysis {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  padding: 1.5rem;
  border-radius: 16px;
  margin-bottom: 2rem;
}

.weakness-hint {
  margin: 0.5rem 0 1rem;
  color: var(--gray-700);
  line-height: 1.6;
}

.weakness-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.weakness-item {
  background: white;
  padding: 1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.weakness-item .pattern-icon {
  font-size: 1.5rem;
}

.weakness-item .pattern-name {
  flex: 1;
  font-weight: 600;
  color: var(--gray-800);
}

.mistake-count {
  background: var(--danger);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.strength-message {
  background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  margin-bottom: 2rem;
}

.strength-message h4 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.strength-message p {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--gray-800);
}

/* ========== 반응형 개선 ========== */
@media (max-width: 768px) {
  .scenario-grid {
    grid-template-columns: 1fr;
  }

  .result-header {
    flex-direction: column;
    text-align: center;
  }

  .diagnosis-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .action-buttons {
    flex-direction: column;
  }

  .btn-lg {
    width: 100%;
  }
}

/* ========== 버튼 스타일 개선 ========== */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  color: var(--gray-800);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(168, 237, 234, 0.3);
}

.btn-outline {
  background: white;
  border: 2px solid var(--gray-300);
  color: var(--gray-700);
}

.btn-outline:hover {
  border-color: var(--primary);
  background: var(--gray-50);
}

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