/* 영어 학습 앱 CSS - 디자인 가이드라인을 따름 */

/* 색상 변수 */
:root {
  --primary: #4CAF50;
  --secondary: #2196F3;
  --background: #FFFFFF;
  --text-primary: #333333;
  --accent-1: #FF5722;
  --accent-2: #9C27B0;
  --accent-3: #FF9800;
  --success: #4CAF50;
  --error: #F44336;
  --neutral: #FFC107;
  --shadow: rgba(0, 0, 0, 0.1);
}

/* 기본 스타일 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Comic Sans MS', 'Nanum Gothic', sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3 {
  margin-bottom: 15px;
  font-weight: 700;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 18px;
}

p {
  margin-bottom: 10px;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none;
}

/* 앱 컨테이너 */
#app {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background-color: var(--background);
  min-height: 100vh;
  position: relative;
}

/* 화면 공통 스타일 */
.screen {
  display: none;
  flex-direction: column;
  padding: 10px;
  animation: fadeIn 0.3s ease-in-out;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 헤더 스타일 */
.app-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 30px 20px;
  border-radius: 15px;
  background: linear-gradient(135deg, #6A11CB 0%, #2575FC 100%);
  color: white;
  box-shadow: 0 6px 20px rgba(37, 117, 252, 0.35);
  position: relative;
  overflow: hidden;
  animation: gradientAnimation 8s ease infinite;
}

.app-header::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 15px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  animation: bubbleFloat1 7s ease-in-out infinite;
}

.app-header::after {
  content: '';
  position: absolute;
  bottom: -5px;
  right: 20px;
  width: 25px;
  height: 25px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  animation: bubbleFloat2 5s ease-in-out infinite;
}

.app-header h1 {
  font-size: 28px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2;
}

.app-header p {
  font-size: 18px;
  opacity: 0.9;
  position: relative;
  z-index: 2;
}

/* 헤더 내 귀여운 캐릭터 요소 */
.app-header .character-dot {
  position: absolute;
  width: 25px;
  height: 25px;
  background-color: white;
  border-radius: 50%;
  opacity: 0.9;
  animation: float 4s ease-in-out infinite;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 캐릭터에 눈과 입 추가 */
.app-header .character-dot::before,
.app-header .character-dot::after {
  content: '';
  position: absolute;
  background-color: #6A11CB;
  border-radius: 50%;
  width: 4px;
  height: 4px;
  top: 8px;
}

.app-header .character-dot::before {
  left: 7px;
}

.app-header .character-dot::after {
  right: 7px;
}

/* 캐릭터 미소 추가 */
.app-header .character-dot .smile {
  position: absolute;
  bottom: 8px;
  width: 10px;
  height: 5px;
  border-radius: 0 0 10px 10px;
  border-bottom: 2px solid #6A11CB;
}

.app-header .character-dot:nth-child(1) {
  top: 20%;
  left: 15%;
  animation-delay: 0s;
  transform: scale(0.8);
}

.app-header .character-dot:nth-child(2) {
  top: 60%;
  left: 12%;
  animation-delay: 0.5s;
  transform: scale(1.1);
}

.app-header .character-dot:nth-child(3) {
  top: 25%;
  right: 15%; 
  animation-delay: 1s;
  transform: scale(0.9);
}

.app-header .character-dot:nth-child(4) {
  top: 55%;
  right: 12%;
  animation-delay: 1.5s;
  transform: scale(1);
}

@keyframes gradientAnimation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes float {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.2); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes bubbleFloat1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(10px, -15px) scale(1.3); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes bubbleFloat2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-15px, -10px) scale(1.2); }
  100% { transform: translate(0, 0) scale(1); }
}

.screen-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px;
  border-radius: 8px;
  background-color: var(--primary);
  color: white;
}

.back-button {
  background: transparent;
  color: white;
  font-size: 20px;
  margin-right: 15px;
  padding: 5px 10px;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.back-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.game-score {
  margin-left: auto;
  font-weight: bold;
}

/* 메뉴 스타일 */
.menu-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.menu-item {
  background-color: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 15px var(--shadow);
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.menu-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px var(--shadow);
}

.menu-icon {
  width: 60px;
  height: 60px;
  background-color: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  font-size: 24px;
}

.menu-item:nth-child(2) .menu-icon {
  background-color: var(--secondary);
}

.menu-item:nth-child(3) .menu-icon {
  background-color: var(--accent-1);
}

/* 게임 선택기 스타일 */
.game-selector, .quiz-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.game-option, .quiz-option {
  background-color: white;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 4px 8px var(--shadow);
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.game-option:hover, .quiz-option:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px var(--shadow);
}

.game-icon, .quiz-icon {
  width: 50px;
  height: 50px;
  background-color: var(--secondary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  font-size: 20px;
}

.game-option:nth-child(1) .game-icon {
  background-color: var(--accent-2);
}

.game-option:nth-child(3) .game-icon {
  background-color: var(--accent-3);
}

/* 카테고리 선택기 스타일 */
.category-selector {
  background-color: white;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 4px 8px var(--shadow);
  margin-bottom: 20px;
}

.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.category {
  background-color: var(--secondary);
  color: white;
  padding: 8px 15px;
  border-radius: 20px;
  font-weight: bold;
  transition: background-color 0.2s, transform 0.2s;
}

.category:hover {
  background-color: var(--primary);
  transform: scale(1.05);
}

/* 행맨 게임 스타일 */
.game-container {
  background-color: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 8px var(--shadow);
}

.word-display {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  min-height: 50px;
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 5px;
  padding: 10px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.word-letter {
  margin: 0 5px;
  padding: 5px 2px;
  min-width: 30px;
  text-align: center;
  border-bottom: 3px solid var(--primary);
  transition: all 0.3s;
  font-size: 28px;
}

/* 빈칸(언더스코어)에 대한 특별 스타일 */
.word-letter:empty::before,
.word-letter:empty::after {
  content: "";
}

/* 언더스코어 글자에 대한 스타일 */
.word-letter {
  padding-bottom: 0;
  color: var(--primary);
}

.hangman-progress {
  margin-bottom: 15px;
}

.attempts-info {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 5px;
}

.attempts-label {
  font-size: 14px;
  color: #666;
  margin-right: 5px;
}

.attempts-value {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
}

.progress-bar-container {
  height: 10px;
  background-color: #e0e0e0;
  border-radius: 5px;
  overflow: hidden;
  margin: 0 auto;
  width: 80%;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary);
  transition: width 0.5s ease;
}

.hangman-image {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  height: 200px;
  position: relative;
}

.character-container {
  position: relative;
  width: 100px;
  height: 150px;
}

.character {
  position: absolute;
  bottom: 0;
  width: 100px;
  height: 100px;
  background-color: var(--accent-3);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: bounce 2s infinite;
}

.character-face {
  width: 60px;
  height: 60px;
  background-color: white;
  border-radius: 50%;
  position: relative;
}

.character-face::before,
.character-face::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: var(--text-primary);
  border-radius: 50%;
  top: 20px;
}

.character-face::before {
  left: 15px;
}

.character-face::after {
  right: 15px;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hint-container {
  margin-bottom: 20px;
  text-align: center;
}

.hint-text {
  margin-bottom: 10px;
  font-style: italic;
}

.hint-button {
  background-color: var(--neutral);
  color: var(--text-primary);
  font-weight: bold;
  padding: 8px 15px;
  border-radius: 20px;
  transition: background-color 0.2s, transform 0.2s;
}

.hint-button:hover {
  background-color: var(--accent-3);
  transform: scale(1.05);
}

/* 행맨 게임 키보드 스타일 */
.keyboard {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 20px 0;
  gap: 8px;
}

.key {
  width: 40px;
  height: 40px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.key:hover {
  background-color: #e0e0e0;
}

.key.correct {
  background-color: #4CAF50;
  color: white;
}

.key.wrong {
  background-color: #f44336;
  color: white;
}

.key.undo-key {
  background-color: #ff9800;
  color: white;
  font-size: 20px;
  font-weight: bold;
  width: 60px;
}

/* 학습 진행 스타일 */
.progress-container {
  background-color: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 8px var(--shadow);
}

.progress-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

.progress-item {
  background-color: var(--primary);
  color: white;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
}

.progress-item h3 {
  font-size: 16px;
  margin-bottom: 5px;
}

.progress-item p {
  font-size: 24px;
  font-weight: bold;
}

.progress-item:nth-child(2) {
  background-color: var(--secondary);
}

.progress-item:nth-child(3) {
  background-color: var(--accent-2);
}

.progress-chart {
  margin-bottom: 30px;
}

.chart-container {
  height: 200px;
  background-color: #f5f5f5;
  border-radius: 8px;
  padding: 15px;
  margin-top: 10px;
}

.recent-activities {
  margin-bottom: 20px;
}

.activity-list {
  list-style-type: none;
  margin-top: 10px;
}

.activity-list li {
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.activity-list li:last-child {
  border-bottom: none;
}

/* 모달 스타일 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
  animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
  background-color: white;
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  max-width: 90%;
  width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.result-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.result-icon.success {
  background-color: var(--success);
  color: white;
}

.result-icon.failure {
  background-color: var(--error);
  color: white;
}

.result-score {
  font-size: 20px;
  font-weight: bold;
  margin: 20px 0;
}

.modal-button {
  background-color: var(--primary);
  color: white;
  padding: 10px 20px;
  margin: 10px;
  border-radius: 25px;
  font-weight: bold;
  transition: background-color 0.2s, transform 0.2s;
}

.modal-button:hover {
  background-color: var(--secondary);
  transform: scale(1.05);
}

/* 정답 확인 버튼 스타일 */
.submit-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 15px 0;
}

.submit-button {
  background-color: #4CAF50;
  color: white;
  font-size: 18px;
  font-weight: bold;
  padding: 12px 30px;
  border-radius: 30px;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.3s;
  cursor: pointer;
}

.submit-button:hover {
  background-color: #45a049;
  transform: scale(1.05);
  box-shadow: 0 5px 8px rgba(0, 0, 0, 0.3);
}

/* 반응형 스타일 */
@media (max-width: 600px) {
  .menu-container, .game-selector, .quiz-selector {
    grid-template-columns: 1fr;
  }
  
  .progress-summary {
    grid-template-columns: 1fr;
  }
  
  .keyboard {
    grid-template-columns: repeat(5, 1fr);
  }
} 