/* 
 * 周报相关样式
 * 包含周报模块的所有视觉样式和互动效果
 */

/* 周报模态框 */
.weekly-review-modal {
  max-width: 90%;
  width: 90%;
  height: 90vh;
  margin: auto;
  position: fixed;
  top: 5vh;
  left: 0;
  right: 0;
  overflow-y: auto;
  background-color: var(--modal-bg-color, #fff);
  border-radius: 12px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.18);
  z-index: 1000;
  display: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
}

/* 激活状态的模态框 */
.weekly-review-modal.active,
.weekly-review-modal[style*="display: block"] {
  opacity: 1;
  transform: translateY(0);
}

/* 确保模态框显示时的滚动行为 */
body.modal-open {
  overflow: hidden;
}

body.modal-open .weekly-review-modal {
  overflow-y: auto;
}

/* 周报模态框内容 */
.weekly-review-modal .modal-content {
  margin: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  box-shadow: none;
  overflow-y: auto;
}

/* 重置内部内容的最大宽度 */
.weekly-review-modal .modal-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  overflow-y: auto;
  max-height: calc(90vh - 60px);
}

/* 周报导航 */
.week-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.week-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(76, 201, 240, 0.1);
  color: #3a9cc0;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.week-nav-btn:hover {
  background-color: rgba(76, 201, 240, 0.2);
  transform: scale(1.05);
}

.week-nav-btn:active {
  transform: scale(0.95);
}

.current-week-display {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary-color, #333);
}

/* 周报内容区 */
.weekly-review-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 10px 0;
}

/* 周报部分 */
.review-section {
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease;
}

.review-section:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary-color, #333);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  background-color: #4cc9f0;
  border-radius: 50%;
}

.section-description {
  font-size: 0.85rem;
  margin-bottom: 16px;
  color: var(--text-secondary-color, #666);
}

/* 反思输入区 */
.reflection-input {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 12px;
  min-height: 120px;
  resize: vertical;
  font-size: 0.9rem;
  line-height: 1.5;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.reflection-input:focus {
  border-color: #4cc9f0;
  outline: none;
  box-shadow: 0 0 0 2px rgba(76, 201, 240, 0.2);
}

/* 列表输入区 */
.list-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.list-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.list-input:focus {
  border-color: #4cc9f0;
  outline: none;
  box-shadow: 0 0 0 2px rgba(76, 201, 240, 0.2);
}

.add-item-btn {
  padding: 10px 15px;
  background-color: #4cc9f0;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.add-item-btn:hover {
  background-color: #3a9cc0;
  transform: translateY(-1px);
}

.add-item-btn:active {
  transform: translateY(1px);
}

/* 列表样式 */
.reflection-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.reflection-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  background-color: rgba(245, 245, 250, 0.7);
  transition: all 0.2s ease;
}

.reflection-list-item:hover {
  background-color: rgba(245, 245, 250, 1);
  transform: translateX(2px);
}

.item-text {
  flex: 1;
  font-size: 0.9rem;
}

.delete-item-btn {
  font-family: 'Arial', sans-serif !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 18px !important;
  line-height: 1 !important;
  width: 28px !important;
  height: 28px !important;
  background-color: rgba(255, 95, 87, 0.15) !important;
  color: #ff5f57 !important;
  position: relative !important;
  z-index: 10 !important;
  border: none !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
  margin-left: 8px !important;
}

.delete-item-btn:hover {
  background-color: rgba(255, 95, 87, 0.25) !important;
  transform: rotate(90deg) !important;
}

/* 确保按钮内部不会有额外的内容 */
.delete-item-btn::before,
.delete-item-btn::after {
  content: none !important;
  display: none !important;
}

/* 习惯跟踪区 */
.habits-container, .goals-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.empty-habits-message, .empty-goals-message {
  text-align: center;
  padding: 20px;
  color: #888;
  font-style: italic;
  font-size: 0.9rem;
  background-color: rgba(245, 245, 250, 0.5);
  border-radius: 6px;
}

.habit-item {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s ease;
}

.habit-item:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
}

.habit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background-color: rgba(76, 201, 240, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.habit-name {
  font-weight: 500;
  font-size: 0.95rem;
}

.delete-habit-btn {
  font-family: 'Arial', sans-serif !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 18px !important;
  line-height: 1 !important;
  width: 28px !important;
  height: 28px !important;
  background-color: rgba(255, 95, 87, 0.15) !important;
  color: #ff5f57 !important;
  position: relative !important;
  z-index: 10 !important;
  border: none !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
  margin-left: 8px !important;
}

.delete-habit-btn:hover {
  background-color: rgba(255, 95, 87, 0.25) !important;
  transform: rotate(90deg) !important;
}

/* 确保按钮内部不会有额外的内容 */
.delete-habit-btn::before,
.delete-habit-btn::after {
  content: none !important;
  display: none !important;
}

.habit-days {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
}

.habit-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.day-label {
  font-size: 0.8rem;
  color: #666;
}

.habit-checkbox {
  position: relative;
  width: 22px;
  height: 22px;
  cursor: pointer;
}

.habit-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.habit-checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 22px;
  width: 22px;
  background-color: #f5f5f5;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.habit-checkbox:hover input ~ .habit-checkmark {
  background-color: #e0e0e0;
}

.habit-checkbox input:checked ~ .habit-checkmark {
  background-color: #4cc9f0;
  border-color: #4cc9f0;
}

.habit-checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.habit-checkbox input:checked ~ .habit-checkmark:after {
  display: block;
}

.habit-checkbox .habit-checkmark:after {
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 目标样式 */
.goal-item {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s ease;
}

.goal-item:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
}

.goal-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
}

.goal-text {
  font-size: 0.95rem;
  flex: 1;
}

.goal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.priority-label {
  font-size: 0.85rem;
  color: #666;
}

.priority-select {
  padding: 4px 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  font-size: 0.85rem;
  background-color: white;
}

/* 优先级颜色 */
.goal-item[data-priority="high"] {
  border-left: 3px solid #ff5f57;
}

.goal-item[data-priority="medium"] {
  border-left: 3px solid #ffbd2e;
}

.goal-item[data-priority="low"] {
  border-left: 3px solid #4cc9f0;
}

/* 动作按钮区 */
.review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 15px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.action-btn {
  padding: 10px 15px;
  background-color: #f5f5f5;
  color: #333;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background-color: #e5e5e5;
  transform: translateY(-1px);
}

.action-btn:active {
  transform: translateY(1px);
}

.action-btn.primary {
  background-color: #4cc9f0;
  color: white;
}

.action-btn.primary:hover {
  background-color: #3a9cc0;
}

/* 分享按钮 */
.action-btn.share {
  background-color: #f472b6;
  color: white;
}

.action-btn.share:hover {
  background-color: #e44a9d;
}

/* 打印按钮 */
.action-btn.print {
  background-color: #a78bfa;
  color: white;
}

.action-btn.print:hover {
  background-color: #8b5cf6;
}

/* 图标 */
.review-icon {
  font-size: 1.2rem;
}

/* 打印样式 */
@media print {
  .modal-header, .week-nav-btn, .add-item-btn, .delete-item-btn, 
  .delete-habit-btn, .review-actions, .list-input-group {
    display: none !important;
  }
  
  body, .weekly-review-modal {
    background-color: white !important;
    box-shadow: none !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    position: relative !important;
  }
  
  .review-section {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #e0e0e0 !important;
    margin-bottom: 20px !important;
  }
  
  .current-week-display {
    font-size: 1.5rem !important;
    text-align: center !important;
    margin-bottom: 20px !important;
  }
  
  .section-title {
    color: #000 !important;
  }
  
  .section-description {
    color: #333 !important;
  }
  
  .habit-checkmark, .habit-checkbox input:checked ~ .habit-checkmark {
    border: 1px solid #000 !important;
    print-color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
  }
}

/* 响应式布局 */
@media (min-width: 768px) {
  .weekly-review-content {
    grid-template-columns: 1fr 1fr;
  }
  
  .reflection-section {
    grid-column: span 2;
  }
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.review-section {
  animation: fadeInUp 0.3s ease forwards;
}

.review-section:nth-child(1) { animation-delay: 0.1s; }
.review-section:nth-child(2) { animation-delay: 0.2s; }
.review-section:nth-child(3) { animation-delay: 0.3s; }
.review-section:nth-child(4) { animation-delay: 0.4s; }
.review-section:nth-child(5) { animation-delay: 0.5s; }

.reflection-list-item, .goal-item, .habit-item {
  animation: fadeInUp 0.3s ease forwards;
}

/* 关闭按钮样式 */
.weekly-review-modal .modal-header .close {
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  color: #666;
  transition: all 0.2s ease;
}

.weekly-review-modal .modal-header .close:hover {
  color: #333;
  transform: scale(1.1);
}

/* 移除习惯和目标项右上角的额外X按钮 */
.habit-item::before, 
.habit-item::after,
.goal-item::before,
.goal-item::after {
  content: none !important;
  display: none !important;
}

/* 彻底移除所有额外X按钮 - 最高优先级 */
.habit-item .close, 
.goal-item .close, 
.habit-item > span.close,
.goal-item > span.close,
div.habit-item div.close,
div.goal-item div.close,
.habit-item button.close,
.goal-item button.close,
#habits-container .habit-item .close,
#goals-container .goal-item .close {
  content: none !important;
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
  pointer-events: none !important;
  z-index: -999 !important;
}

/* 彻底移除所有列表项中的额外X按钮 */
.reflection-list-item::before, 
.reflection-list-item::after,
.reflection-list-item > .close,
.reflection-list-item > span.close,
li.reflection-list-item div.close,
li.reflection-list-item button.close,
#improvement-list .reflection-list-item .close,
#challenge-list .reflection-list-item .close {
  content: none !important;
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
  pointer-events: none !important;
  z-index: -999 !important;
}

/* 确保只有真正的删除按钮可见 */
.delete-habit-btn,
.delete-goal-btn,
.delete-item-btn {
  font-family: 'Arial', sans-serif !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 18px !important;
  line-height: 1 !important;
  width: 28px !important;
  height: 28px !important;
  background-color: rgba(255, 95, 87, 0.15) !important;
  color: #ff5f57 !important;
  position: relative !important;
  z-index: 10 !important;
  border: none !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
  margin-left: 8px !important;
}

.delete-habit-btn:hover,
.delete-goal-btn:hover,
.delete-item-btn:hover {
  background-color: rgba(255, 95, 87, 0.25) !important;
  transform: rotate(90deg) !important;
}

/* 确保按钮内部不会有额外的内容 */
.delete-habit-btn::before,
.delete-goal-btn::before,
.delete-item-btn::before,
.delete-habit-btn::after,
.delete-goal-btn::after,
.delete-item-btn::after {
  content: none !important;
  display: none !important;
} 