/* 모달 스타일 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  margin: 0;
  color: #2c3e50;
  font-size: 1.5em;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.close-btn:hover {
  background-color: #f0f0f0;
}

.modal-body {
  padding: 20px;
}

#activityLogModal .modal-content {
  max-width: 520px;
}

.actual-sub-activities-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.actual-sub-activities-header label {
  margin: 0;
}

.actual-edit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ecf5ff;
  color: #1f5fa5;
  border: 1px solid #b6dbff;
}

.actual-sub-activities-actions {
  justify-content: space-between;
}

.actual-sub-activities-hint {
  margin-top: 8px;
  font-size: 12px;
  color: #7f8c8d;
}

.schedule-modal-layout {
  display: flex;
  gap: 24px;
  align-items: stretch;
}

.schedule-preview {
  flex: 0 0 42%;
  min-width: 300px;
  background: #f8f9fb;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.schedule-preview-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.schedule-preview-title {
  font-weight: 700;
  color: #2c3e50;
}

.schedule-preview-meta {
  font-size: 0.9em;
  color: #6c7a89;
}

.schedule-preview-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
}

.schedule-preview-sheet {
  background: #ffffff;
}

.schedule-preview .input-field,
.schedule-preview .timer-btn,
.schedule-preview .activity-log-btn {
  pointer-events: none;
}

.schedule-preview .timer-controls-container {
  pointer-events: none;
}

.schedule-preview-note {
  min-height: 1.2em;
  font-size: 0.85em;
  color: #c0392b;
}

.schedule-form {
  flex: 1;
  min-width: 0;
}

.plan-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 20px;
  align-items: start;
}

.plan-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.plan-title-toggle-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.plan-title-toggle-row .plan-title-group {
  margin-top: 6px;
}


@media (max-width: 960px) {
  .schedule-modal-layout {
    flex-direction: column;
  }

  .schedule-preview {
    width: 100%;
    flex: none;
    min-width: 0;
  }

  .plan-editor-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  box-sizing: border-box;
  font-family: inherit;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3498db;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.save-btn,
.cancel-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.save-btn {
  background-color: #27ae60;
  color: white;
}

.save-btn:hover {
  background-color: #229954;
}

.cancel-btn {
  background-color: #95a5a6;
  color: white;
}

.cancel-btn:hover {
  background-color: #7f8c8d;
}

.schedule-button {
  position: absolute;
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
  z-index: 1000;
}

.schedule-button:hover {
  background: #2980b9;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(52, 152, 219, 0.4);
}

/* 선택 오버레이에는 항상 스케줄 버튼 표시 (정중앙) */
.selection-overlay .schedule-button {
  opacity: 1;
  pointer-events: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

