/**
 * 감정 알아차림 & 감사 일기 스타일 v2.0
 * 뉴로메트릭 디자인 시스템 적용
 * 7가지 감정 + 5개 필드 + 실시간 감사 일기
 */

/* ===== 날짜 헤더 ===== */
.emotion-date-header {
  text-align: center;
  margin: 12px 16px 16px;
}

.emotion-date-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary, #333);
  margin: 0;
}

/* ===== 데일리 체크 스타일 사용 (app.css의 .myday-section-card 재사용) ===== */

/* ===== 감정 카드 ===== */
.emotion-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.emotion-card {
  background: var(--bg-secondary, #f8f9fa);
  border-radius: var(--radius-md, 10px);
  padding: 16px;
  position: relative;
  transition: all 0.2s ease;
  border: 1px solid var(--border-light, #e5e7eb);
}

.emotion-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.emotion-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.emotion-icon-large {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.emotion-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.emotion-type {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #333);
  white-space: nowrap;
}

.emotion-intensity-text {
  font-size: 14px;
  color: #f59e0b;
  font-weight: 600;
  letter-spacing: 1px;
}

.emotion-delete-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted, #999);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.emotion-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger, #ef4444);
}

.emotion-time {
  font-size: 13px;
  color: var(--text-muted, #999);
  font-weight: 500;
  white-space: nowrap;
  margin-left: auto;
}

/* 새로운 5개 필드 스타일 */
.emotion-field {
  margin-bottom: 10px;
  padding: 10px;
  background: var(--white, #fff);
  border-radius: 6px;
  border-left: 3px solid var(--primary, #6366f1);
}

.emotion-field-label {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  margin-bottom: 4px;
  font-weight: 500;
}

.emotion-field-value {
  font-size: 14px;
  color: var(--text-primary, #333);
  line-height: 1.5;
}

/* ===== 감정 결과 (3줄 요약 + 더보기) ===== */
.emotion-result {
  margin-top: 12px;
  padding: 12px;
  background: var(--white, #fff);
  border-radius: 8px;
  border-left: 3px solid var(--primary, #6366f1);
}

.emotion-result-preview,
.emotion-result-full {
  font-size: 14px;
  color: var(--text-primary, #333);
  line-height: 1.6;
  white-space: pre-line;
  margin-bottom: 8px;
}

.emotion-more-btn {
  background: none;
  border: none;
  color: var(--primary, #6366f1);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  transition: all 0.2s ease;
  display: block;
  width: 100%;
  text-align: center;
}

.emotion-more-btn:hover {
  color: var(--primary-dark, #4f46e5);
  transform: translateY(-1px);
}

/* ===== 감정 카드 요약 ===== */
.emotion-summary {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(99, 102, 241, 0.05);
  border-radius: 6px;
  border-left: 3px solid rgba(99, 102, 241, 0.3);
  font-size: 13px;
  color: var(--text-secondary, #666);
  line-height: 1.6;
}

/* ===== 감사 일기 ===== */
.gratitude-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gratitude-item {
  background: var(--bg-secondary, #f8f9fa);
  border-radius: var(--radius-md, 10px);
  padding: 16px;
  border: 1px solid var(--border-light, #e5e7eb);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: all 0.2s ease;
  position: relative;
}

.gratitude-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

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

.gratitude-emotion {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gratitude-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.gratitude-emotion-name {
  font-size: 15px;
  color: var(--text-primary, #1c1917);
  font-weight: 600;
  white-space: nowrap;
}

.gratitude-intensity {
  font-size: 14px;
  color: #f59e0b;
  font-weight: 600;
  letter-spacing: 1px;
}

.gratitude-time {
  font-size: 13px;
  color: var(--text-muted, #999);
  font-weight: 500;
  white-space: nowrap;
  margin-left: auto;
}

.gratitude-content {
  font-size: 15px;
  color: var(--text-primary, #1c1917);
  line-height: 1.6;
  margin-bottom: 8px;
}

/* ===== 통계 섹션 ===== */

/* ===== 통계 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.stat-card {
  background: linear-gradient(135deg, #c084fc 0%, #9333ea 100%);
  border-radius: var(--radius-md, 10px);
  padding: 20px;
  text-align: center;
  color: white;
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 13px;
  opacity: 0.9;
}

/* ===== 빈 상태 ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted, #6b7280);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state p {
  margin: 8px 0;
  font-size: 15px;
}

.empty-hint {
  font-size: 13px;
  opacity: 0.7;
}

/* ===== 폼 레이블 (이모지 포함) ===== */
.form-group label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #333);
  margin-bottom: 12px;
}

/* ===== 모달 내 감정 선택 ===== */
.emotion-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.emotion-btn {
  background: var(--bg-secondary, #f8f9fa);
  border: 2px solid var(--border-light, #e5e7eb);
  border-radius: var(--radius-md, 10px);
  padding: 12px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.emotion-btn:hover {
  background: var(--bg-hover, #f1f3f5);
  transform: scale(1.05);
}

.emotion-btn.selected {
  background: var(--primary-light, #e0e7ff);
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.emotion-btn .emotion-icon {
  font-size: 28px;
}

.emotion-btn .emotion-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary, #333);
  text-align: center;
  line-height: 1.2;
}

/* ===== 강도 선택 버튼 (더 구체적인 선택자 사용) ===== */
.intensity-selector,
.gratitude-intensity-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.intensity-selector .intensity-btn,
.gratitude-intensity-selector .gratitude-intensity-btn {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 14px 16px !important;
  background: var(--bg-secondary, #f8f9fa) !important;
  border: 2px solid var(--border-light, #e5e7eb) !important;
  border-radius: var(--radius-md, 10px) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-align: left !important;
}

.intensity-selector .intensity-btn:hover,
.gratitude-intensity-selector .gratitude-intensity-btn:hover {
  background: var(--bg-hover, #f1f3f5) !important;
  border-color: var(--primary-light, #c7d2fe) !important;
  transform: translateX(2px) !important;
}

.intensity-selector .intensity-btn.selected,
.gratitude-intensity-selector .gratitude-intensity-btn.selected {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%) !important;
  border: 2px solid var(--primary, #6366f1) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
  transform: translateX(4px) !important;
}

.intensity-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.intensity-text {
  flex: 1;
}

.intensity-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #333);
  margin-bottom: 2px;
  display: block;
}

.intensity-selector .intensity-btn.selected .intensity-label,
.gratitude-intensity-selector .gratitude-intensity-btn.selected .intensity-label {
  color: var(--primary, #4f46e5) !important;
}

/* ===== 감사 감정 선택 (긍정만) ===== */
/* ===== 감사 일기 - 감정 선택 ===== */
.gratitude-emotion-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gratitude-emotion-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(251, 207, 232, 0.15);
  border: 2px solid rgba(236, 72, 153, 0.2);
  border-radius: var(--radius-md, 10px);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.gratitude-emotion-btn:hover {
  background: rgba(251, 207, 232, 0.25);
  border-color: rgba(236, 72, 153, 0.3);
  transform: translateX(2px);
}

.gratitude-emotion-btn.selected {
  background: linear-gradient(135deg, rgba(251, 207, 232, 0.3) 0%, rgba(251, 207, 232, 0.5) 100%) !important;
  border: 2px solid rgb(236, 72, 153) !important;
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.15) !important;
  transform: translateX(4px) !important;
}

.gratitude-emotion-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.gratitude-emotion-text {
  flex: 1;
}

.gratitude-emotion-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #333);
}

.gratitude-emotion-btn.selected .gratitude-emotion-label {
  color: rgb(190, 24, 93);
}

/* ===== 반응형 ===== */
@media (max-width: 768px) {
  .emotion-gratitude-wrapper {
    padding: 16px;
  }

  .emotion-cards-grid {
    grid-template-columns: 1fr;
  }

  .emotion-selector {
    grid-template-columns: repeat(3, 1fr);
  }

  .emotion-btn {
    padding: 10px 6px;
  }

  .emotion-btn .emotion-icon {
    font-size: 24px;
  }

  .emotion-btn .emotion-label {
    font-size: 11px;
  }

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

  .intensity-selector .intensity-btn,
  .gratitude-intensity-selector .gratitude-intensity-btn {
    font-size: 13px !important;
    padding: 10px 12px !important;
  }
  
  /* 모바일 - 더 구체적인 선택자 */
  .intensity-selector .intensity-btn:hover,
  .gratitude-intensity-selector .gratitude-intensity-btn:hover {
    background: var(--bg-hover, #f1f3f5) !important;
    border-color: var(--primary-light, #c7d2fe) !important;
    transform: translateX(2px) !important;
  }
  
  .intensity-selector .intensity-btn.selected,
  .gratitude-intensity-selector .gratitude-intensity-btn.selected {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%) !important;
    border: 2px solid var(--primary, #6366f1) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
    transform: translateX(4px) !important;
  }
  
  .intensity-selector .intensity-btn.selected .intensity-label,
  .gratitude-intensity-selector .gratitude-intensity-btn.selected .intensity-label {
    color: var(--primary, #4f46e5) !important;
  }
  
  /* 모바일: 라디오 버튼 레이아웃 유지 (좌측 정렬) */
  .option-radio-btn {
    gap: 10px;
    padding: 10px 12px;
    min-height: auto;
  }
  
  .option-text-wrapper {
    flex-direction: column;
    gap: 2px;
  }
  
  .option-radio-btn input[type="radio"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
  }
  
  .option-radio-btn input[type="radio"]:checked::before {
    width: 8px;
    height: 8px;
  }
  
  .option-label {
    font-size: 13px;
  }
  
  .option-desc {
    font-size: 11px;
  }
  
  /* 폼 레이블 */
  .form-group label {
    font-size: 14px;
    margin-bottom: 10px;
  }
}

/* ===== 선택형 옵션 버튼 (라디오) ===== */
.option-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-radio-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary, #f8f9fa);
  border: 2px solid var(--border-light, #e5e7eb);
  border-radius: var(--radius-md, 10px);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  min-height: 48px;
}

.option-radio-btn:hover {
  background: var(--bg-hover, #f1f3f5);
  border-color: var(--primary-light, #c7d2fe);
}

.option-radio-btn input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border: 2px solid var(--border-light, #d1d5db);
  border-radius: 50%;
  background: white;
  cursor: pointer;
  position: relative;
  margin-top: 0;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.option-radio-btn input[type="radio"]:hover {
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.option-radio-btn input[type="radio"]:checked {
  border-color: var(--primary, #6366f1);
  background: var(--primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.option-radio-btn input[type="radio"]:checked::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
}

.option-radio-btn:has(input[type="radio"]:checked) {
  background: var(--primary-light, #e0e7ff);
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.option-text-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex: 1;
  gap: 6px;
  flex-wrap: nowrap;
}

.option-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #333);
  line-height: 1.3;
  flex-shrink: 0;
}

.option-radio-btn:has(input[type="radio"]:checked) .option-label {
  font-weight: 600;
  color: var(--primary, #6366f1);
}

.option-desc {
  font-size: 11px;
  color: var(--text-muted, #9ca3af);
  line-height: 1.3;
  opacity: 0.75;
}

/* ===== 피드백 모달 ===== */
.feedback-modal-body {
  max-height: 70vh;
  overflow-y: auto;
  line-height: 1.8;
}

.feedback-message {
  margin-bottom: 20px;
  padding: 16px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: var(--radius-md, 10px);
  border-left: 4px solid #f59e0b;
}

.feedback-message p {
  font-size: 16px;
  font-weight: 600;
  color: #78350f;
  margin: 0;
}

.encouragement-message {
  padding: 20px;
  background: var(--bg-secondary, #f8f9fa);
  border-radius: var(--radius-md, 10px);
  line-height: 1.8;
  white-space: pre-line;
  font-size: 15px;
  color: var(--text-primary, #333);
  text-align: left;
}

/* 더 이상 필요 없는 스타일 */
.encouragement-message p {
  display: none;
}

/* 피드백 모달 스크롤바 스타일링 */
.feedback-modal-body::-webkit-scrollbar {
  width: 8px;
}

.feedback-modal-body::-webkit-scrollbar-track {
  background: #f1f3f5;
  border-radius: 4px;
}

.feedback-modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
}

.feedback-modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* ===== 알아차림/대응 버튼 선택기 ===== */
.awareness-selector,
.response-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.awareness-btn,
.response-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-secondary, #f8f9fa);
  border: 2px solid var(--border-light, #e5e7eb);
  border-radius: var(--radius-md, 10px);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.awareness-btn:hover,
.response-btn:hover {
  background: var(--bg-hover, #f1f3f5);
  border-color: var(--primary-light, #c7d2fe);
  transform: translateX(2px);
}

.awareness-btn.selected,
.response-btn.selected {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%) !important;
  border: 2px solid var(--primary, #6366f1) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
  transform: translateX(4px);
}

.awareness-icon,
.response-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.awareness-text,
.response-text {
  flex: 1;
}

.awareness-label,
.response-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #333);
  margin-bottom: 2px;
  display: block;
}

.awareness-btn.selected .awareness-label,
.response-btn.selected .response-label {
  color: var(--primary, #4f46e5);
}

.awareness-desc,
.response-desc {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  display: block;
}

/* ===== 이번 달 요약 ===== */
.month-summary-section {
  background: var(--white, #fff);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.month-summary-section h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, #333);
  margin: 0 0 16px 0;
}

/* ===== 데일리 체크 스타일 완전 적용 (app.css와 동일) ===== */
.myday-section-card {
  margin: 12px 16px 0;
  background: var(--white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-sm);
}

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

.myday-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.myday-streak-badge {
  background: linear-gradient(135deg, #ff6b6b, #ff8e53);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

/* ===== 통계 카드 (데일리 체크 스타일 완전 통일) ===== */
.myday-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.myday-mini-stat-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 6px 8px;
  text-align: center;
  border: 1px solid var(--border-light);
}

.myday-mini-stat-icon {
  font-size: 18px;
  margin-bottom: 4px;
}

.myday-mini-stat-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.myday-mini-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.3;
}

.myday-mini-stat-sub {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ===== 달력 (데일리 체크와 동일) ===== */
/* app.css의 .myday-cal-grid, .myday-cal-cell, .myday-dot 사용 */

.myday-calendar-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
}

.myday-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted, #6b7280);
}

/* 차트 섹션 */
#emotion-distribution-chart {
  width: 100% !important;
  max-height: 200px !important;
}

@media (max-width: 480px) {
  .emotion-selector {
    grid-template-columns: repeat(2, 1fr);
  }

  .gratitude-emotion-selector {
    flex-direction: column;
  }
  
  .myday-mini-stats {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .myday-mini-stat-icon {
    font-size: 24px;
    margin-bottom: 6px;
  }
  
  .myday-mini-stat-value {
    font-size: 16px;
  }
  
  .myday-mini-stat-label {
    font-size: 11px;
  }
  
  .myday-mini-stat-sub {
    font-size: 10px;
  }
}
