/* ==============================================
   Component Styles
   ============================================== */

/* Buttons */
.btn {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  display: inline-block;
}

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

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

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

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

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

/* Icon Button */
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.icon-btn:hover {
  transform: scale(1.1);
}

.icon-btn svg {
  width: 24px;
  height: 24px;
  fill: var(--text-primary);
}

/* Cards */
.card {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 16px;
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.card-subtitle {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.card-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Language Cards */
.language-card {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.language-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.language-card .flag {
  font-size: 48px;
  margin-bottom: 12px;
}

.language-card .name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Course Cards */
.course-card {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.course-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateX(4px);
}

.course-card-info h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.course-card-info p {
  font-size: 13px;
  color: var(--text-secondary);
}

.course-card-arrow svg {
  width: 20px;
  height: 20px;
  fill: var(--text-secondary);
}

/* Day Cards */
.day-card {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 12px; /* Default padding */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column; /* Stack children vertically */
  justify-content: center; /* Center vertically */
  align-items: center; /* Center horizontally */
  border: none;
  width: 100%;
}

@media (max-width: 480px) {
  .day-card {
    padding: 8px; /* Reduced padding for mobile to fit 4 columns */
  }
}

.day-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.day-card-main {
  flex: 1;
}

.day-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.day-meta {
  font-size: 13px;
  color: var(--text-secondary);
}

.day-status .badge {
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background-color: var(--success-light);
  color: var(--success);
}

/* Quiz Choice Buttons */
.quiz-choice-wrapper button.quiz-choice-btn {
  display: block; /* Force button to take full width and appear on its own line */
  width: 100%; /* Ensure it spans the full width of its container */
  margin-bottom: 12px; /* Add some space between buttons */
}

/* Progress Bar */
.progress-container {
  width: 100%;
  height: 8px;
  background-color: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 24px;
}

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

.progress-text {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Ad Placeholder */
.ad-container {
  margin: 24px 0;
  display: flex;
  justify-content: center;
}

.ad-placeholder {
  background-color: var(--bg-secondary);
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.ad-320x100 {
  width: 320px;
  height: 100px;
}

/* Utility Classes */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }


/* ==============================================
   피드백 모달 스타일 (마일스톤 6)
   ============================================== */

.feedback-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border-radius: 24px 24px 0 0;
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 1001;
}

.feedback-modal.show {
  transform: translateY(0);
}

/* 정답/오답 헤더 */
.feedback-header {
  text-align: center;
  margin-bottom: 24px;
}

.feedback-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: bold;
}

.feedback-icon.correct {
  background-color: #d4edda;
  color: #28a745;
}

.feedback-icon.incorrect {
  background-color: #f8d7da;
  color: #dc3545;
}

.feedback-message {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

/* 단어 정보 */
.word-info-section {
  margin-bottom: 24px;
}

.word-display {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.pronunciation-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.pronunciation-label {
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 50px;
}

.pronunciation-text {
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
  font-size: 14px;
}

.meaning-section {
  margin-bottom: 16px;
}

.meaning-primary {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.meaning-others {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.example-section {
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.example-label {
  display: block;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
}

.example-text {
  color: var(--text-primary);
  line-height: 1.6;
  font-style: italic;
  margin: 0;
}

/* 기능 아이콘 행 */
.feedback-actions {
  display: flex;
  justify-content: space-around;
  margin-bottom: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.action-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  transition: transform 0.2s;
}

.action-icon-btn:hover {
  transform: scale(1.1);
}

.action-icon-btn:active {
  transform: scale(0.95);
}

.action-icon-btn svg {
  width: 28px;
  height: 28px;
  fill: var(--text-secondary);
  transition: fill 0.2s;
}

.action-icon-btn:hover svg {
  fill: var(--primary);
}

.action-icon-btn.bookmarked svg {
  fill: #ffc107;
}

.action-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.btn-full {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
}

/* 모바일 최적화 */
@media (max-width: 480px) {
  .feedback-modal {
    padding: 20px;
  }

  .word-display {
    font-size: 24px;
  }

  .pronunciation-text {
    font-size: 12px;
  }

  .action-icon-btn svg {
    width: 24px;
    height: 24px;
  }

  .action-label {
    font-size: 11px;
  }
}


.result-header {
  text-align: center;
  margin-bottom: 24px;
}

.result-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.result-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

/* 원형 차트 */
.result-chart-container {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.circular-chart {
  position: relative;
  width: 200px;
  height: 200px;
}

.circular-svg {
  width: 100%;
  height: 100%;
}

.circle-bg {
  stroke: #e9ecef;
}

.circle-progress {
  stroke: var(--primary);
  transition: stroke-dashoffset 1s ease;
}

.chart-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.chart-percentage {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.chart-score {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* 통계 카드 */
.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.stat-correct .stat-icon {
  color: var(--success);
}

.stat-incorrect .stat-icon {
  color: var(--danger);
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

/* 단어 목록 */
.word-lists {
  margin-bottom: 24px;
}

.word-list-section {
  margin-bottom: 24px;
}

.word-list-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-color);
}

.word-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.word-item {
  background: var(--bg-secondary);
  padding: 12px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.word-item-word {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.word-item-meaning {
  font-size: 14px;
  color: var(--text-secondary);
}

.empty-message {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 20px;
  font-style: italic;
}

/* 액션 버튼 영역 */
.result-actions {
  margin-top: 24px;
}

/* 반응형 */
@media (max-width: 480px) {
  .chart-percentage {
    font-size: 32px;
  }

  .result-stats {
    gap: 8px;
  }

  .stat-icon {
    font-size: 28px;
  }

  .stat-value {
    font-size: 20px;
  }
}


.page-header {
  text-align: center;
  margin-bottom: 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 게시글 목록 */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-card {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: none;
  width: 100%;
  text-align: left;
}

.post-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateX(4px);
}

.post-card-content {
  flex: 1;
}

.post-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.post-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.post-meta {
  display: flex;
  gap: 12px;
  align-items: center;
}

.post-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.post-card-arrow svg {
  width: 20px;
  height: 20px;
  fill: var(--text-secondary);
}

/* 게시글 상세 페이지 */
.post-article {
  max-width: 720px;
  margin: 0 auto;
}

.post-header {
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
}

.post-article-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 12px;
}

.post-article-meta {
  display: flex;
  gap: 16px;
  align-items: center;
}

.post-article-date {
  font-size: 14px;
  color: var(--text-secondary);
}

/* 게시글 콘텐츠 */
.post-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
}

.post-content h2 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--primary);
}

.post-content p {
  margin-bottom: 16px;
}

.post-content ul, .post-content ol {
  margin-left: 24px;
  margin-bottom: 16px;
}

.post-content li {
  margin-bottom: 8px;
}

.post-cta {
  background: var(--bg-secondary);
  padding: 24px;
  border-radius: 12px;
  text-align: center;
  margin-top: 32px;
}

.post-cta p {
  margin-bottom: 16px;
  font-size: 16px;
}

/* 로딩/빈 상태 */
.loading-message, .empty-message {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* 반응형 */
@media (max-width: 768px) {
  .post-article-title {
    font-size: 22px;
  }

  .post-content {
    font-size: 15px;
  }

  .post-content h2 {
    font-size: 18px;
  }
}
