/* ========================================
   calendar-period.css - 经期记录对话框样式
   ======================================== */

/* 对话框遮罩层 */
.period-record-dialog,
.period-stats-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.period-dialog-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

/* 对话框内容 */
.period-dialog-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 对话框头部 */
.period-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.period-dialog-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #222;
}

.period-dialog-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  color: #666;
  cursor: pointer;
  transition: background 0.2s;
}

.period-dialog-close:hover {
  background: #e8e8e8;
}

/* 对话框主体 */
.period-dialog-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* 表单区块 */
.period-form-section {
  margin-bottom: 24px;
}

.period-form-section:last-child {
  margin-bottom: 0;
}

.period-form-section h4 {
  margin: 0 0 12px 0;
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

/* 表单组 */
.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.form-group input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  background: #fff;
}

.form-group small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #999;
}

/* 流量选项 */
.period-flow-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.flow-option {
  cursor: pointer;
}

.flow-option input[type="radio"] {
  display: none;
}

.flow-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  background: #f8f8f8;
  transition: all 0.2s;
}

.flow-option input:checked + .flow-label {
  border-color: #ff69b4;
  background: #fff0f5;
}

.flow-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.flow-label span:last-child {
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

/* 症状和心情网格 */
.period-symptoms-grid,
.period-mood-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.symptom-tag,
.mood-tag {
  cursor: pointer;
}

.symptom-tag input[type="checkbox"],
.mood-tag input[type="checkbox"] {
  display: none;
}

.symptom-tag span,
.mood-tag span {
  display: block;
  padding: 10px 8px;
  text-align: center;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  background: #f8f8f8;
  font-size: 13px;
  color: #666;
  transition: all 0.2s;
}

.symptom-tag input:checked + span,
.mood-tag input:checked + span {
  border-color: #ff69b4;
  background: #fff0f5;
  color: #ff69b4;
  font-weight: 500;
}

/* 疼痛等级 */
.pain-level-container {
  padding: 8px 0;
}

.pain-level-container input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #34c759, #ffcc00, #ff3b30);
  outline: none;
  -webkit-appearance: none;
}

.pain-level-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #ff69b4;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pain-level-container input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #ff69b4;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pain-level-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: #999;
}

#pain-level-value {
  color: #ff69b4;
  font-weight: 600;
  font-size: 14px;
}

/* 备注文本框 */
#period-notes {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

/* 对话框底部 */
.period-dialog-footer {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.btn-primary,
.btn-secondary {
  flex: 1;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #ff69b4;
  color: #fff;
}

.btn-primary:hover {
  background: #ff1493;
}

.btn-secondary {
  background: #f5f5f5;
  color: #666;
}

.btn-secondary:hover {
  background: #e8e8e8;
}

/* 统计对话框特定样式 */
.period-stats-content {
  max-height: 80vh;
}

.stats-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: #f8f8f8;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.stat-label {
  font-size: 12px;
  color: #999;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.prediction-card,
.last-period-card {
  background: #fff0f5;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.prediction-card h4,
.last-period-card h4 {
  margin: 0 0 12px 0;
  font-size: 15px;
  font-weight: 600;
  color: #ff69b4;
}

.prediction-date {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 8px 0;
}

.prediction-confidence {
  font-size: 13px;
  color: #999;
}

.last-period-card p {
  margin: 6px 0;
  font-size: 14px;
  color: #666;
}

.frequency-section {
  margin-bottom: 20px;
}

.frequency-section:last-child {
  margin-bottom: 0;
}

.frequency-section h4 {
  margin: 0 0 12px 0;
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

.frequency-list {
  background: #f8f8f8;
  border-radius: 12px;
  padding: 12px;
}

.frequency-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #e8e8e8;
}

.frequency-item:last-child {
  border-bottom: none;
}

.frequency-count {
  font-size: 13px;
  color: #ff69b4;
  font-weight: 500;
}

/* 周期设置区域 */
.period-settings-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

.period-settings-section h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.settings-description {
  margin: 0 0 16px 0;
  font-size: 14px;
  color: #666;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-input-group label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-with-unit input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.2s;
}

.input-with-unit input:focus {
  outline: none;
  border-color: #ff69b4;
  box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.1);
}

.input-with-unit .unit {
  font-size: 14px;
  color: #666;
  white-space: nowrap;
}

.settings-input-group small {
  font-size: 12px;
  color: #999;
}

.save-settings-btn {
  padding: 10px 20px;
  background: #ff69b4;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  align-self: flex-start;
}

.save-settings-btn:hover {
  background: #ff1493;
  transform: translateY(-1px);
}

.save-settings-btn:active {
  transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 480px) {
  .period-dialog-content {
    width: 95%;
    max-height: 90vh;
  }

  .period-flow-options {
    grid-template-columns: repeat(3, 1fr);
  }

  .period-symptoms-grid,
  .period-mood-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-overview {
    grid-template-columns: 1fr;
  }
}